예제 #1
0
        public void Sha384Hash_GetHash_Null_3()
        {
            IHash hashAlgo = new Sha384Hash();

            Action action = () => hashAlgo.GetHash(null as FileInfo);

            action.Should().Throw <ArgumentNullException>();
        }
예제 #2
0
        public void Sha384Hash_GetHash_Empty()
        {
            IHash hashAlgo = new Sha384Hash();

            Action action = () => hashAlgo.GetHash(string.Empty);

            action.Should().Throw <ArgumentNullException>();
        }
예제 #3
0
        public void Sha384Hash_GetHash_Valid_2()
        {
            IHash hashAlgo = new Sha384Hash();

            HashResult hashResult = hashAlgo.GetHash(Data.ExpectedHashFilePath);

            hashResult.Algorithm.Should().Be(Hashing.ExpectedSha384Algorithm);
            hashResult.Value.Should().Be(Hashing.ExpectedSha384Hash);
        }
예제 #4
0
        public void Sha384Hash_GetHash_Valid_1()
        {
            IHash hashAlgo = new Sha384Hash();

            using FileStream fileStream = new(Data.ExpectedHashFilePath, FileMode.Open, FileAccess.Read, FileShare.Read);

            HashResult hashResult = hashAlgo.GetHash(fileStream);

            hashResult.Algorithm.Should().Be(Hashing.ExpectedSha384Algorithm);
            hashResult.Value.Should().Be(Hashing.ExpectedSha384Hash);
        }