Пример #1
0
        public void AddUser_ValidateUserName_Fail()
        {
            Usermanager usermanager = new Usermanager(r);

            string check = usermanager.AddUser("@#$ÅÄÖ");
            Assert.IsNull(check);
        }
Пример #2
0
        public void AddUser_Success()
        {
            Usermanager usermanager = new Usermanager(r);

            string check = usermanager.AddUser("Martin");
            Assert.IsNotNull(check);
        }
Пример #3
0
        public void AddUser_ValidateUserName_Fail()
        {
            Usermanager usermanager = new Usermanager(r);

            string check = usermanager.AddUser("@#$ÅÄÖ");

            Assert.IsNull(check);
        }
Пример #4
0
        public void AddUser_Success()
        {
            Usermanager usermanager = new Usermanager(r);

            string check = usermanager.AddUser("Martin");

            Assert.IsNotNull(check);
        }
Пример #5
0
        public void WrongPassword_CastsException()
        {
            Usermanager usermanager = new Usermanager(r);
            //Create user
            string password = usermanager.AddUser("Martin");

            //Change password
            usermanager.ChangePassword("Martin", "OK", "P@ssw0rd");
        }
Пример #6
0
        public void AddUser_ReturnsPassword()
        {
            Usermanager usermanager = new Usermanager(r);

            string newpassword = usermanager.AddUser("Martin");

            //How can we verify random output data? Insert our own random generator... Dependency Injection
            Assert.AreEqual("abcdefg", newpassword);
        }
Пример #7
0
        public void AddUser_ReturnsPassword()
        {
            Usermanager usermanager = new Usermanager(r);

            string newpassword = usermanager.AddUser("Martin");

            //How can we verify random output data? Insert our own random generator... Dependency Injection
            Assert.AreEqual("abcdefg", newpassword);
        }
Пример #8
0
 public void GetSHA512()
 {
     Usermanager usermanager = new Usermanager(r);
     //Create user
     string password = usermanager.AddUser("Martin");
     //Change password
     usermanager.ChangePassword("Martin", password, "P@ssw0rd");
     //Check that we can use the new password
     Assert.AreEqual("KrwZWp+QMJzee36albLxYFTn+TQ1oohiI5TivJOU4bF1sNc3V3Ugs8GJN71lLuJV/T0l8XsgfSXKtMuk/KO4/g==", usermanager.Get_Base64Encoded_SHA512Hash("Martin"));
 }
Пример #9
0
 public void ChangePassword_Success()
 {
     Usermanager usermanager = new Usermanager(r);
     //Create user
     string password = usermanager.AddUser("Martin");
     //Change password
     usermanager.ChangePassword("Martin", password, "OK");
     //Check that we can use the new password
     Assert.AreEqual(true,usermanager.Validate("Martin", "OK"));
 }
Пример #10
0
        public void GetSHA512()
        {
            Usermanager usermanager = new Usermanager(r);
            //Create user
            string password = usermanager.AddUser("Martin");

            //Change password
            usermanager.ChangePassword("Martin", password, "P@ssw0rd");
            //Check that we can use the new password
            Assert.AreEqual("KrwZWp+QMJzee36albLxYFTn+TQ1oohiI5TivJOU4bF1sNc3V3Ugs8GJN71lLuJV/T0l8XsgfSXKtMuk/KO4/g==", usermanager.Get_Base64Encoded_SHA512Hash("Martin"));
        }
Пример #11
0
        public void ChangePassword_Success()
        {
            Usermanager usermanager = new Usermanager(r);
            //Create user
            string password = usermanager.AddUser("Martin");

            //Change password
            usermanager.ChangePassword("Martin", password, "OK");
            //Check that we can use the new password
            Assert.AreEqual(true, usermanager.Validate("Martin", "OK"));
        }
Пример #12
0
 public void WrongPassword_CastsException()
 {
     Usermanager usermanager = new Usermanager(r);
     //Create user
     string password = usermanager.AddUser("Martin");
     //Change password
     usermanager.ChangePassword("Martin", "OK", "P@ssw0rd");
 }