Exemplo n.º 1
0
        public void Test_Add_Get_Recipes()
        {
            string item1     = "borsh";
            string item2     = "textOfRecipe";
            string expected1 = "borsh";
            string expected2 = "textOfRecipe";

            facade.AddRecipe(item1, item2);
            string actual1 = (facade.GetRecipes().Rows[0].ItemArray[1].ToString());
            string actual2 = (facade.GetRecipes().Rows[0].ItemArray[2].ToString());

            Assert.AreEqual(expected1, actual1);
            Assert.AreEqual(expected2, actual2);
        }
Exemplo n.º 2
0
 private void button1_Click(object sender, EventArgs e)
 {
     facade = new Facade();
     try
     {
         facade.AddRecipe(textBox4.Text, textBox2.Text);
         dataGridView4.DataSource = facade.GetDishes();
         lb_error.Visible         = false;
     }
     catch (Exception)
     {
         lb_error.Visible = true;
     }
     if (lb_error.Visible != true)
     {
         textBox4.Text            = "";
         textBox2.Text            = "";
         dataGridView5.DataSource = facade.GetRecipes();
     }
 }