Example #1
0
        public void GetCrcFile1Stream()
        {
            FileStream file = new FileStream("../../TestData/TextFile1.txt",
                                             FileMode.Open);

            byte[] check = Crc32.GetStreamCRC32(file);
            file.Close();

            Assert.IsNotNull(check);
            Assert.AreEqual(4, 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]);
                }
            }
        }
Example #2
0
 public void GetCrc32NullStream()
 {
     byte[] crc = Crc32.GetStreamCRC32(null);
 }