@@ -18,8 +18,8 @@ public static CreateChangedDocument RenameMethodToSubjectShouldAssertion(IInvoca
1818 var invocationExpression = ( InvocationExpressionSyntax ) invocation . Syntax ;
1919
2020 return async ctx => await RewriteExpression ( invocationExpression , [
21- ..Array . ConvertAll ( argumentsToRemove , arg => new RemoveNodeAction ( invocationExpression . ArgumentList . Arguments [ arg ] ) ) ,
22- new SubjectShouldAssertionAction ( subjectIndex , newName )
21+ ..Array . ConvertAll ( argumentsToRemove , arg => EditAction . RemoveNode ( invocationExpression . ArgumentList . Arguments [ arg ] ) ) ,
22+ EditAction . SubjectShouldAssertion ( subjectIndex , newName )
2323 ] , context , ctx ) ;
2424 }
2525
@@ -30,8 +30,8 @@ public static CreateChangedDocument RenameMethodToSubjectShouldGenericAssertion(
3030 var invocationExpression = ( InvocationExpressionSyntax ) invocation . Syntax ;
3131
3232 return async ctx => await RewriteExpression ( invocationExpression , [
33- ..Array . ConvertAll ( argumentsToRemove , arg => new RemoveNodeAction ( invocationExpression . ArgumentList . Arguments [ arg ] ) ) ,
34- new SubjectShouldGenericAssertionAction ( subjectIndex , newName , genericTypes )
33+ ..Array . ConvertAll ( argumentsToRemove , arg => EditAction . RemoveNode ( invocationExpression . ArgumentList . Arguments [ arg ] ) ) ,
34+ EditAction . SubjectShouldGenericAssertion ( subjectIndex , newName , genericTypes )
3535 ] , context , ctx ) ;
3636 }
3737
@@ -40,21 +40,20 @@ public static CreateChangedDocument RenameMethodToSubjectShouldAssertionWithOpti
4040 var invocationExpression = ( InvocationExpressionSyntax ) invocation . Syntax ;
4141
4242 return async ctx => await RewriteExpression ( invocationExpression , [
43- new SubjectShouldAssertionAction ( subjectIndex , newName ) ,
44- new CreateEquivalencyAssertionOptionsLambda ( optionsIndex )
43+ EditAction . SubjectShouldAssertion ( subjectIndex , newName ) ,
44+ EditAction . CreateEquivalencyAssertionOptionsLambda ( optionsIndex )
4545 ] , context , ctx ) ;
4646 }
4747
48- private static async Task < Document > RewriteExpression ( InvocationExpressionSyntax invocationExpression , IEditAction [ ] actions , CodeFixContext context , CancellationToken cancellationToken )
48+ private static async Task < Document > RewriteExpression ( InvocationExpressionSyntax invocationExpression , Action < DocumentEditor , InvocationExpressionSyntax > [ ] actions , CodeFixContext context , CancellationToken cancellationToken )
4949 {
5050 var editor = await DocumentEditor . CreateAsync ( context . Document , cancellationToken ) ;
5151
5252 foreach ( var action in actions )
5353 {
54- action . Apply ( editor , invocationExpression ) ;
54+ action ( editor , invocationExpression ) ;
5555 }
5656
5757 return editor . GetChangedDocument ( ) ;
5858 }
5959}
60-
0 commit comments