Exemple #1
0
        public void SelectWhereFailConn()
        {
            setFailConn();

            ACAD food = new CADFood("GebatDataConnectionString");

            food.SelectWhere("Name = 'Patates'");
        }
Exemple #2
0
        public void SelectWhere()
        {
            ACAD      food     = new CADFood("GebatDataConnectionString");
            DataTable expected = tableFormat;
            DataRow   row      = expected.NewRow();

            row["Id"]       = 1;
            row["Name"]     = "Patates";
            row["Quantity"] = 2;
            expected.Rows.Add(row);
            DataTable actual = food.SelectWhere("Name = 'Patates'");

            for (int i = 0; i < expected.Rows.Count; i++)
            {
                Assert.AreEqual(expected.Rows[i]["Id"], actual.Rows[i]["Id"]);
                Assert.AreEqual(expected.Rows[i]["Name"], actual.Rows[i]["Name"]);
                Assert.AreEqual(expected.Rows[i]["Quantity"], actual.Rows[i]["Quantity"]);
            }
        }
Exemple #3
0
        public void SelectWjereInvalidStatement()
        {
            ACAD food = new CADFood("GebatDataConnectionString");

            food.SelectWhere("Name = ; ");
        }
Exemple #4
0
        public void SelectWhereInvalidStart()
        {
            ACAD food = new CADFood("GebatDataConnectionString");

            food.SelectWhere("Name = 'Patates'", -3);
        }