REFACTOR: All refactor in DiscImageChef.Tests.

This commit is contained in:
2017-12-22 22:18:21 +00:00
parent 19914db94f
commit 6e95ba400b
141 changed files with 478 additions and 480 deletions

View File

@@ -36,7 +36,7 @@ using NUnit.Framework;
namespace DiscImageChef.Tests.Images
{
[TestFixture]
public class DART
public class Dart
{
readonly string[] testfiles =
{
@@ -54,7 +54,7 @@ namespace DiscImageChef.Tests.Images
MediaType.AppleSonyDS, MediaType.AppleSonyDS, MediaType.AppleSonyDS, MediaType.AppleSonyDS
};
readonly string[] md5s =
readonly string[] md5S =
{
"eae3a95671d077deb702b3549a769f56", "eae3a95671d077deb702b3549a769f56", "c5d92544c3e78b7f0a9b4baaa9a64eec",
"c5d92544c3e78b7f0a9b4baaa9a64eec", "a99744348a70b62b57bce2dec9132ced", "a99744348a70b62b57bce2dec9132ced",
@@ -76,7 +76,7 @@ namespace DiscImageChef.Tests.Images
Assert.AreEqual(mediatypes[i], image.ImageInfo.MediaType, testfiles[i]);
// How many sectors to read at once
const uint sectorsToRead = 256;
const uint SECTORS_TO_READ = 256;
ulong doneSectors = 0;
Md5Context ctx = new Md5Context();
@@ -86,10 +86,10 @@ namespace DiscImageChef.Tests.Images
{
byte[] sector;
if(image.ImageInfo.Sectors - doneSectors >= sectorsToRead)
if(image.ImageInfo.Sectors - doneSectors >= SECTORS_TO_READ)
{
sector = image.ReadSectors(doneSectors, sectorsToRead);
doneSectors += sectorsToRead;
sector = image.ReadSectors(doneSectors, SECTORS_TO_READ);
doneSectors += SECTORS_TO_READ;
}
else
{
@@ -100,7 +100,7 @@ namespace DiscImageChef.Tests.Images
ctx.Update(sector);
}
Assert.AreEqual(md5s[i], ctx.End(), testfiles[i]);
Assert.AreEqual(md5S[i], ctx.End(), testfiles[i]);
}
}
}