public void TestComplexSelectGetFieldName() { string expected = "a.dept"; ComplexSelectStatment select = new ComplexSelectStatment(); select.AddTable("emp"); select.AddField("dept", "emp"); Assert.AreEqual(expected.ToLower(), select.GetSQLFormatFieldName("dept").ToLower()); }
public void TestComplexSelect() { string expected = "SELECT a.empid, a.name, b.dept"; ComplexSelectStatment select = new ComplexSelectStatment(); select.AddTable("emp"); select.AddTable("dept"); select.AddField("empid", "emp"); select.AddField("name", "emp"); select.AddField("dept", "dept"); Assert.AreEqual(expected.ToLower(), select.ToString().ToLower()); }
static void Main(string[] args) { //TestDBAccess(); //TestComplexClause(); //TestComplexClauseNoJoin(); ComplexSelectStatment select = new ComplexSelectStatment(); select.AddTable("emp"); select.AddTable("dept"); select.AddField("empid", "emp"); select.AddField("name", "emp"); select.AddField("dept", "dept"); Console.WriteLine(select.ToString()); Console.ReadKey(); }