public void ChainLinkNode_ShouldAddProcessingLog() { var timerMock = new Mock <ITimerService>(); timerMock.Setup(time => time.SimulationMultiplier).Returns(1); var conveyorMock = new Mock <OneToOneConveyor>(10, Guid.NewGuid().ToString(), timerMock.Object); conveyorMock.SetupGet(conv => conv.Destination).Returns("Psc"); var bag = new Baggage(); var node = new CheckInDesk(Guid.NewGuid().ToString(), timerMock.Object); node.AddSuccessor(conveyorMock.Object); node.PassBaggage(bag); bag.Log.Count.ShouldBe(1); }
public void ChainLinkNode_ShouldMove_WhenNextIsFree_AndHasBaggage() { var timerMock = new Mock <ITimerService>(); timerMock.Setup(time => time.SimulationMultiplier).Returns(1); var conveyorMock = new Mock <OneToOneConveyor>(10, Guid.NewGuid().ToString(), timerMock.Object); conveyorMock.SetupGet(conv => conv.Destination).Returns("Psc"); conveyorMock.SetupGet(conv => conv.Status).Returns(NodeState.Free); var bag = new Baggage(); var node = new CheckInDesk(Guid.NewGuid().ToString(), timerMock.Object); node.AddSuccessor(conveyorMock.Object); node.PassBaggage(bag); conveyorMock.Verify(conv => conv.PassBaggage(bag), Times.Once); }
public void ChainLinkNode_ShouldNotAddTransportingLog_WhenTransportationTImeIsNull() { var timerMock = new Mock <ITimerService>(); timerMock.Setup(time => time.SimulationMultiplier).Returns(1); var conveyorMock = new Mock <OneToOneConveyor>(10, Guid.NewGuid().ToString(), timerMock.Object); conveyorMock.SetupGet(conv => conv.Destination).Returns("Psc"); var bag = new Baggage(); //bag.TransportationStartTime = null; var node = new CheckInDesk(Guid.NewGuid().ToString(), timerMock.Object); node.AddSuccessor(conveyorMock.Object); node.PassBaggage(bag); bag.Log.Count(l => l.Description.Contains(LoggingConstants.BagTransporterIdText)).ShouldBe(0); }