Пример #1
0
        public void test_cabinet_could_not_pick_bag_when_ticket_has_been_returned_by_robot()
        {
            var rb = new Robot();
            var cabinet = new Cabinet(2);
            rb.Add(cabinet);

            var ticket = rb.Store(new Bag());
            var pickedBag = cabinet.PickBag(ticket,false);

            Assert.AreEqual(null, pickedBag);
        }
Пример #2
0
        public void test_pick_bag_by_obselete_ticket()
        {
            var cabinet = new Cabinet();
            Ticket ticket = cabinet.Store(new Bag());
            cabinet.PickBag(ticket,false);

            Assert.IsNull(cabinet.PickBag(ticket,false));
        }
Пример #3
0
 public void test_should_throw_exception_when_picking_bag_by_non_ticket()
 {
     var cabinet = new Cabinet();
     cabinet.Store(new Bag());
     cabinet.PickBag(new object() as Ticket,false);
 }
Пример #4
0
        public void test_should_return_null_when_picking_bag_by_invalid_ticket()
        {
            var cabinet = new Cabinet();
            cabinet.Store(new Bag());
            var pickBag = cabinet.PickBag(new Ticket(),false);

            Assert.IsNull(pickBag);
        }
Пример #5
0
 public void test_should_pick_desired_bag_by_ticket()
 {
     var cabinet = new Cabinet();
     Bag bag1 = new Bag();
     Bag bag2 = new Bag();
     Ticket ticket1 = cabinet.Store(bag1);
     Ticket ticket2 = cabinet.Store(bag2);
     Assert.AreEqual(bag1, cabinet.PickBag(ticket1,false));
     Assert.AreEqual(bag2, cabinet.PickBag(ticket2,false));
 }
Пример #6
0
 public void test_should_pick_bag_by_ticket()
 {
     var cabinet = new Cabinet();
     Bag bag = new Bag();
     Ticket ticket = cabinet.Store(bag);
     Assert.AreEqual(bag, cabinet.PickBag(ticket,false));
 }