public void HashContent_WithNullString() { Md5ResourceHasher hasher = new Md5ResourceHasher(); InvalidOperationException ex = Assert.Throws<InvalidOperationException>(() => hasher.HashContent(null)); Assert.AreEqual("Cannot hash null string.", ex.Message); }
public void HashContent(string content, string expectedHash) { Md5ResourceHasher hasher = new Md5ResourceHasher(); string hash = hasher.HashContent(content); Assert.AreEqual(expectedHash, hash); }