Exemplo n.º 1
0
        public void SelectAllFailConn()
        {
            setFailConn();
            ACAD food = new CADType("GebatDataConnectionString");

            food.SelectAll();
        }
Exemplo n.º 2
0
        public void SelectAll()
        {
            ACAD      food     = new CADType("GebatDataConnectionString");
            DataTable actual   = food.SelectAll();
            DataTable expected = this.tableFormat;
            DataRow   row      = expected.NewRow();

            row["Id"]   = 1;
            row["Name"] = "Kg";
            expected.Rows.Add(row);
            DataRow row2 = expected.NewRow();

            row2["Id"]   = 2;
            row2["Name"] = "Litros";
            expected.Rows.Add(row2);
            DataRow row3 = expected.NewRow();

            row3["Id"]   = 4;
            row3["Name"] = "Paquetes";
            expected.Rows.Add(row3);
            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"]);
            }
        }