Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix some unit test asserts #448

Merged
merged 1 commit into from
Jun 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion test/ICSharpCode.SharpZipLib.Tests/BZip2/Bzip2Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public void CreateEmptyArchive()
pos += numRead;
}

Assert.AreEqual(pos, 0);
Assert.Zero(pos);
}
}

Expand Down
4 changes: 2 additions & 2 deletions test/ICSharpCode.SharpZipLib.Tests/Tar/TarTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public void EmptyTar()
}

Assert.IsTrue(ms.GetBuffer().Length > 0, "Archive size must be > zero");
Assert.AreEqual(ms.GetBuffer().Length % recordSize, 0, "Archive size must be a multiple of record size");
Assert.Zero(ms.GetBuffer().Length % recordSize, "Archive size must be a multiple of record size");

var ms2 = new MemoryStream();
ms2.Write(ms.GetBuffer(), 0, ms.GetBuffer().Length);
Expand Down Expand Up @@ -769,7 +769,7 @@ public void SingleLargeEntry()
var tis = new TarInputStream(bs);
var entry = tis.GetNextEntry();

Assert.AreEqual(entry.Name, EntryName);
Assert.AreEqual(EntryName, entry.Name);
return tis;
},
output: bs =>
Expand Down
4 changes: 2 additions & 2 deletions test/ICSharpCode.SharpZipLib.Tests/Zip/StreamHandling.cs
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ public void EmptyZipEntries()
}
}
inStream.Close();
Assert.AreEqual(extractCount, 0, "No data should be read from empty entries");
Assert.Zero(extractCount, "No data should be read from empty entries");
}

[Test]
Expand Down Expand Up @@ -360,7 +360,7 @@ public void SingleLargeEntry()
var zis = new ZipInputStream(bs);
var entry = zis.GetNextEntry();

Assert.AreEqual(entry.Name, EntryName);
Assert.AreEqual(EntryName, entry.Name);
Assert.IsTrue((entry.Flags & (int)GeneralBitFlags.Descriptor) != 0);
return zis;
},
Expand Down