Пример #1
0
        public async Task should_update_person()
        {
            var externalRefId = Guid.NewGuid();
            await Hooks.AddJudiciaryPerson(externalRefId);

            var updateCommand = new UpdateJudiciaryPersonByExternalRefIdCommand(externalRefId, true);
            await _commandHandler.Handle(updateCommand);

            var updatePerson = await _getJudiciaryPersonByExternalRefIdQueryHandler.Handle(new GetJudiciaryPersonByExternalRefIdQuery(externalRefId));

            updatePerson.ExternalRefId.Should().Be(updateCommand.ExternalRefId);
            updatePerson.HasLeft.Should().BeTrue();
        }
Пример #2
0
        public async Task should_update_person()
        {
            var externalRefId = Guid.NewGuid();
            await Hooks.AddJudiciaryPerson(externalRefId);

            var updateCommand = new UpdateJudiciaryPersonByExternalRefIdCommand(externalRefId, "PersonalCode", "Title", "KnownAs", "Surname", "FullName", "PostNominals", "Email", true);
            await _commandHandler.Handle(updateCommand);

            var updatePerson = await _getJudiciaryPersonByExternalRefIdQueryHandler.Handle(new GetJudiciaryPersonByExternalRefIdQuery(externalRefId));

            updatePerson.ExternalRefId.Should().Be(updateCommand.ExternalRefId);
            updatePerson.PersonalCode.Should().Be("PersonalCode");
            updatePerson.Title.Should().Be("Title");
            updatePerson.KnownAs.Should().Be("KnownAs");
            updatePerson.Surname.Should().Be("Surname");
            updatePerson.Fullname.Should().Be("FullName");
            updatePerson.PostNominals.Should().Be("PostNominals");
            updatePerson.Email.Should().Be("Email");
            updatePerson.HasLeft.Should().BeTrue();
        }
Пример #3
0
        public void should_throw_exception_when_peron_does_not_exist()
        {
            var command = new UpdateJudiciaryPersonByExternalRefIdCommand(Guid.NewGuid(), "123", "Mr", "Steve", "Allen", "Steve Allen", "nom1", "*****@*****.**", false);

            Assert.ThrowsAsync <JudiciaryPersonNotFoundException>(() => _commandHandler.Handle(command));
        }
Пример #4
0
        public void should_throw_exception_when_peron_does_not_exist()
        {
            var command = new UpdateJudiciaryPersonByExternalRefIdCommand(Guid.NewGuid(), false);

            Assert.ThrowsAsync <JudiciaryPersonNotFoundException>(() => _commandHandler.Handle(command));
        }