public void ShouldCleanupAtTheSpecifiedCycle()
        {
            //Arrange
            var mockConveyor = MockRepository.GenerateStub<IConveyor>();
            var mockRobot = MockRepository.GenerateStub<IRobot>();
            var mockVacuumPort = MockRepository.GenerateStub<IVacuumPort>();
            mockRobot.Stub(x => x.Build()).Return(new List<Widget>());

            var target = new ControlSystem(mockConveyor, mockRobot, mockVacuumPort);

            //Act
            var result = target.DoStuff(2, 1);

            //Assert
            Assert.AreEqual(2, result.Cleanups.Count());
            Assert.AreEqual(1,result.Cleanups.First().CycleCleanedAfter);
            Assert.AreEqual(2, result.Cleanups.Last().CycleCleanedAfter);
        }
        public void ShouldMoveConveyorOnDoStuff()
        {
            //Arrange
            var mockConveyor = MockRepository.GenerateStrictMock<IConveyor>();
            var mockRobot = MockRepository.GenerateStub<IRobot>();

            mockRobot.Stub(x => x.Build()).Return(new List<Widget>());

            var mockVacuumPort = MockRepository.GenerateStub<IVacuumPort>();

            mockConveyor.Expect(x => x.Run()).Repeat.Once();

            var target = new ControlSystem(mockConveyor, mockRobot, mockVacuumPort);

            //Act
            var result = target.DoStuff(1, 100);

            //Assert
            Assert.IsNotNull(result);
            Assert.AreEqual(1, result.Movements.Count());
            mockConveyor.VerifyAllExpectations();
        }
Ejemplo n.º 3
0
        public void WhenIRunTheseCycles()
        {
            var controlSystem = new ControlSystem(_conveyor, _robot, new VaccumPort());

               results = controlSystem.DoStuff(_maxRunCycles,_cleanUpBound);
        }