public async Task should_update_person() { var externalRefId = Guid.NewGuid(); await Hooks.AddJudiciaryPerson(externalRefId); var updateCommand = new UpdateJudiciaryLeaverByExternalRefIdCommand(externalRefId, true); await _commandHandler.Handle(updateCommand); var updatePerson = await _getJudiciaryPersonByExternalRefIdQueryHandler.Handle(new GetJudiciaryPersonByExternalRefIdQuery(externalRefId)); updatePerson.ExternalRefId.Should().Be(updateCommand.ExternalRefId); updatePerson.HasLeft.Should().BeTrue(); }
public void should_throw_exception_when_peron_does_not_exist() { var command = new UpdateJudiciaryLeaverByExternalRefIdCommand(Guid.NewGuid(), true); Assert.ThrowsAsync <JudiciaryLeaverNotFoundException>(() => _commandHandler.Handle(command)); }