public void TestMissingUserName() { UserNameAuthentication authentication = new UserNameAuthentication("janedoe"); LoginRequest credentials = new LoginRequest(); bool isValid = authentication.Authenticate(credentials); Assert.IsFalse(isValid); }
public void TestValidUserName() { UserNameAuthentication authentication = new UserNameAuthentication("johndoe"); LoginRequest credentials = new LoginRequest("johndoe"); bool isValid = authentication.Authenticate(credentials); Assert.IsTrue(isValid); }
public void GetDisplayNameReturnsUserName() { string userName = "******"; LoginRequest credentials = new LoginRequest(userName); UserNameAuthentication authentication = new UserNameAuthentication(); string result = authentication.GetDisplayName(credentials); Assert.AreEqual(userName, result); }
internal void MakeReadOnly() { _isReadOnly = true; ClientCertificate.MakeReadOnly(); IssuedTokenAuthentication.MakeReadOnly(); SecureConversationAuthentication.MakeReadOnly(); ServiceCertificate.MakeReadOnly(); UserNameAuthentication.MakeReadOnly(); WindowsAuthentication.MakeReadOnly(); }
public void GetSetAllProperties() { string userName = "******"; string displayName = "John Doe"; UserNameAuthentication authentication = new UserNameAuthentication(); authentication.UserName = userName; Assert.AreEqual(userName, authentication.UserName, "UserName not correctly set"); Assert.AreEqual(userName, authentication.Identifier, "Identifier not correctly set"); authentication.DisplayName = displayName; Assert.AreEqual(displayName, authentication.DisplayName, "DisplayName not correctly set"); }