Exemplo n.º 1
0
        public void Update(ProposedUser user, string username, ProposedUserDataDto proposedUserDataDto, ProposedUserContactDto proposedUserContactDto,
                           EntityChangedDto entityChangedDto)
        {
            Require.NotNull(user, "user");
            Require.NotNullOrWhiteSpace(username, "username");
            Require.NotNull(proposedUserDataDto, "proposedUserDataDto");
            Require.NotNull(proposedUserContactDto, "proposedUserContactDto");
            Require.NotNull(entityChangedDto, "entityChangedDto");

            user.Update(username, proposedUserDataDto, proposedUserContactDto, entityChangedDto);
        }
Exemplo n.º 2
0
        public void TestUpdateProposedUser()
        {
            ProposedUser user         = ProposedUserCreator.CreateProposedUser();
            ProposedUser userToUpdate = ProposedUserDao.Get(user.Id);

            ProposedUserDataDto proposedUserDataDto = ProposedUserCreator.CreateProposedUserDataDto("neuerVorname", "neuerNachname", Salutation.Mister, "titel", new DateTime(1990, 09, 09));

            ProposedUserContactDto proposedUserContactDto = ProposedUserCreator.CreateProposedUserContactDto("*****@*****.**",
                                                                                                             "Nürnberger Eieruhren GmbH", "Nürnberger Ei", "0", "01067", "Dresden", Country.DE,
                                                                                                             "http://www.nuernberger-eier.de", "phone", "privat", "mobile", "fax");

            userToUpdate.Update(userToUpdate.UserName, proposedUserDataDto, proposedUserContactDto, new EntityChangedDto(UserCreator.Create(), DateTime.Now));

            ProposedUserDao.FlushAndClear();

            ProposedUser actualUser = ProposedUserDao.Get(userToUpdate.Id);

            DtoAssert.AreEqual(proposedUserDataDto, actualUser.GetUserDataDto());
            DtoAssert.AreEqual(proposedUserContactDto, actualUser.GetUserContactDto());
        }