示例#1
0
        public async Task CheckFileHashFailTest()
        {
            // Arrange
            var handler = new BCryptHash(workFactor);

            // Act
            bool matches = await handler.CheckFileHashAsync(filename, failHash);

            // Assert
            Assert.IsFalse(matches);
        }
示例#2
0
        public async Task GetAndCheckFileHashTest()
        {
            // Arrange
            var handler = new BCryptHash(workFactor);

            // Act
            string hash = await handler.GetFileHashAsync(filename);

            bool matches = await handler.CheckFileHashAsync(filename, hash);

            // Assert
            Assert.IsTrue(matches);
        }