Exemplo n.º 1
0
        public void should_pick_bag_which_we_stroed_in()
        {
            var robot = new Robot(lockers);
            var bagStore = new Bag();

            Ticket ticket = robot.Store(bagStore);

            var bagPick = robot.Pick(ticket);

            Assert.AreSame(bagPick, bagStore);
        }
Exemplo n.º 2
0
        public void should_circle_pick_and_store()
        {
            var robot = new Robot(oneLocker);
            for (int i = 0; i <= oneLocker.Count; i++)
            {
                robot.Store(new Bag());
            }

            var firstBag = new Bag();
            var secondBag = new Bag();

            var firstTicket = robot.Store(firstBag);
            robot.Pick(firstTicket);

            var secondTicket = robot.Store(secondBag);

            Assert.NotNull(secondTicket);
        }
Exemplo n.º 3
0
        public void should_return_null_when_pick_bag_with_used_ticket()
        {
            var robot = new Robot(oneLocker);
            var firstBag = new Bag();

            var ticket = robot.Store(firstBag);

            robot.Pick(ticket);

            Assert.Null(robot.Pick(ticket));
        }
        public void should_get_ticket_when_manage_robots_to_store_bag()
        {
            //Given
            lockerListForRobot = new List<IBagKeeper>();
            lockerListForRobot.Add(locker);

            robot = new Robot(lockerListForRobot);
            robotList = new List<IBagKeeper>();
            robotList.Add(robot);

            manager = new Manager(robotList);

            //When
            var ticket = manager.Store(bag);

            //Then
            Assert.AreSame(bag, robot.Pick(ticket));
        }