public void ShouldIncrementCounter_if_ScanMessageIsReceived() { string id = "A"; var scanMessage = new ScanMessage(id); sut.Tell(scanMessage); Assert.Equal(1, sut.UnderlyingActor.Count); }
public void ShouldResetPositions_If_FlushFlagIsReceived() { string id = "A"; var scanMessage = new ScanMessage(id); sut.Tell(scanMessage); sut.Tell(new CalculateMessage(true)); Assert.Equal(0, sut.UnderlyingActor.Count); }
public void ShouldReturnResult_If_CalculateMessageIsReceived() { var expectedPrice = 1; string id = "A"; calcMock.Setup(x => x.Calculate(It.IsAny<int>(), It.IsAny<ItemPricing>())).Returns(expectedPrice); var scanMessage = new ScanMessage(id); var pricing = new ItemPricing(new BatchPricing(3, 2), 1); sut.Tell(new SetPricingMessage(pricing)); sut.Tell(scanMessage); sut.Tell(new CalculateMessage(true)); var actual = ExpectMsg<double>(); Assert.Equal(expectedPrice, actual); }
public void HandleScanMessage(ScanMessage message) { Context.System.EventStream.Publish(message); Sender.Tell(message, Self); }
public void HandleScanMessage(ScanMessage message) { _positions++; }