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);
        }
예제 #4
0
 public void HandleScanMessage(ScanMessage message)
 {
     Context.System.EventStream.Publish(message);
     Sender.Tell(message, Self);
 }
예제 #5
0
 public void HandleScanMessage(ScanMessage message)
 {
     _positions++;
 }