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)); }
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); }