예제 #1
0
        public void TestGreenDeleteNone()
        {
            //statements in block constitute a SyntaxList
            var input  = "{A();B();C();}"; //NB: no whitespace, since it would be deleted
            var output = input;

            var rewriter = new GreenRewriter();

            TestGreen(input, output, rewriter, isExpr: false);
        }
예제 #2
0
        public void TestGreenSeparatedDeleteNone()
        {
            //the type argument list is a SeparateSyntaxList
            var input  = "A<B,C,D>"; //NB: no whitespace, since it would be deleted
            var output = input;

            var rewriter = new GreenRewriter();

            TestGreen(input, output, rewriter, isExpr: true);
        }
예제 #3
0
        public void TestGreenDeleteNone()
        {
            //statements in block constitute a SyntaxList
            var input = "{A();B();C();}"; //NB: no whitespace, since it would be deleted
            var output = input;

            var rewriter = new GreenRewriter();

            TestGreen(input, output, rewriter, isExpr: false);
        }
예제 #4
0
        public void TestGreenSeparatedDeleteNone()
        {
            //the type argument list is a SeparateSyntaxList
            var input = "A<B,C,D>"; //NB: no whitespace, since it would be deleted
            var output = input;

            var rewriter = new GreenRewriter();

            TestGreen(input, output, rewriter, isExpr: true);
        }
예제 #5
0
        private static void TestGreen(string input, string output, GreenRewriter rewriter, bool isExpr)
        {
            var red   = isExpr ? (CSharpSyntaxNode)SyntaxFactory.ParseExpression(input) : SyntaxFactory.ParseStatement(input);
            var green = red.CsGreen;

            Assert.False(green.ContainsDiagnostics);

            var result = rewriter.Visit(green);

            Assert.Equal(input == output, ReferenceEquals(green, result));
            Assert.Equal(output, result.ToFullString());
        }
예제 #6
0
        private static void TestGreen(string input, string output, GreenRewriter rewriter, bool isExpr)
        {
            var red = isExpr ? (CSharpSyntaxNode)SyntaxFactory.ParseExpression(input) : SyntaxFactory.ParseStatement(input);
            var green = red.CsGreen;

            Assert.False(green.ContainsDiagnostics);

            var result = rewriter.Visit(green);

            Assert.Equal(input == output, ReferenceEquals(green, result));
            Assert.Equal(output, result.ToFullString());
        }