예제 #1
0
        public void IsThisAlgorithm_NullInput_Throws()
        {
            // Arrange
            var algorithm = new SHA384();

            // Act && Assert
            Assert.Throws <ArgumentNullException>(() => algorithm.IsThisAlgorithm(null));
        }
예제 #2
0
        public void IsThisAlgorithm_InvalidInput_ReturnsFalse()
        {
            // Arrange
            var algorithm = new SHA384();

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

            // Assert
            Assert.False(isThisAlgorithm);
        }
예제 #3
0
        public void IsThisAlgorithm_ValidInput_ReturnsTrue()
        {
            // Arrange
            var algorithm = new SHA384();

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

            // Assert
            Assert.True(isThisAlgorithm);
        }