public void ShouldNotMutate(SyntaxKind original) { var target = new AddMutator(); var originalNode = SyntaxFactory.BinaryExpression(original, SyntaxFactory.LiteralExpression(SyntaxKind.NumericLiteralExpression, SyntaxFactory.Literal(1)), SyntaxFactory.LiteralExpression(SyntaxKind.NumericLiteralExpression, SyntaxFactory.Literal(8))); var result = target.ApplyMutations(originalNode).ToList(); Assert.Empty(result); }
public void ShouldMutate(SyntaxKind original, SyntaxKind expected) { var target = new AddMutator(); var originalNode = SyntaxFactory.BinaryExpression(original, SyntaxFactory.LiteralExpression(SyntaxKind.NumericLiteralExpression, SyntaxFactory.Literal(1)), SyntaxFactory.LiteralExpression(SyntaxKind.NumericLiteralExpression, SyntaxFactory.Literal(8))); var result = target.ApplyMutations(originalNode).ToList(); Assert.Single(result); Assert.True(result.First().ReplacementNode.IsKind(expected)); }