Exemplo n.º 1
0
        public async Task GivenCartWith2Items_WhenCartIsCompleted_Then2QueuesAreDeclared()
        {
            CartCompleteSetup();
            UpdateCartService service = new UpdateCartService(_mockIRedisCacheClient.Object, _mockILogger.Object, _mockIConfiguration.Object, _mockGetCartItems.Object);

            var result = await service.CompleteCart("test", _mockIConnectionFactory.Object);

            _mockIModel.Verify(x => x.QueueDeclare(It.IsAny <string>(), It.IsAny <bool>(), It.IsAny <bool>(), It.IsAny <bool>(), It.IsAny <IDictionary <string, object> >()), Times.Exactly(2));
        }
Exemplo n.º 2
0
        public async Task GivenCartWithItems_WhenCartIsCompleted_ThenAllItemsSavedToInventory()
        {
            CartCompleteSetup();
            UpdateCartService service = new UpdateCartService(_mockIRedisCacheClient.Object, _mockILogger.Object, _mockIConfiguration.Object, _mockGetCartItems.Object);

            var result = await service.CompleteCart("test", _mockIConnectionFactory.Object);

            Assert.AreEqual(true, result);
        }