예제 #1
0
        public void Test_Add_Get_Sales()
        {
            string item1     = "borsh";
            int    item2     = 25;
            int    item3     = 1;
            string expected1 = "borsh";
            int    expected2 = 25;
            int    expected3 = 1;

            facade.AddSale(item1, item2, item3);
            string actual1 = (facade.GetSales().Rows[0].ItemArray[1].ToString());
            int    actual2 = (Convert.ToInt32(facade.GetSales().Rows[0].ItemArray[2]));
            int    actual3 = (Convert.ToInt32(facade.GetSales().Rows[0].ItemArray[3]));

            Assert.AreEqual(expected1, actual1);
            Assert.AreEqual(expected2, actual2);
            Assert.AreEqual(expected3, actual3);
        }
예제 #2
0
 private void button5_Click(object sender, EventArgs e)
 {
     facade = new Facade();
     try
     {
         facade.AddSale(textBox14.Text, Convert.ToDecimal(textBox13.Text), Convert.ToInt32(textBox12.Text));
         lb_error.Visible = false;
     }
     catch (Exception)
     {
         lb_error.Visible = true;
     }
     if (lb_error.Visible != true)
     {
         textBox14.Text           = "";
         textBox13.Text           = "";
         textBox12.Text           = "";
         dataGridView8.DataSource = facade.GetSales();
     }
 }