Example #1
0
 public void GetByPhone()
 {
     Book.Add(new Logic.Booking(5, EquipList, DateTime.Now, DateTime.Today, "21212121", true));
     Logic.Booking bk = Book.GetById(5);
     Book.GetByPhone("21212121");
     Assert.AreEqual("21212121", bk._phone);
 }
Example #2
0
 public void CreateBooking()
 {
     EquipList.Add(new Equipment(1, 2, DateTime.Now));
     Book.Add(new Logic.Booking(1, EquipList, DateTime.Now, DateTime.Today, "41412622", true));
     Logic.Booking bk = Book.GetById(1);
     Assert.AreEqual(bk._phone, "41412622");
 }
        private void btnDel(object sender, RoutedEventArgs e)
        {
            string[] ids = (sender as Button).Tag.ToString().Split(',');
            int      id  = Convert.ToInt32(ids[0]);

            Logic.Booking book = BookRep.GetById(Convert.ToInt32(ids[1]));
            Equipment     eq   = eqRep.GetById(id);


            DataFac.DeleteEquipmentFromBooking(eq, book);
            BookingGetSearched(search.GetPhone());
        }
Example #4
0
        public void DeleteEquipmentFromCurrentBooking()
        {
            Logic.Booking bk = Book.GetById(2);
            Equipment     eq = new Equipment(2, 1);

            int nr = bk._equipment.Count;

            Book.DeleteEquipmentFromBooking(eq, bk);
            bk = Book.GetById(2);
            int newnr = bk._equipment.Count;

            Assert.AreEqual(nr - 1, newnr);
        }
Example #5
0
        public void AddEquipmentToCurrentBooking()
        {
            Logic.Booking bk = Book.GetById(1);
            Equipment     eq = new Equipment(2, 1);

            int nr = bk._equipment.Count;

            Book.AddEquipmentToBooking(eq, bk);
            bk = Book.GetById(1);
            int newnr = bk._equipment.Count;

            Assert.AreEqual(nr + 1, newnr);
        }