public void Empty_List() { IColList list = sql.ColList; Exception ex = Assert.Throws <CompileException>(() => engine.Compile(list)); Assert.Equal("List is empty.", ex.Message); }
public void To_String() { IAlias person = sql.Alias("person"); IColList list = sql.ColList .Add(person["Id"]) .Add(person["Active"]) .Add(person["Name"]); Assert.Equal("person.Id, person.Active, person.Name", list.ToString()); }
public void Add_Expression_Params() { Person person = null; IColList list = sql.ColList.Add(() => person.Id, () => person.Active, () => person.Name); QueryResult result = engine.Compile(list); Assert.Equal("\"person\".\"Id\", \"person\".\"Active\", \"person\".\"Name\"", engine.Compile(list).Sql); Assert.Equal(new Dictionary <string, object>(), result.Parameters); }
public void Add_Params() { IAlias person = sql.Alias("person"); IColList list = sql.ColList.Add(person["Id"], person["Active"], person["Name"]); QueryResult result = engine.Compile(list); Assert.Equal("\"person\".\"Id\", \"person\".\"Active\", \"person\".\"Name\"", engine.Compile(list).Sql); Assert.Equal(new Dictionary <string, object>(), result.Parameters); }