示例#1
0
        public void Npgsql()
        {
            const string npgsqlPath = @"C:\projects\npgsql\src\Npgsql";

            var rewriter = new Rewriter(new ConsoleLoggingAdapter(LogLevel.Debug));
            var generatedCode = rewriter.RewriteAndMerge(Directory.EnumerateFiles(npgsqlPath, "*.cs", SearchOption.AllDirectories).ToArray());
            Console.WriteLine(generatedCode);
        }
示例#2
0
        public void AllTests(string inPath, string expectedPath)
        {
            var rewriter = new Rewriter(new ConsoleLoggingAdapter(LogLevel.Debug));
            var actual = rewriter.RewriteAndMerge(new[] { inPath, asyncHelpersPath });

            actual = SyntaxFactory.SyntaxTree(SyntaxFactory.ParseCompilationUnit(actual).NormalizeWhitespace()).ToString();
            var expected = SyntaxFactory.SyntaxTree(SyntaxFactory.ParseCompilationUnit(File.ReadAllText(expectedPath)).NormalizeWhitespace()).ToString();
            if (actual != expected)
            {
                Console.WriteLine("Actual:");
                Console.WriteLine(actual);
                Console.WriteLine("********");
                Console.WriteLine("Expected:");
                Console.WriteLine(expected);
                Console.WriteLine("********");
            }
            Assert.That(actual, Is.EqualTo(expected));
        }
示例#3
0
 public RewriteAsync()
 {
     _rewriter = Log == null ? new Rewriter() : new Rewriter(new TaskLoggingAdapter(Log));
 }
示例#4
0
 public RewriteAsync()
 {
     _rewriter = Log == null ? new Rewriter() : new Rewriter(new TaskLoggingAdapter(Log));
 }