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); }
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)); }
public RewriteAsync() { _rewriter = Log == null ? new Rewriter() : new Rewriter(new TaskLoggingAdapter(Log)); }