コード例 #1
0
        public void Create_AreNotEqual_WithDifferentSalt()
        {
            // Arrange
            var passwordStorage = new HmacSha512PasswordStorage();

            // Act
            string hash1 = passwordStorage.Create("test");
            string hash2 = passwordStorage.Create("test");

            // Assert
            Assert.NotEqual(hash1, hash2);
        }
コード例 #2
0
        public void Create_Match_OkWithWithSame()
        {
            // Arrange
            var passwordStorage = new HmacSha512PasswordStorage();

            // Act
            string hash = passwordStorage.Create("test");
            bool   ok   = passwordStorage.Match("test", hash);

            // Assert
            Assert.True(ok);
        }