Esempio n. 1
0
        public void TestStreamAndArrayHashMatchOne()
        {
            LargeMemoryStream.Position = 0;
            ActualString   = HashInstance.ComputeStream(LargeMemoryStream).ToString();
            ExpectedString = HashInstance.ComputeBytes(LargeMemoryStream.ToArray()).ToString();

            AssertAreEqual(ExpectedString, ActualString);
        }
Esempio n. 2
0
 public void TestHashOfDefaultDataStream()
 {
     using (var stream = new MemoryStream(DefaultDataBytes))
     {
         ExpectedString = HashOfDefaultData;
         ActualString   = HashInstance.ComputeStream(stream).ToString();
         AssertAreEqual(ExpectedString, ActualString);
     }
 }
Esempio n. 3
0
        public void TestStreamAndArrayHashMatchTwo()
        {
            LargeMemoryStream.Position = 0;
            ActualString = HashInstance.ComputeStream(LargeMemoryStream, LargeMemoryStream.Length / 2).ToString();
            HashInstance.Initialize();
            HashInstance.TransformBytes(LargeMemoryStream.ToArray(), 0, (int)(LargeMemoryStream.Length / 2));
            ExpectedString = HashInstance.TransformFinal().ToString();

            AssertAreEqual(ExpectedString, ActualString);
        }