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); }
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); }
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()); }