Esempio n. 1
0
        public void IsThisAlgorithm_NullInput_Throws()
        {
            // Arrange
            var algorithm = new PBKDF2();

            // Act && Assert
            Assert.Throws <ArgumentNullException>(() => algorithm.IsThisAlgorithm(null));
        }
Esempio n. 2
0
        public void IsThisAlgorithm_InvalidInput_ReturnsFalse()
        {
            // Arrange
            var algorithm = new PBKDF2();

            // Act
            var isThisAlgorithm = algorithm.IsThisAlgorithm("not an PBKDF2 hash");

            // Assert
            Assert.False(isThisAlgorithm);
        }
Esempio n. 3
0
        public void IsThisAlgorithm_ValidInput_ReturnsTrue()
        {
            // Arrange
            var algorithm = new PBKDF2();

            // Act
            var hash            = algorithm.CreateHash("Hello world");
            var isThisAlgorithm = algorithm.IsThisAlgorithm(hash);

            // Assert
            Assert.True(isThisAlgorithm);
        }