public async Task OrderCreatedConsumer_Success() { //Act await consumer.Consume(context); //Assert basketRedisService.Verify(x => x.RemoveBasket(userId), Times.Once); logger.VerifyLogging(LogLevel.Information); }
public async Task OrderCreatedConsumer_Success() { //Act await consumer.Consume(context); //Assert changeProductsPopularityService .Verify(x => x.ChangeProductsPopularity(It.IsAny <List <OrderItem> >(), It.IsAny <bool>()), Times.Once); logger.VerifyLogging(LogLevel.Information); }
public async Task OrderCreatedConsumer_Success() { //Arrange var context = GetContext(orderItems); productionQueueRepo.Setup(x => x.SaveAllAsync()).Returns(Task.FromResult(true)); //Act await consumer.Consume(context); //Assert productionQueueRepo.Verify(x => x.Add(It.IsAny <ProductionQueue>()), Times.Exactly(orderItems.Count)); logger.VerifyLogging(LogLevel.Information); }
public async Task OrderNeedsToBeFulfilled() { _consumer.Consume(_fixture.Create <OrderCreated>()); }