コード例 #1
0
        public void ShouldNotMatchStrings()
        {
            // Arrange
            string str = "Test String";
            BCryptEncryptor encryptor = new BCryptEncryptor();

            // Act
            string strEncrypted = encryptor.Encrypt(str);

            // Assert
            Assert.IsFalse(encryptor.IsMatch("testing", strEncrypted));
        }
コード例 #2
0
        public void ShouldHashString()
        {
            // Arrange
            string str = "Test String";
            BCryptEncryptor encryptor = new BCryptEncryptor();

            // Act
            string strEncrypted = encryptor.Encrypt(str);

            // Assert
            Assert.AreNotEqual(strEncrypted, str);
        }