Beispiel #1
0
 private void AssertStatement(Statement statement, string expectedOutput)
 {
     using (var writer = new IndentedTextWriter(new StringWriter(), "  "))
     {
         writer.Indent += 1; // Adjust tab width; tests tab lineup for newlines.
         using (var tsql = new TSqlCodeProvider())
         {
             tsql.GenerateCodeFromStatement(statement, writer, new CodeGeneratorOptions());
             var output = writer.InnerWriter.ToString();
             Assert.IsTrue(output.ToString() == expectedOutput);
         }
     }
 }
Beispiel #2
0
 private void AssertClause(Clause clause, string expectedOutput)
 {
     using (var writer = new IndentedTextWriter(new StringWriter(), "  "))
     {
         using (var tsql = new TSqlCodeProvider())
         {
             tsql.GenerateCodeFromStatement(clause, writer, new CodeGeneratorOptions());
             var output = writer.InnerWriter.ToString();
             Assert.IsTrue(output.ToString() == expectedOutput);
         }
     }
 }