public void LoginAuthenicationServiceReturnsFailedResultIfUserIdIsNotInDataBase() { var service = new LoginAuthenticationService(MockDataAccessForUserNotInDatabase().Object, new RijnadelEncryptionCipher(), EncryptionKey); AuthenicationResult result = service.Authenicate(UnRegisteredUser, InCorrectPassword.ToSecureString()); Assert.IsNotNull(result); Assert.IsFalse(result.IsSuccessful); Assert.AreEqual("Login Authenication Failed. Invalid UserName or Password.", result.Message); }
public void LoginAuthenicationServiceReturnsFailedResultIfDataAccessLayerFails() { var service = new LoginAuthenticationService(MockFailingDataAccess().Object, new RijnadelEncryptionCipher(), EncryptionKey); AuthenicationResult result = service.Authenicate(UserId, CorrectPassword.ToSecureString()); Assert.IsNotNull(result); Assert.IsFalse(result.IsSuccessful); Assert.AreEqual("Login Authenication Failed. Unable to connect to database. Please contact support.", result.Message); }
public void LoginAuthenicationServiceReturnsSuccessfulResultIfPasswordsMatch() { var service = new LoginAuthenticationService(MockDataAccess().Object, new RijnadelEncryptionCipher(), EncryptionKey); AuthenicationResult result = service.Authenicate(UserId, CorrectPassword.ToSecureString()); Assert.IsNotNull(result); Assert.IsTrue(result.IsSuccessful); Assert.AreEqual("Login Authenication successful.", result.Message); }