Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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));
        }