Beispiel #1
0
        public void Empty_List()
        {
            IColList list = sql.ColList;

            Exception ex = Assert.Throws <CompileException>(() => engine.Compile(list));

            Assert.Equal("List is empty.", ex.Message);
        }
Beispiel #2
0
        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());
        }
Beispiel #3
0
        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);
        }
Beispiel #4
0
        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);
        }