mirror of
https://github.com/aaru-dps/Aaru.Server.git
synced 2025-12-16 19:24:27 +00:00
REFACTOR: All refactor in DiscImageChef.Tests.
This commit is contained in:
@@ -33,20 +33,20 @@ using NUnit.Framework;
|
||||
namespace DiscImageChef.Tests.Checksums
|
||||
{
|
||||
[TestFixture]
|
||||
public class CRC16
|
||||
public class Crc16
|
||||
{
|
||||
static readonly byte[] ExpectedEmpty = {0x00, 0x00};
|
||||
static readonly byte[] ExpectedRandom = {0x2d, 0x6d};
|
||||
|
||||
[Test]
|
||||
public void CRC16EmptyFile()
|
||||
public void Crc16EmptyFile()
|
||||
{
|
||||
byte[] result = Crc16Context.File(Path.Combine(Consts.TestFilesRoot, "checksums", "empty"));
|
||||
Assert.AreEqual(ExpectedEmpty, result);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void CRC16EmptyData()
|
||||
public void Crc16EmptyData()
|
||||
{
|
||||
byte[] data = new byte[1048576];
|
||||
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "empty"), FileMode.Open,
|
||||
@@ -59,7 +59,7 @@ namespace DiscImageChef.Tests.Checksums
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void CRC16EmptyInstance()
|
||||
public void Crc16EmptyInstance()
|
||||
{
|
||||
byte[] data = new byte[1048576];
|
||||
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "empty"), FileMode.Open,
|
||||
@@ -75,14 +75,14 @@ namespace DiscImageChef.Tests.Checksums
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void CRC16RandomFile()
|
||||
public void Crc16RandomFile()
|
||||
{
|
||||
byte[] result = Crc16Context.File(Path.Combine(Consts.TestFilesRoot, "checksums", "random"));
|
||||
Assert.AreEqual(ExpectedRandom, result);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void CRC16RandomData()
|
||||
public void Crc16RandomData()
|
||||
{
|
||||
byte[] data = new byte[1048576];
|
||||
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "random"), FileMode.Open,
|
||||
@@ -95,7 +95,7 @@ namespace DiscImageChef.Tests.Checksums
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void CRC16RandomInstance()
|
||||
public void Crc16RandomInstance()
|
||||
{
|
||||
byte[] data = new byte[1048576];
|
||||
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "random"), FileMode.Open,
|
||||
|
||||
@@ -33,20 +33,20 @@ using NUnit.Framework;
|
||||
namespace DiscImageChef.Tests.Checksums
|
||||
{
|
||||
[TestFixture]
|
||||
public class CRC32
|
||||
public class Crc32
|
||||
{
|
||||
static readonly byte[] ExpectedEmpty = {0xa7, 0x38, 0xea, 0x1c};
|
||||
static readonly byte[] ExpectedRandom = {0x2b, 0x6e, 0x68, 0x54};
|
||||
|
||||
[Test]
|
||||
public void CRC32EmptyFile()
|
||||
public void Crc32EmptyFile()
|
||||
{
|
||||
byte[] result = Crc32Context.File(Path.Combine(Consts.TestFilesRoot, "checksums", "empty"));
|
||||
Assert.AreEqual(ExpectedEmpty, result);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void CRC32EmptyData()
|
||||
public void Crc32EmptyData()
|
||||
{
|
||||
byte[] data = new byte[1048576];
|
||||
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "empty"), FileMode.Open,
|
||||
@@ -59,7 +59,7 @@ namespace DiscImageChef.Tests.Checksums
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void CRC32EmptyInstance()
|
||||
public void Crc32EmptyInstance()
|
||||
{
|
||||
byte[] data = new byte[1048576];
|
||||
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "empty"), FileMode.Open,
|
||||
@@ -75,14 +75,14 @@ namespace DiscImageChef.Tests.Checksums
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void CRC32RandomFile()
|
||||
public void Crc32RandomFile()
|
||||
{
|
||||
byte[] result = Crc32Context.File(Path.Combine(Consts.TestFilesRoot, "checksums", "random"));
|
||||
Assert.AreEqual(ExpectedRandom, result);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void CRC32RandomData()
|
||||
public void Crc32RandomData()
|
||||
{
|
||||
byte[] data = new byte[1048576];
|
||||
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "random"), FileMode.Open,
|
||||
@@ -95,7 +95,7 @@ namespace DiscImageChef.Tests.Checksums
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void CRC32RandomInstance()
|
||||
public void Crc32RandomInstance()
|
||||
{
|
||||
byte[] data = new byte[1048576];
|
||||
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "random"), FileMode.Open,
|
||||
|
||||
@@ -33,20 +33,20 @@ using NUnit.Framework;
|
||||
namespace DiscImageChef.Tests.Checksums
|
||||
{
|
||||
[TestFixture]
|
||||
public class CRC64
|
||||
public class Crc64
|
||||
{
|
||||
static readonly byte[] ExpectedEmpty = {0x60, 0x6b, 0x70, 0xa2, 0x3e, 0xba, 0xf6, 0xc2};
|
||||
static readonly byte[] ExpectedRandom = {0xbf, 0x09, 0x99, 0x2c, 0xc5, 0xed, 0xe3, 0x8e};
|
||||
|
||||
[Test]
|
||||
public void CRC64EmptyFile()
|
||||
public void Crc64EmptyFile()
|
||||
{
|
||||
byte[] result = Crc64Context.File(Path.Combine(Consts.TestFilesRoot, "checksums", "empty"));
|
||||
Assert.AreEqual(ExpectedEmpty, result);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void CRC64EmptyData()
|
||||
public void Crc64EmptyData()
|
||||
{
|
||||
byte[] data = new byte[1048576];
|
||||
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "empty"), FileMode.Open,
|
||||
@@ -59,7 +59,7 @@ namespace DiscImageChef.Tests.Checksums
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void CRC64EmptyInstance()
|
||||
public void Crc64EmptyInstance()
|
||||
{
|
||||
byte[] data = new byte[1048576];
|
||||
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "empty"), FileMode.Open,
|
||||
@@ -75,14 +75,14 @@ namespace DiscImageChef.Tests.Checksums
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void CRC64RandomFile()
|
||||
public void Crc64RandomFile()
|
||||
{
|
||||
byte[] result = Crc64Context.File(Path.Combine(Consts.TestFilesRoot, "checksums", "random"));
|
||||
Assert.AreEqual(ExpectedRandom, result);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void CRC64RandomData()
|
||||
public void Crc64RandomData()
|
||||
{
|
||||
byte[] data = new byte[1048576];
|
||||
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "random"), FileMode.Open,
|
||||
@@ -95,7 +95,7 @@ namespace DiscImageChef.Tests.Checksums
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void CRC64RandomInstance()
|
||||
public void Crc64RandomInstance()
|
||||
{
|
||||
byte[] data = new byte[1048576];
|
||||
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "random"), FileMode.Open,
|
||||
|
||||
@@ -33,7 +33,7 @@ using NUnit.Framework;
|
||||
namespace DiscImageChef.Tests.Checksums
|
||||
{
|
||||
[TestFixture]
|
||||
public class MD5
|
||||
public class Md5
|
||||
{
|
||||
static readonly byte[] ExpectedEmpty =
|
||||
{0xb6, 0xd8, 0x1b, 0x36, 0x0a, 0x56, 0x72, 0xd8, 0x0c, 0x27, 0x43, 0x0f, 0x39, 0x15, 0x3e, 0x2c};
|
||||
@@ -41,7 +41,7 @@ namespace DiscImageChef.Tests.Checksums
|
||||
{0xd7, 0x8f, 0x0e, 0xec, 0x41, 0x7b, 0xe3, 0x86, 0x21, 0x9b, 0x21, 0xb7, 0x00, 0x04, 0x4b, 0x95};
|
||||
|
||||
[Test]
|
||||
public void MD5EmptyFile()
|
||||
public void Md5EmptyFile()
|
||||
{
|
||||
Md5Context ctx = new Md5Context();
|
||||
ctx.Init();
|
||||
@@ -50,7 +50,7 @@ namespace DiscImageChef.Tests.Checksums
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void MD5EmptyData()
|
||||
public void Md5EmptyData()
|
||||
{
|
||||
byte[] data = new byte[1048576];
|
||||
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "empty"), FileMode.Open,
|
||||
@@ -65,7 +65,7 @@ namespace DiscImageChef.Tests.Checksums
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void MD5EmptyInstance()
|
||||
public void Md5EmptyInstance()
|
||||
{
|
||||
byte[] data = new byte[1048576];
|
||||
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "empty"), FileMode.Open,
|
||||
@@ -81,7 +81,7 @@ namespace DiscImageChef.Tests.Checksums
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void MD5RandomFile()
|
||||
public void Md5RandomFile()
|
||||
{
|
||||
Md5Context ctx = new Md5Context();
|
||||
ctx.Init();
|
||||
@@ -90,7 +90,7 @@ namespace DiscImageChef.Tests.Checksums
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void MD5RandomData()
|
||||
public void Md5RandomData()
|
||||
{
|
||||
byte[] data = new byte[1048576];
|
||||
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "random"), FileMode.Open,
|
||||
@@ -105,7 +105,7 @@ namespace DiscImageChef.Tests.Checksums
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void MD5RandomInstance()
|
||||
public void Md5RandomInstance()
|
||||
{
|
||||
byte[] data = new byte[1048576];
|
||||
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "random"), FileMode.Open,
|
||||
|
||||
@@ -33,7 +33,7 @@ using NUnit.Framework;
|
||||
namespace DiscImageChef.Tests.Checksums
|
||||
{
|
||||
[TestFixture]
|
||||
public class RIPEMD160
|
||||
public class Ripemd160
|
||||
{
|
||||
static readonly byte[] ExpectedEmpty =
|
||||
{
|
||||
@@ -47,7 +47,7 @@ namespace DiscImageChef.Tests.Checksums
|
||||
};
|
||||
|
||||
[Test]
|
||||
public void RIPEMD160EmptyFile()
|
||||
public void Ripemd160EmptyFile()
|
||||
{
|
||||
Ripemd160Context ctx = new Ripemd160Context();
|
||||
ctx.Init();
|
||||
@@ -56,7 +56,7 @@ namespace DiscImageChef.Tests.Checksums
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void RIPEMD160EmptyData()
|
||||
public void Ripemd160EmptyData()
|
||||
{
|
||||
byte[] data = new byte[1048576];
|
||||
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "empty"), FileMode.Open,
|
||||
@@ -71,7 +71,7 @@ namespace DiscImageChef.Tests.Checksums
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void RIPEMD160EmptyInstance()
|
||||
public void Ripemd160EmptyInstance()
|
||||
{
|
||||
byte[] data = new byte[1048576];
|
||||
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "empty"), FileMode.Open,
|
||||
@@ -87,7 +87,7 @@ namespace DiscImageChef.Tests.Checksums
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void RIPEMD160RandomFile()
|
||||
public void Ripemd160RandomFile()
|
||||
{
|
||||
Ripemd160Context ctx = new Ripemd160Context();
|
||||
ctx.Init();
|
||||
@@ -96,7 +96,7 @@ namespace DiscImageChef.Tests.Checksums
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void RIPEMD160RandomData()
|
||||
public void Ripemd160RandomData()
|
||||
{
|
||||
byte[] data = new byte[1048576];
|
||||
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "random"), FileMode.Open,
|
||||
@@ -111,7 +111,7 @@ namespace DiscImageChef.Tests.Checksums
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void RIPEMD160RandomInstance()
|
||||
public void Ripemd160RandomInstance()
|
||||
{
|
||||
byte[] data = new byte[1048576];
|
||||
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "random"), FileMode.Open,
|
||||
|
||||
@@ -33,7 +33,7 @@ using NUnit.Framework;
|
||||
namespace DiscImageChef.Tests.Checksums
|
||||
{
|
||||
[TestFixture]
|
||||
public class SHA1
|
||||
public class Sha1
|
||||
{
|
||||
static readonly byte[] ExpectedEmpty =
|
||||
{
|
||||
@@ -47,7 +47,7 @@ namespace DiscImageChef.Tests.Checksums
|
||||
};
|
||||
|
||||
[Test]
|
||||
public void SHA1EmptyFile()
|
||||
public void Sha1EmptyFile()
|
||||
{
|
||||
Sha1Context ctx = new Sha1Context();
|
||||
ctx.Init();
|
||||
@@ -56,7 +56,7 @@ namespace DiscImageChef.Tests.Checksums
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void SHA1EmptyData()
|
||||
public void Sha1EmptyData()
|
||||
{
|
||||
byte[] data = new byte[1048576];
|
||||
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "empty"), FileMode.Open,
|
||||
@@ -71,7 +71,7 @@ namespace DiscImageChef.Tests.Checksums
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void SHA1EmptyInstance()
|
||||
public void Sha1EmptyInstance()
|
||||
{
|
||||
byte[] data = new byte[1048576];
|
||||
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "empty"), FileMode.Open,
|
||||
@@ -87,7 +87,7 @@ namespace DiscImageChef.Tests.Checksums
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void SHA1RandomFile()
|
||||
public void Sha1RandomFile()
|
||||
{
|
||||
Sha1Context ctx = new Sha1Context();
|
||||
ctx.Init();
|
||||
@@ -96,7 +96,7 @@ namespace DiscImageChef.Tests.Checksums
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void SHA1RandomData()
|
||||
public void Sha1RandomData()
|
||||
{
|
||||
byte[] data = new byte[1048576];
|
||||
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "random"), FileMode.Open,
|
||||
@@ -111,7 +111,7 @@ namespace DiscImageChef.Tests.Checksums
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void SHA1RandomInstance()
|
||||
public void Sha1RandomInstance()
|
||||
{
|
||||
byte[] data = new byte[1048576];
|
||||
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "random"), FileMode.Open,
|
||||
|
||||
@@ -33,7 +33,7 @@ using NUnit.Framework;
|
||||
namespace DiscImageChef.Tests.Checksums
|
||||
{
|
||||
[TestFixture]
|
||||
public class SHA256
|
||||
public class Sha256
|
||||
{
|
||||
static readonly byte[] ExpectedEmpty =
|
||||
{
|
||||
@@ -47,7 +47,7 @@ namespace DiscImageChef.Tests.Checksums
|
||||
};
|
||||
|
||||
[Test]
|
||||
public void SHA256EmptyFile()
|
||||
public void Sha256EmptyFile()
|
||||
{
|
||||
Sha256Context ctx = new Sha256Context();
|
||||
ctx.Init();
|
||||
@@ -56,7 +56,7 @@ namespace DiscImageChef.Tests.Checksums
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void SHA256EmptyData()
|
||||
public void Sha256EmptyData()
|
||||
{
|
||||
byte[] data = new byte[1048576];
|
||||
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "empty"), FileMode.Open,
|
||||
@@ -71,7 +71,7 @@ namespace DiscImageChef.Tests.Checksums
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void SHA256EmptyInstance()
|
||||
public void Sha256EmptyInstance()
|
||||
{
|
||||
byte[] data = new byte[1048576];
|
||||
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "empty"), FileMode.Open,
|
||||
@@ -87,7 +87,7 @@ namespace DiscImageChef.Tests.Checksums
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void SHA256RandomFile()
|
||||
public void Sha256RandomFile()
|
||||
{
|
||||
Sha256Context ctx = new Sha256Context();
|
||||
ctx.Init();
|
||||
@@ -96,7 +96,7 @@ namespace DiscImageChef.Tests.Checksums
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void SHA256RandomData()
|
||||
public void Sha256RandomData()
|
||||
{
|
||||
byte[] data = new byte[1048576];
|
||||
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "random"), FileMode.Open,
|
||||
@@ -111,7 +111,7 @@ namespace DiscImageChef.Tests.Checksums
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void SHA256RandomInstance()
|
||||
public void Sha256RandomInstance()
|
||||
{
|
||||
byte[] data = new byte[1048576];
|
||||
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "random"), FileMode.Open,
|
||||
|
||||
@@ -33,7 +33,7 @@ using NUnit.Framework;
|
||||
namespace DiscImageChef.Tests.Checksums
|
||||
{
|
||||
[TestFixture]
|
||||
public class SHA384
|
||||
public class Sha384
|
||||
{
|
||||
static readonly byte[] ExpectedEmpty =
|
||||
{
|
||||
@@ -49,7 +49,7 @@ namespace DiscImageChef.Tests.Checksums
|
||||
};
|
||||
|
||||
[Test]
|
||||
public void SHA384EmptyFile()
|
||||
public void Sha384EmptyFile()
|
||||
{
|
||||
Sha384Context ctx = new Sha384Context();
|
||||
ctx.Init();
|
||||
@@ -58,7 +58,7 @@ namespace DiscImageChef.Tests.Checksums
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void SHA384EmptyData()
|
||||
public void Sha384EmptyData()
|
||||
{
|
||||
byte[] data = new byte[1048576];
|
||||
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "empty"), FileMode.Open,
|
||||
@@ -73,7 +73,7 @@ namespace DiscImageChef.Tests.Checksums
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void SHA384EmptyInstance()
|
||||
public void Sha384EmptyInstance()
|
||||
{
|
||||
byte[] data = new byte[1048576];
|
||||
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "empty"), FileMode.Open,
|
||||
@@ -89,7 +89,7 @@ namespace DiscImageChef.Tests.Checksums
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void SHA384RandomFile()
|
||||
public void Sha384RandomFile()
|
||||
{
|
||||
Sha384Context ctx = new Sha384Context();
|
||||
ctx.Init();
|
||||
@@ -98,7 +98,7 @@ namespace DiscImageChef.Tests.Checksums
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void SHA384RandomData()
|
||||
public void Sha384RandomData()
|
||||
{
|
||||
byte[] data = new byte[1048576];
|
||||
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "random"), FileMode.Open,
|
||||
@@ -113,7 +113,7 @@ namespace DiscImageChef.Tests.Checksums
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void SHA384RandomInstance()
|
||||
public void Sha384RandomInstance()
|
||||
{
|
||||
byte[] data = new byte[1048576];
|
||||
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "random"), FileMode.Open,
|
||||
|
||||
@@ -33,7 +33,7 @@ using NUnit.Framework;
|
||||
namespace DiscImageChef.Tests.Checksums
|
||||
{
|
||||
[TestFixture]
|
||||
public class SHA512
|
||||
public class Sha512
|
||||
{
|
||||
static readonly byte[] ExpectedEmpty =
|
||||
{
|
||||
@@ -51,7 +51,7 @@ namespace DiscImageChef.Tests.Checksums
|
||||
};
|
||||
|
||||
[Test]
|
||||
public void SHA512EmptyFile()
|
||||
public void Sha512EmptyFile()
|
||||
{
|
||||
Sha512Context ctx = new Sha512Context();
|
||||
ctx.Init();
|
||||
@@ -60,7 +60,7 @@ namespace DiscImageChef.Tests.Checksums
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void SHA512EmptyData()
|
||||
public void Sha512EmptyData()
|
||||
{
|
||||
byte[] data = new byte[1048576];
|
||||
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "empty"), FileMode.Open,
|
||||
@@ -75,7 +75,7 @@ namespace DiscImageChef.Tests.Checksums
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void SHA512EmptyInstance()
|
||||
public void Sha512EmptyInstance()
|
||||
{
|
||||
byte[] data = new byte[1048576];
|
||||
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "empty"), FileMode.Open,
|
||||
@@ -91,7 +91,7 @@ namespace DiscImageChef.Tests.Checksums
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void SHA512RandomFile()
|
||||
public void Sha512RandomFile()
|
||||
{
|
||||
Sha512Context ctx = new Sha512Context();
|
||||
ctx.Init();
|
||||
@@ -100,7 +100,7 @@ namespace DiscImageChef.Tests.Checksums
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void SHA512RandomData()
|
||||
public void Sha512RandomData()
|
||||
{
|
||||
byte[] data = new byte[1048576];
|
||||
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "random"), FileMode.Open,
|
||||
@@ -115,7 +115,7 @@ namespace DiscImageChef.Tests.Checksums
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void SHA512RandomInstance()
|
||||
public void Sha512RandomInstance()
|
||||
{
|
||||
byte[] data = new byte[1048576];
|
||||
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "random"), FileMode.Open,
|
||||
|
||||
@@ -35,8 +35,8 @@ namespace DiscImageChef.Tests.Checksums
|
||||
[TestFixture]
|
||||
public class SpamSum
|
||||
{
|
||||
static readonly string ExpectedEmpty = "3::";
|
||||
static readonly string ExpectedRandom = "24576:3dvzuAsHTQ16pc7O1Q/gS9qze+Swwn9s6IX:8/TQQpaVqze+JN6IX";
|
||||
const string EXPECTED_EMPTY = "3::";
|
||||
const string EXPECTED_RANDOM = "24576:3dvzuAsHTQ16pc7O1Q/gS9qze+Swwn9s6IX:8/TQQpaVqze+JN6IX";
|
||||
|
||||
[Test]
|
||||
public void SpamSumEmptyData()
|
||||
@@ -47,9 +47,8 @@ namespace DiscImageChef.Tests.Checksums
|
||||
fs.Read(data, 0, 1048576);
|
||||
fs.Close();
|
||||
fs.Dispose();
|
||||
SpamSumContext ctx = new SpamSumContext();
|
||||
string result = SpamSumContext.Data(data, out byte[] tmp);
|
||||
Assert.AreEqual(ExpectedEmpty, result);
|
||||
string result = SpamSumContext.Data(data, out _);
|
||||
Assert.AreEqual(EXPECTED_EMPTY, result);
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -65,7 +64,7 @@ namespace DiscImageChef.Tests.Checksums
|
||||
ctx.Init();
|
||||
ctx.Update(data);
|
||||
string result = ctx.End();
|
||||
Assert.AreEqual(ExpectedEmpty, result);
|
||||
Assert.AreEqual(EXPECTED_EMPTY, result);
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -77,9 +76,8 @@ namespace DiscImageChef.Tests.Checksums
|
||||
fs.Read(data, 0, 1048576);
|
||||
fs.Close();
|
||||
fs.Dispose();
|
||||
SpamSumContext ctx = new SpamSumContext();
|
||||
string result = SpamSumContext.Data(data, out byte[] tmp);
|
||||
Assert.AreEqual(ExpectedRandom, result);
|
||||
string result = SpamSumContext.Data(data, out _);
|
||||
Assert.AreEqual(EXPECTED_RANDOM, result);
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -95,7 +93,7 @@ namespace DiscImageChef.Tests.Checksums
|
||||
ctx.Init();
|
||||
ctx.Update(data);
|
||||
string result = ctx.End();
|
||||
Assert.AreEqual(ExpectedRandom, result);
|
||||
Assert.AreEqual(EXPECTED_RANDOM, result);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user