コード例 #1
0
            public void HashedPasswordIsDifferent()
            {
                var hasher = new ArgonPasswordHasher();

                var password = "******";

                Assert.NotEqual(password, hasher.HashPassword(password));
            }
コード例 #2
0
            public void VerifyingIncorrectPasswordIsFalse()
            {
                var password = "******";
                var hasher   = new ArgonPasswordHasher();

                var hashedPassword = hasher.HashPassword(password);

                Assert.False(hasher.VerifyPassword(hashedPassword, "SPARTA"));
            }
コード例 #3
0
            public void VerifyingCorrectPasswordIsTrue()
            {
                var password = "******";
                var hasher   = new ArgonPasswordHasher();

                var hashedPassword = hasher.HashPassword(password);

                Assert.True(hasher.VerifyPassword(hashedPassword, password));
            }
コード例 #4
0
            public void VerifyingPasswordIsCaseSensitive()
            {
                var password = "******";
                var hasher   = new ArgonPasswordHasher();

                var hashedPassword = hasher.HashPassword(password);

                Assert.False(hasher.VerifyPassword(hashedPassword, password.ToLower()));
                Assert.False(hasher.VerifyPassword(hashedPassword, password.ToUpper()));
            }