Exemple #1
0
        public void Where_adds_equals_clause()
        {
            Select select = new Select();

            SelectExtensions.Where(select, "foo", 2);

            select.Parameters.Count().MustBe(1);
            select.Parameters["@p0"].MustBe(2);
            select.Where().Sql().MustBe("where foo=@p0");
        }
Exemple #2
0
        public void Where_adds_clause()
        {
            Select select = new Select();

            SelectExtensions.Where(select, "foo", SqlOperator.LessThan, 2);

            select.Parameters.Count().MustBe(1);
            select.Parameters["@p0"].MustBe(2);
            select.Where().Sql().MustBe("where foo<@p0");
        }
Exemple #3
0
        public void Where_adds_clause_when_clauses_already_exist()
        {
            Select <TestClass> select = new Select <TestClass>();

            select.Where(x => x.Id, 7);
            SelectExtensions.Where(select, "foo", SqlOperator.LessThan, 2);

            select.Parameters.Count().MustBe(2);
            select.Parameters["@p0"].MustBe(7);
            select.Parameters["@p1"].MustBe(2);
            select.Where().Sql().MustBe("where (Id=@p0 And foo<@p1)");
        }