public async Task CreateOrderCommand_OrderIdDoesNotExist_ShouldThrowNotFoundException() { var sut = new CompleteOrderCommandHandler(_fixtures.Context); await sut.Handle(new CompleteOrderCommand { OrderId = Guid.NewGuid(), Complete = true }, CancellationToken.None) .ShouldThrowAsync <NotFoundException>(); }
public async Task CompleteOrderCommand_OrderIsNotComplete_ShouldSetCompleteToTrue() { var sut = new CompleteOrderCommandHandler(_fixtures.Context); await sut.Handle(new CompleteOrderCommand { OrderId = _fixtures.Order.Id, Complete = true }, CancellationToken.None); var orderInDb = await _fixtures.Context.Order.SingleOrDefaultAsync(o => o.Id == _fixtures.Order.Id, CancellationToken.None); orderInDb.Complete.ShouldBe(true); }