public void TestMissingUserName() { UserPasswordAuthentication authentication = new UserPasswordAuthentication("johndoe", "iknowyou"); LoginRequest credentials = new LoginRequest(); bool isValid = authentication.Authenticate(credentials); Assert.IsFalse(isValid); }
public void GetUserNameReturnsName() { string userName = "******"; LoginRequest credentials = new LoginRequest(userName); UserPasswordAuthentication authentication = new UserPasswordAuthentication(); string result = authentication.GetUserName(credentials); Assert.AreEqual(userName, result); }
public void TestIncorrectUserName() { UserPasswordAuthentication authentication = new UserPasswordAuthentication("johndoe", "iknowyou"); LoginRequest credentials = new LoginRequest("janedoe"); credentials.AddCredential(LoginRequest.PasswordCredential, "iknowyou"); bool isValid = authentication.Authenticate(credentials); Assert.IsFalse(isValid); }
public void GetSetAllProperties() { string userName = "******"; string displayName = "John Doe"; string password = "******"; UserPasswordAuthentication authentication = new UserPasswordAuthentication(); authentication.UserName = userName; Assert.AreEqual(userName, authentication.UserName, "UserName not correctly set"); Assert.AreEqual(userName, authentication.Identifier, "Identifier not correctly set"); authentication.Password = password; Assert.AreEqual(password, authentication.Password, "Password not correctly set"); authentication.DisplayName = displayName; Assert.AreEqual(displayName, authentication.DisplayName, "DisplayName not correctly set"); }