public void VerifyNullArray2() { Md5Sum sum = new Md5Sum(); Assert.IsNotNull(sum); bool match = sum.Verify(new byte[1], (byte[])null); }
public void VerifyFromTestFile1() { Md5Sum sum = new Md5Sum(); Assert.IsNotNull(sum); byte[] array = File.ReadAllBytes("../../TestData/TextFile1.txt"); bool match = sum.Verify(array, File1Sum); Assert.IsTrue(match); }
public void VerifyFromTestFile1Stream() { Md5Sum sum = new Md5Sum(); Assert.IsNotNull(sum); FileStream file = new FileStream("../../TestData/TextFile1.txt", FileMode.Open); bool match = sum.Verify(file, File1Sum); file.Close(); Assert.IsTrue(match); }
public void VerifyFromTestFile1Fail() { Md5Sum sum = new Md5Sum(); Assert.IsNotNull(sum); // Create invalid checksum byte[] invalidSum = new byte[16]; Array.Copy(File1Sum, invalidSum, 16); invalidSum[3] = 0x00; byte[] array = File.ReadAllBytes("../../TestData/TextFile1.txt"); bool match = sum.Verify(array, invalidSum); Assert.IsFalse(match); }
public void VerifyFromTestFile1StreamFail() { Md5Sum sum = new Md5Sum(); Assert.IsNotNull(sum); // Create invalid checksum byte[] invalidSum = new byte[16]; Array.Copy(File1Sum, invalidSum, 16); invalidSum[3] = 0x00; FileStream file = new FileStream("../../TestData/TextFile1.txt", FileMode.Open); bool match = sum.Verify(file, invalidSum); file.Close(); Assert.IsFalse(match); }
public void VerifyNullArray2() { Md5Sum sum = new Md5Sum(); Assert.IsNotNull(sum); bool match = sum.Verify(new byte[1], (byte[])null); }
public void VerifyFromTestFile1StreamFail() { Md5Sum sum = new Md5Sum(); Assert.IsNotNull(sum); // Create invalid checksum byte[] invalidSum = new byte[16]; Array.Copy(File1Sum, invalidSum, 16); invalidSum[3] = 0x00; FileStream file = new FileStream("../../TestData/TextFile1.txt", FileMode.Open); bool match = sum.Verify(file, invalidSum); file.Close(); Assert.IsFalse(match); }
public void VerifyFromTestFile1Stream() { Md5Sum sum = new Md5Sum(); Assert.IsNotNull(sum); FileStream file = new FileStream("../../TestData/TextFile1.txt", FileMode.Open); bool match = sum.Verify(file, File1Sum); file.Close(); Assert.IsTrue(match); }
public void VerifyFromTestFile1Fail() { Md5Sum sum = new Md5Sum(); Assert.IsNotNull(sum); // Create invalid checksum byte[] invalidSum = new byte[16]; Array.Copy(File1Sum, invalidSum, 16); invalidSum[3] = 0x00; byte[] array = File.ReadAllBytes("../../TestData/TextFile1.txt"); bool match = sum.Verify(array, invalidSum); Assert.IsFalse(match); }
public void VerifyFromTestFile1() { Md5Sum sum = new Md5Sum(); Assert.IsNotNull(sum); byte[] array = File.ReadAllBytes("../../TestData/TextFile1.txt"); bool match = sum.Verify(array, File1Sum); Assert.IsTrue(match); }