Skip to content
This repository has been archived by the owner on Aug 7, 2022. It is now read-only.

Commit

Permalink
Fixed CompressionTests
Browse files Browse the repository at this point in the history
  • Loading branch information
erri120 committed Feb 14, 2020
1 parent e2ece88 commit eef58f8
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions OMODFramework.Test/CompressionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

#define DELETEFILES

using System;
using System.Collections.Generic;
using System.IO;
using System.Reflection;
Expand Down Expand Up @@ -60,20 +61,26 @@ public void TestWriteStreamToZip()
zf.GetInputStream(zf.GetEntry("hello.txt")).CopyTo(fs);
}

byte[] hash1;
byte[] hash2;
string hash1;
string hash2;

using (var md5 = MD5.Create())
{
using (var stream = File.OpenRead("hello.txt"))
hash1 = md5.ComputeHash(stream);
{
var hash = md5.ComputeHash(stream);
hash1 = BitConverter.ToString(hash).Replace("-", "").ToLowerInvariant();
}

using (var stream = File.OpenRead("hello_out.txt"))
hash2 = md5.ComputeHash(stream);
{
var hash = md5.ComputeHash(stream);
hash2 = BitConverter.ToString(hash).Replace("-", "").ToLowerInvariant();
}
}

var f1 = new FileInfo("hello.txt");
var f2 = new FileInfo("hello_out.txt");

Assert.AreEqual(hash1, hash2);
Assert.AreEqual(f1.Length, f2.Length);
}
Expand Down

0 comments on commit eef58f8

Please sign in to comment.