public async Task Handler_Throws_If_Unable_To_Find_Wish_For_UserId() { await InitializeRecords(); var command = new WishCompleteItemCommand(Guid.NewGuid(), _testRecord.Id); var callWithNonMatchingWishId = async() => await _handler.Handle(command); await callWithNonMatchingWishId.Should().ThrowAsync <InvalidOperationException>(); }
public WishCompleteItemCommandHandlerTests() { var fixture = new Fixture(); fixture.Behaviors.Add(new OmitOnRecursionBehavior()); _testRecord = fixture.Create <WishRecord>(); _testCommand = new WishCompleteItemCommand(_testRecord.User.Id, _testRecord.Id); _writeContext = InitializeDatabase(); _handler = new WishCompleteItemCommandHandler(_writeContext); }