Пример #1
0
 public void TestDelimitTable()
 {
     //-------------Setup Test Pack ------------------
     const string leftDelimiter = "LEFT_DELIMIT";
     const string rightDelimiter = "RIGHT_DELIMIT";
     SqlFormatter sqlFormatter = new SqlFormatter(leftDelimiter, rightDelimiter,"","");
     const string tableName = "MY_TABLE";
     //-------------Execute test ---------------------
     string delimitedField = sqlFormatter.DelimitTable(tableName);
     //-------------Test Result ----------------------
     Assert.AreEqual(String.Format("{0}{1}{2}", leftDelimiter, tableName, rightDelimiter), delimitedField);
 }
Пример #2
0
 public void Test_DelimitTable_WithSchemaPrefix_ShouldReturnWellFormattedDelimiters()
 {
     //-------------Setup Test Pack ------------------
     const string leftDelimiter = "[";
     const string rightDelimiter = "]";
     const string expected = "[MY_SCHEMA].[MY_TABLE]";
     SqlFormatter sqlFormatter = new SqlFormatter(leftDelimiter, rightDelimiter, "", "");
     const string tableName = "MY_SCHEMA.MY_TABLE";
     //-------------Execute test ---------------------
     string delimitedField = sqlFormatter.DelimitTable(tableName);
     
     //-------------Test Result ----------------------
     Assert.AreEqual(expected, delimitedField);
 }