public void Edit_EmailGreaterThan256Characters_DomainValidationExceptionThrown()
 {
     var id = Guid.NewGuid();
     var user = _userManagementService.Create(id, "Chris", "*****@*****.**", "p'ssw0rd", "Job Title");
     var userAccountRepositoryStub = MockRepository.GenerateStub<IUserAccountRepository>();
     userAccountRepositoryStub.Stub(x => x.GetById(id)).Return(user);
     _userManagementService = UserManagementServiceFactory.Create(userAccountRepositoryStub);
     _userManagementService.Edit(id, "Chris", String.Format("chris@{0}", GreaterThan256Characters), "Job Title");
 }
 public void Edit_NonUniqueEmailSupplied_DomainValidationExceptionThrown()
 {
     var id = Guid.NewGuid();
     var user = _userManagementService.Create(id, "Chris", "*****@*****.**", "p'ssw0rd", "Job Title");
     var user2 = _userManagementService.Create(Guid.NewGuid(), "Chris2", "*****@*****.**", "p'ssw0rd", "Job Title");
     var userAccountRepositoryStub = MockRepository.GenerateStub<IUserAccountRepository>();
     userAccountRepositoryStub.Stub(x => x.GetById(id)).Return(user);
     userAccountRepositoryStub.Stub(x => x.GetByEmail("*****@*****.**", true)).Return(user2);
     _userManagementService = UserManagementServiceFactory.Create(userAccountRepositoryStub);
     _userManagementService.Edit(id, "Chris", "*****@*****.**", "Job Title");
 }
 public void Edit_SuccessfullyEditUser_UserEdited()
 {
     var id = Guid.NewGuid();
     var user = _userManagementService.Create(id, "Chris", "*****@*****.**", "p'ssw0rd", "Job Title");
     var userAccountRepositoryMock = MockRepository.GenerateMock<IUserAccountRepository>();
     userAccountRepositoryMock.Stub(x => x.GetById(id)).Return(user);
     userAccountRepositoryMock.Expect(x => x.Update(null)).IgnoreArguments();
     _userManagementService = UserManagementServiceFactory.Create(userAccountRepositoryMock);
     _userManagementService.Edit(id, "Chris - edited", "*****@*****.**", "Job Title - edited");
     userAccountRepositoryMock.VerifyAllExpectations();
 }
 public void Edit_InvalidIdSupplied_ArgumentExceptionThrown()
 {
     var id = Guid.NewGuid();
     var user = _userManagementService.Create(id, "Chris", "*****@*****.**", "p'ssw0rd", "Job Title");
     var userAccountRepositoryStub = MockRepository.GenerateStub<IUserAccountRepository>();
     userAccountRepositoryStub.Stub(x => x.GetById(id)).Return(user);
     _userManagementService = UserManagementServiceFactory.Create(userAccountRepositoryStub);
     _userManagementService.Edit(Guid.NewGuid(), "Chris - edited", "*****@*****.**", "Job Title");
 }