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 Apple2MG
public class Apple2Mg
{
readonly string[] testfiles =
{
@@ -54,7 +54,7 @@ namespace DiscImageChef.Tests.Images
MediaType.DOS_35_HD
};
readonly string[] md5s =
readonly string[] md5S =
{
"7db5d585270ab858043d50e60068d45f", "c62ee4dac8835f9acc999e7531d3b5f8", "86bc7879bb477917aab3976057a6a7b2",
"32b8f8163238d4f3ea2a3db95ad1a812", "a5acba4cbaddd9c53ea0e8210f4aba55", "eb9b60c78b30d2b6541ed0781944b6da"
@@ -68,14 +68,14 @@ namespace DiscImageChef.Tests.Images
string location = Path.Combine(Consts.TestFilesRoot, "images", "2mg", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new Apple2Mg();
ImagePlugin image = new DiscImages.Apple2Mg();
Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]);
Assert.AreEqual(sectors[i], image.ImageInfo.Sectors, testfiles[i]);
Assert.AreEqual(sectorsize[i], image.ImageInfo.SectorSize, testfiles[i]);
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();
@@ -85,10 +85,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
{
@@ -99,7 +99,7 @@ namespace DiscImageChef.Tests.Images
ctx.Update(sector);
}
Assert.AreEqual(md5s[i], ctx.End(), testfiles[i]);
Assert.AreEqual(md5S[i], ctx.End(), testfiles[i]);
}
}
}

View File

@@ -56,7 +56,7 @@ namespace DiscImageChef.Tests.Images
MediaType.NEC_525_HD, MediaType.NEC_525_HD, MediaType.NEC_525_HD
};
readonly string[] md5s =
readonly string[] md5S =
{
"1c5387e38e58165c517c059e5d48905d", "a84366658c1c3bd09af4d0d42fbf716e", "919c9eecf1b65b10870f617cb976668a",
"02d35af02581afb2e56792dcaba2c1af", "b8c3f858f1a9d300d3e74f36eea04354", "c348bbbaf99fcb8c8e66de157aef62f4",
@@ -79,7 +79,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();
@@ -89,10 +89,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
{
@@ -103,7 +103,7 @@ namespace DiscImageChef.Tests.Images
ctx.Update(sector);
}
Assert.AreEqual(md5s[i], ctx.End(), testfiles[i]);
Assert.AreEqual(md5S[i], ctx.End(), testfiles[i]);
}
}
}

View File

@@ -67,7 +67,7 @@ namespace DiscImageChef.Tests.Images
MediaType.DOS_35_HD
};
readonly string[] md5s =
readonly string[] md5S =
{
"95c0b76419c1c74db6dbe1d790f97dde", "95c0b76419c1c74db6dbe1d790f97dde", "6f6507e416b7320d583dc347b8e57844",
"48b93e8619c4c13f4a3724b550e4b371", "48b93e8619c4c13f4a3724b550e4b371", "1d060d2e2543e1c2e8569f5451660060",
@@ -93,7 +93,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();
@@ -103,10 +103,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
{
@@ -117,7 +117,7 @@ namespace DiscImageChef.Tests.Images
ctx.Update(sector);
}
Assert.AreEqual(md5s[i], ctx.End(), testfiles[i]);
Assert.AreEqual(md5S[i], ctx.End(), testfiles[i]);
}
}
}

View File

@@ -36,7 +36,7 @@ using NUnit.Framework;
namespace DiscImageChef.Tests.Images
{
[TestFixture]
public class CopyQM
public class CopyQm
{
readonly string[] testfiles =
{
@@ -55,7 +55,7 @@ namespace DiscImageChef.Tests.Images
MediaType.DMF, MediaType.DMF
};
readonly string[] md5s =
readonly string[] md5S =
{
"de3f85896f771b7e5bc4c9e3926d64e4", "c533488a21098a62c85f1649abda2803", "1ff7649b679ba22ff20d39ff717dbec8",
"b4a602f67903c46eef62addb0780aa56", "b4a602f67903c46eef62addb0780aa56", "03c2af6a8ebf4bd6f530335de34ae5dd",
@@ -70,14 +70,14 @@ namespace DiscImageChef.Tests.Images
string location = Path.Combine(Consts.TestFilesRoot, "images", "copyqm", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new CopyQm();
ImagePlugin image = new DiscImages.CopyQm();
Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]);
Assert.AreEqual(sectors[i], image.ImageInfo.Sectors, testfiles[i]);
Assert.AreEqual(sectorsize[i], image.ImageInfo.SectorSize, testfiles[i]);
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();
@@ -87,10 +87,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
{
@@ -101,7 +101,7 @@ namespace DiscImageChef.Tests.Images
ctx.Update(sector);
}
Assert.AreEqual(md5s[i], ctx.End(), testfiles[i]);
Assert.AreEqual(md5S[i], ctx.End(), testfiles[i]);
}
}
}

View File

@@ -69,7 +69,7 @@ namespace DiscImageChef.Tests.Images
MediaType.NEC_525_HD, MediaType.Unknown, MediaType.NEC_525_HD, MediaType.NEC_525_SS
};
readonly string[] md5s =
readonly string[] md5S =
{
"a4103c39cd7fd9fc3de8418dfcf22364", "b948048c03e0b3d34d77f5c9dced0b41", "f91152fab791d4dc0677a289d90478a5",
"39b01df04a6312b09f1b83c9f3a46b22", "ef775ec1f41b8b725ea83ec8c5ca04e2", "5c2b22f824524cd6c539aaeb2ecb84cd",
@@ -95,7 +95,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();
@@ -105,10 +105,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
{
@@ -119,7 +119,7 @@ namespace DiscImageChef.Tests.Images
ctx.Update(sector);
}
Assert.AreEqual(md5s[i], ctx.End(), testfiles[i]);
Assert.AreEqual(md5S[i], ctx.End(), testfiles[i]);
}
}
}

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]);
}
}
}

View File

@@ -70,7 +70,7 @@ namespace DiscImageChef.Tests.Images
MediaType.DOS_35_DS_DD_9, MediaType.AppleSonyDS
};
readonly string[] md5s =
readonly string[] md5S =
{
"eae3a95671d077deb702b3549a769f56", "c5d92544c3e78b7f0a9b4baaa9a64eec", "a99744348a70b62b57bce2dec9132ced",
"93e71b9ecdb39d3ec9245b4f451856d4", "3160038ca028ccf52ad7863790072145", "5e255c4bc0f6a26ecd27845b37e65aaa",
@@ -96,7 +96,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();
@@ -106,10 +106,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
{
@@ -120,7 +120,7 @@ namespace DiscImageChef.Tests.Images
ctx.Update(sector);
}
Assert.AreEqual(md5s[i], ctx.End(), testfiles[i]);
Assert.AreEqual(md5S[i], ctx.End(), testfiles[i]);
}
}
}