Пример #1
0
 public void Login_ValidUserWithValidPasswordSupplied_LoginSuccess()
 {
     var emailAddress = "*****@*****.**";
     var user = _userManagementService.Create(Guid.NewGuid(), "Chris", emailAddress, "p'ssw0rd", "Job Title");
     var userAccountRepositoryStub = MockRepository.GenerateStub<IUserAccountRepository>();
     userAccountRepositoryStub.Stub(x => x.GetByEmail(emailAddress, false)).Return(user);
     _userManagementService = UserManagementServiceFactory.Create(userAccountRepositoryStub);
     var loggedIn = _userManagementService.Login(emailAddress, "p'ssw0rd");
     Assert.IsTrue(loggedIn);
 }
Пример #2
0
 public void Login_ValidUserWithNoPasswordSupplied_DomainValidationExceptionThrown()
 {
     var userAccountRepositoryStub = MockRepository.GenerateStub<IUserAccountRepository>();
     userAccountRepositoryStub.Stub(x => x.GetByEmail("*****@*****.**", false)).Return(new UserAccount() { EmailAddress = "*****@*****.**" });
     _userManagementService = UserManagementServiceFactory.Create(userAccountRepositoryStub);
     _userManagementService.Login("*****@*****.**", String.Empty);
 }