public async Task GetHashAsyncTest() { // Arrange var handler = new MD5Hash(); // Act string hash = await handler.GetHashAsync(sample); // Assert Assert.IsTrue(hash.Length > 0); }
public async Task GetAndCheckHashTest() { // Arrange var handler = new MD5Hash(); // Act string hash = await handler.GetHashAsync(sample); bool matches = await handler.CheckHashAsync(sample, hash); // Assert Assert.IsTrue(matches); }
public async Task GetHashAsyncStreamTest() { // Arrange var handler = new MD5Hash(); using var stream = new MemoryStream(Encoding.UTF8.GetBytes(sample)); // Act string hash = await handler.GetHashAsync(stream); // Assert Assert.IsTrue(hash.Length > 0); }
public async Task GetAndCheckHashStreamTest() { // Arrange var handler = new MD5Hash(); using var stream = new MemoryStream(Encoding.UTF8.GetBytes(sample)); // Act string hash = await handler.GetHashAsync(stream); stream.Position = 0; bool matches = await handler.CheckHashAsync(stream, hash); // Assert Assert.IsTrue(matches); }