public void CalculateBytesFromNull() { Md5Sum sum = new Md5Sum(); Assert.IsNotNull(sum); byte[] check = sum.Calculate((byte[])null); }
public void CalculateBytesFromEmpty() { Md5Sum sum = new Md5Sum(); Assert.IsNotNull(sum); byte[] data = new byte[0]; byte[] check = sum.Calculate(data); Assert.IsNotNull(check); Assert.AreEqual(16, check.Length); }
public void CalculateFromTestFile1() { Md5Sum sum = new Md5Sum(); Assert.IsNotNull(sum); byte[] array = File.ReadAllBytes("../../TestData/TextFile1.txt"); byte[] check = sum.Calculate(array); Assert.IsNotNull(check); Assert.AreEqual(16, check.Length); for (int i = 0; i < File1Sum.Length; i++) { if (check[i] != File1Sum[i]) { Assert.Fail("Result byte {0} does not match! Was {1}, expected {2}", i, check[i], File1Sum[i]); } } }
public void CalculateFromTestFile1Stream() { Md5Sum sum = new Md5Sum(); Assert.IsNotNull(sum); FileStream file = new FileStream("../../TestData/TextFile1.txt", FileMode.Open); byte[] check = sum.Calculate(file); file.Close(); Assert.IsNotNull(check); Assert.AreEqual(16, check.Length); for (int i = 0; i < File1Sum.Length; i++) { if (check[i] != File1Sum[i]) { Assert.Fail("Result byte {0} does not match! Was {1}, expected {2}", i, check[i], File1Sum[i]); } } }
public void CalculateFromTestFile1Stream() { Md5Sum sum = new Md5Sum(); Assert.IsNotNull(sum); FileStream file = new FileStream("../../TestData/TextFile1.txt", FileMode.Open); byte[] check = sum.Calculate(file); file.Close(); Assert.IsNotNull(check); Assert.AreEqual(16, check.Length); for (int i = 0; i < File1Sum.Length; i++) { if (check[i] != File1Sum[i]) { Assert.Fail("Result byte {0} does not match! Was {1}, expected {2}", i, check[i], File1Sum[i]); } } }
public void CalculateFromTestFile1() { Md5Sum sum = new Md5Sum(); Assert.IsNotNull(sum); byte[] array = File.ReadAllBytes("../../TestData/TextFile1.txt"); byte[] check = sum.Calculate(array); Assert.IsNotNull(check); Assert.AreEqual(16, check.Length); for (int i = 0; i < File1Sum.Length; i++) { if (check[i] != File1Sum[i]) { Assert.Fail("Result byte {0} does not match! Was {1}, expected {2}", i, check[i], File1Sum[i]); } } }
public void CalculateBytesFromNull() { Md5Sum sum = new Md5Sum(); Assert.IsNotNull(sum); byte[] check = sum.Calculate((byte[])null); }
public void CalculateBytesFromEmpty() { Md5Sum sum = new Md5Sum(); Assert.IsNotNull(sum); byte[] data = new byte[0]; byte[] check = sum.Calculate(data); Assert.IsNotNull(check); Assert.AreEqual(16, check.Length); }