Exemplo n.º 1
0
        public void TestMissingUserName()
        {
            UserNameAuthentication authentication = new UserNameAuthentication("janedoe");
            LoginRequest           credentials    = new LoginRequest();
            bool isValid = authentication.Authenticate(credentials);

            Assert.IsFalse(isValid);
        }
Exemplo n.º 2
0
        public void TestValidUserName()
        {
            UserNameAuthentication authentication = new UserNameAuthentication("johndoe");
            LoginRequest           credentials    = new LoginRequest("johndoe");
            bool isValid = authentication.Authenticate(credentials);

            Assert.IsTrue(isValid);
        }
Exemplo n.º 3
0
        public void GetDisplayNameReturnsUserName()
        {
            string                 userName       = "******";
            LoginRequest           credentials    = new LoginRequest(userName);
            UserNameAuthentication authentication = new UserNameAuthentication();
            string                 result         = authentication.GetDisplayName(credentials);

            Assert.AreEqual(userName, result);
        }
Exemplo n.º 4
0
 internal void MakeReadOnly()
 {
     _isReadOnly = true;
     ClientCertificate.MakeReadOnly();
     IssuedTokenAuthentication.MakeReadOnly();
     SecureConversationAuthentication.MakeReadOnly();
     ServiceCertificate.MakeReadOnly();
     UserNameAuthentication.MakeReadOnly();
     WindowsAuthentication.MakeReadOnly();
 }
Exemplo n.º 5
0
        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");
        }