Esempio n. 1
0
        public void Should_Macth_Valid_Password()
        {
            string valid_password = "******";
            string salt = string.Empty;

            var user = new User();
            user.Password = CryptographyHelper.EncryptPassword(valid_password, out salt);
            user.Salt = salt;

            var match = user.VerifyPasswordMatch(valid_password);

            Assert.IsTrue(match);
        }
Esempio n. 2
0
        public void Should_Not_Macth_Wrong_Password()
        {
            string not_valid_password = "******";
            string valid_password = "******";
            string salt = string.Empty;

            var user = new User();
            user.Password = CryptographyHelper.EncryptPassword(valid_password, out salt);
            user.Salt = salt;

            var match = user.VerifyPasswordMatch(not_valid_password);

            Assert.IsFalse(match);
        }