示例#1
0
        public void Test_Add_Get_ProductTypes()
        {
            string item     = "vegetable";
            string expected = "vegetable";

            facade.AddProductTypes(item);
            string actual = (facade.GetProductTypes().Rows[0].ItemArray[0].ToString());

            Assert.AreEqual(expected, actual);
        }
示例#2
0
 private void buttonProd_Click(object sender, EventArgs e)
 {
     facade = new Facade();
     try
     {
         facade.AddProductTypes(textBoxProdT.Text);
         lb_error.Visible = false;
     }
     catch (Exception)
     {
         lb_error.Visible = true;
     }
     if (lb_error.Visible != true)
     {
         textBoxProdT.Text        = "";
         dataGridView2.DataSource = facade.GetProductTypes();
     }
 }