public void Formatting2() { string inputFile = @"..\..\T30\Input2.cs"; string expectedFile = @"..\..\T30\Output2.cs"; ComposerFiles composer = new ComposerFiles(); string outputFile = Path.GetTempFileName() + ".txt"; composer.Compose(inputFile, outputFile, _dbReader); string output = File.ReadAllText(outputFile); string expected = File.ReadAllText(expectedFile); ConstantsPR.AssertSpaceEqual(expected, output, "Output should have expected syntax."); ConstantsPR.AssertFormatEqual(expected, output, "Output should have expected format."); }
public void Reading_Access_OleDB() { string inputFile = @"..\..\T33\Input.cs"; string expectedFile = @"..\..\T33\Output.cs"; _dbReader = new DbReader(null, null, null); ComposerFiles composer = new ComposerFiles(); // do it first time string outputFile = Path.GetTempFileName() + ".txt"; composer.Compose(inputFile, outputFile, _dbReader); string output = File.ReadAllText(outputFile); string expected = File.ReadAllText(expectedFile); ConstantsPR.AssertSpaceEqual(output, expected, "Output should be as expected."); }
public void SqlServer_ConnectionString() { if (ConstantsPR.HasNoAdventureWorks) { /* AdventureWorks sample database has to be available. */ return; } string inputFile = @"..\..\T31\Input3.cs"; string expectedFile = @"..\..\T31\Output.cs"; ComposerFiles composer = new ComposerFiles(); // do it first time string outputFile = Path.GetTempFileName() + ".txt"; composer.Compose(inputFile, outputFile, _dbReader); // compare with expected string output = File.ReadAllText(outputFile); string expected = File.ReadAllText(expectedFile); output = output.RemoveTextBetween("[EnumSqlCnn(", ")]"); expected = expected.RemoveTextBetween("[EnumSqlCnn(", ")]"); ConstantsPR.AssertSpaceEqual(expected, output, "Output file should match expected file."); // do it second time inputFile = outputFile; outputFile = outputFile + "2.txt"; composer.Compose(inputFile, outputFile, _dbReader); // compare with expected string output2 = File.ReadAllText(outputFile); output2 = output2.RemoveTextBetween("[EnumSqlCnn(", ")]"); ConstantsPR.AssertSpaceEqual(expected, output2, "Second run of composer should not change the file."); }