예제 #1
0
파일: SqlTests.cs 프로젝트: jgshort/SqlDom
 private void AssertExpression(Expression expression, string expectedOutput)
 {
     using (var writer = new IndentedTextWriter(new StringWriter(), "  "))
     {
         using (var tsql = new TSqlCodeProvider())
         {
             tsql.GenerateCodeFromExpression(expression, writer, new CodeGeneratorOptions());
             var output = writer.InnerWriter.ToString();
             Assert.IsTrue(output == expectedOutput);
         }
     }
 }
예제 #2
0
파일: SqlTests.cs 프로젝트: jgshort/SqlDom
 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);
         }
     }
 }
예제 #3
0
파일: SqlTests.cs 프로젝트: jgshort/SqlDom
 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);
         }
     }
 }