Exemplo n.º 1
0
        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();
        }
Exemplo n.º 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();
        }