@@ -18,8 +18,8 @@ public static CreateChangedDocument RenameMethodToSubjectShouldAssertion(IInvoca
18
18
var invocationExpression = ( InvocationExpressionSyntax ) invocation . Syntax ;
19
19
20
20
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 )
23
23
] , context , ctx ) ;
24
24
}
25
25
@@ -30,8 +30,8 @@ public static CreateChangedDocument RenameMethodToSubjectShouldGenericAssertion(
30
30
var invocationExpression = ( InvocationExpressionSyntax ) invocation . Syntax ;
31
31
32
32
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 )
35
35
] , context , ctx ) ;
36
36
}
37
37
@@ -40,21 +40,20 @@ public static CreateChangedDocument RenameMethodToSubjectShouldAssertionWithOpti
40
40
var invocationExpression = ( InvocationExpressionSyntax ) invocation . Syntax ;
41
41
42
42
return async ctx => await RewriteExpression ( invocationExpression , [
43
- new SubjectShouldAssertionAction ( subjectIndex , newName ) ,
44
- new CreateEquivalencyAssertionOptionsLambda ( optionsIndex )
43
+ EditAction . SubjectShouldAssertion ( subjectIndex , newName ) ,
44
+ EditAction . CreateEquivalencyAssertionOptionsLambda ( optionsIndex )
45
45
] , context , ctx ) ;
46
46
}
47
47
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 )
49
49
{
50
50
var editor = await DocumentEditor . CreateAsync ( context . Document , cancellationToken ) ;
51
51
52
52
foreach ( var action in actions )
53
53
{
54
- action . Apply ( editor , invocationExpression ) ;
54
+ action ( editor , invocationExpression ) ;
55
55
}
56
56
57
57
return editor . GetChangedDocument ( ) ;
58
58
}
59
59
}
60
-
0 commit comments