Ejemplo n.º 1
0
        public void ShouldPickBagSuccessfullyBySuperRobot()
        {
            var cabinet1 = new Cabinet(1);
            var cabinet2 = new Cabinet(2);
            var cabinets = new List<Cabinet> { cabinet1, cabinet2 };
            var superRobot = new Robot(cabinets, new HighestVacancyRateSelector(cabinets));
            var bag = new Bag();
            var ticket = superRobot.Store(bag);

            var pickedBag = superRobot.Pick(ticket);
            Assert.AreSame(bag, pickedBag);
        }
Ejemplo n.º 2
0
        public void ShouldPickBagSuccessfullyByRobot()
        {
            var cabinet1 = new Cabinet(1);
            cabinet1.Store(new Bag());
            var cabinet2 = new Cabinet(1);
            var cabinets = new List<Cabinet> {cabinet1, cabinet2};

            var robot = new Robot(cabinets, new SequentialSelector(cabinets));
            var bag = new Bag();
            var ticket = robot.Store(bag);

            var pickedBag = robot.Pick(ticket);
            Assert.AreSame(bag, pickedBag);
        }