mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Update checksum unit tests.
This commit is contained in:
@@ -29,6 +29,7 @@
|
||||
using System.IO;
|
||||
using Aaru.Checksums;
|
||||
using Aaru.CommonTypes.Interfaces;
|
||||
using FluentAssertions;
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace Aaru.Tests.Checksums
|
||||
@@ -46,7 +47,7 @@ namespace Aaru.Tests.Checksums
|
||||
};
|
||||
|
||||
[Test]
|
||||
public void Adler32EmptyData()
|
||||
public void EmptyData()
|
||||
{
|
||||
byte[] data = new byte[1048576];
|
||||
|
||||
@@ -57,18 +58,18 @@ namespace Aaru.Tests.Checksums
|
||||
fs.Close();
|
||||
fs.Dispose();
|
||||
Adler32Context.Data(data, out byte[] result);
|
||||
Assert.AreEqual(_expectedEmpty, result);
|
||||
result.Should().BeEquivalentTo(_expectedEmpty);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Adler32EmptyFile()
|
||||
public void EmptyFile()
|
||||
{
|
||||
byte[] result = Adler32Context.File(Path.Combine(Consts.TEST_FILES_ROOT, "Checksum test files", "empty"));
|
||||
Assert.AreEqual(_expectedEmpty, result);
|
||||
result.Should().BeEquivalentTo(_expectedEmpty);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Adler32EmptyInstance()
|
||||
public void EmptyInstance()
|
||||
{
|
||||
byte[] data = new byte[1048576];
|
||||
|
||||
@@ -81,11 +82,11 @@ namespace Aaru.Tests.Checksums
|
||||
IChecksum ctx = new Adler32Context();
|
||||
ctx.Update(data);
|
||||
byte[] result = ctx.Final();
|
||||
Assert.AreEqual(_expectedEmpty, result);
|
||||
result.Should().BeEquivalentTo(_expectedEmpty);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Adler32RandomData()
|
||||
public void RandomData()
|
||||
{
|
||||
byte[] data = new byte[1048576];
|
||||
|
||||
@@ -96,18 +97,18 @@ namespace Aaru.Tests.Checksums
|
||||
fs.Close();
|
||||
fs.Dispose();
|
||||
Adler32Context.Data(data, out byte[] result);
|
||||
Assert.AreEqual(_expectedRandom, result);
|
||||
result.Should().BeEquivalentTo(_expectedRandom);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Adler32RandomFile()
|
||||
public void RandomFile()
|
||||
{
|
||||
byte[] result = Adler32Context.File(Path.Combine(Consts.TEST_FILES_ROOT, "Checksum test files", "random"));
|
||||
Assert.AreEqual(_expectedRandom, result);
|
||||
result.Should().BeEquivalentTo(_expectedRandom);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Adler32RandomInstance()
|
||||
public void RandomInstance()
|
||||
{
|
||||
byte[] data = new byte[1048576];
|
||||
|
||||
@@ -120,7 +121,7 @@ namespace Aaru.Tests.Checksums
|
||||
IChecksum ctx = new Adler32Context();
|
||||
ctx.Update(data);
|
||||
byte[] result = ctx.Final();
|
||||
Assert.AreEqual(_expectedRandom, result);
|
||||
result.Should().BeEquivalentTo(_expectedRandom);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -28,6 +28,7 @@
|
||||
|
||||
using System.IO;
|
||||
using Aaru.Checksums;
|
||||
using FluentAssertions;
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace Aaru.Tests.Checksums
|
||||
@@ -45,7 +46,7 @@ namespace Aaru.Tests.Checksums
|
||||
};
|
||||
|
||||
[Test]
|
||||
public void Crc16CcittEmptyData()
|
||||
public void EmptyData()
|
||||
{
|
||||
byte[] data = new byte[1048576];
|
||||
|
||||
@@ -56,20 +57,20 @@ namespace Aaru.Tests.Checksums
|
||||
fs.Close();
|
||||
fs.Dispose();
|
||||
CRC16CCITTContext.Data(data, out byte[] result);
|
||||
Assert.AreEqual(_expectedEmpty, result);
|
||||
result.Should().BeEquivalentTo(_expectedEmpty);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Crc16CcittEmptyFile()
|
||||
public void EmptyFile()
|
||||
{
|
||||
byte[] result =
|
||||
CRC16CCITTContext.File(Path.Combine(Consts.TEST_FILES_ROOT, "Checksum test files", "empty"));
|
||||
|
||||
Assert.AreEqual(_expectedEmpty, result);
|
||||
result.Should().BeEquivalentTo(_expectedEmpty);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Crc16CcittEmptyInstance()
|
||||
public void EmptyInstance()
|
||||
{
|
||||
byte[] data = new byte[1048576];
|
||||
|
||||
@@ -82,11 +83,11 @@ namespace Aaru.Tests.Checksums
|
||||
var ctx = new CRC16CCITTContext();
|
||||
ctx.Update(data);
|
||||
byte[] result = ctx.Final();
|
||||
Assert.AreEqual(_expectedEmpty, result);
|
||||
result.Should().BeEquivalentTo(_expectedEmpty);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Crc16CcittRandomData()
|
||||
public void RandomData()
|
||||
{
|
||||
byte[] data = new byte[1048576];
|
||||
|
||||
@@ -97,20 +98,20 @@ namespace Aaru.Tests.Checksums
|
||||
fs.Close();
|
||||
fs.Dispose();
|
||||
CRC16CCITTContext.Data(data, out byte[] result);
|
||||
Assert.AreEqual(_expectedRandom, result);
|
||||
result.Should().BeEquivalentTo(_expectedRandom);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Crc16CcittRandomFile()
|
||||
public void RandomFile()
|
||||
{
|
||||
byte[] result =
|
||||
CRC16CCITTContext.File(Path.Combine(Consts.TEST_FILES_ROOT, "Checksum test files", "random"));
|
||||
|
||||
Assert.AreEqual(_expectedRandom, result);
|
||||
result.Should().BeEquivalentTo(_expectedRandom);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Crc16CcittRandomInstance()
|
||||
public void RandomInstance()
|
||||
{
|
||||
byte[] data = new byte[1048576];
|
||||
|
||||
@@ -123,7 +124,7 @@ namespace Aaru.Tests.Checksums
|
||||
var ctx = new CRC16CCITTContext();
|
||||
ctx.Update(data);
|
||||
byte[] result = ctx.Final();
|
||||
Assert.AreEqual(_expectedRandom, result);
|
||||
result.Should().BeEquivalentTo(_expectedRandom);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -29,6 +29,7 @@
|
||||
using System.IO;
|
||||
using Aaru.Checksums;
|
||||
using Aaru.CommonTypes.Interfaces;
|
||||
using FluentAssertions;
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace Aaru.Tests.Checksums
|
||||
@@ -46,7 +47,7 @@ namespace Aaru.Tests.Checksums
|
||||
};
|
||||
|
||||
[Test]
|
||||
public void Crc16IbmEmptyData()
|
||||
public void EmptyData()
|
||||
{
|
||||
byte[] data = new byte[1048576];
|
||||
|
||||
@@ -57,19 +58,19 @@ namespace Aaru.Tests.Checksums
|
||||
fs.Close();
|
||||
fs.Dispose();
|
||||
CRC16IBMContext.Data(data, out byte[] result);
|
||||
Assert.AreEqual(_expectedEmpty, result);
|
||||
result.Should().BeEquivalentTo(_expectedEmpty);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Crc16IbmEmptyFile()
|
||||
public void EmptyFile()
|
||||
{
|
||||
byte[] result = CRC16IBMContext.File(Path.Combine(Consts.TEST_FILES_ROOT, "Checksum test files", "empty"));
|
||||
|
||||
Assert.AreEqual(_expectedEmpty, result);
|
||||
result.Should().BeEquivalentTo(_expectedEmpty);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Crc16IbmEmptyInstance()
|
||||
public void EmptyInstance()
|
||||
{
|
||||
byte[] data = new byte[1048576];
|
||||
|
||||
@@ -82,11 +83,11 @@ namespace Aaru.Tests.Checksums
|
||||
IChecksum ctx = new CRC16IBMContext();
|
||||
ctx.Update(data);
|
||||
byte[] result = ctx.Final();
|
||||
Assert.AreEqual(_expectedEmpty, result);
|
||||
result.Should().BeEquivalentTo(_expectedEmpty);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Crc16IbmRandomData()
|
||||
public void RandomData()
|
||||
{
|
||||
byte[] data = new byte[1048576];
|
||||
|
||||
@@ -97,19 +98,19 @@ namespace Aaru.Tests.Checksums
|
||||
fs.Close();
|
||||
fs.Dispose();
|
||||
CRC16IBMContext.Data(data, out byte[] result);
|
||||
Assert.AreEqual(_expectedRandom, result);
|
||||
result.Should().BeEquivalentTo(_expectedRandom);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Crc16IbmRandomFile()
|
||||
public void RandomFile()
|
||||
{
|
||||
byte[] result = CRC16IBMContext.File(Path.Combine(Consts.TEST_FILES_ROOT, "Checksum test files", "random"));
|
||||
|
||||
Assert.AreEqual(_expectedRandom, result);
|
||||
result.Should().BeEquivalentTo(_expectedRandom);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Crc16IbmRandomInstance()
|
||||
public void RandomInstance()
|
||||
{
|
||||
byte[] data = new byte[1048576];
|
||||
|
||||
@@ -122,7 +123,7 @@ namespace Aaru.Tests.Checksums
|
||||
IChecksum ctx = new CRC16IBMContext();
|
||||
ctx.Update(data);
|
||||
byte[] result = ctx.Final();
|
||||
Assert.AreEqual(_expectedRandom, result);
|
||||
result.Should().BeEquivalentTo(_expectedRandom);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -29,6 +29,7 @@
|
||||
using System.IO;
|
||||
using Aaru.Checksums;
|
||||
using Aaru.CommonTypes.Interfaces;
|
||||
using FluentAssertions;
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace Aaru.Tests.Checksums
|
||||
@@ -46,7 +47,7 @@ namespace Aaru.Tests.Checksums
|
||||
};
|
||||
|
||||
[Test]
|
||||
public void Crc32EmptyData()
|
||||
public void EmptyData()
|
||||
{
|
||||
byte[] data = new byte[1048576];
|
||||
|
||||
@@ -57,18 +58,18 @@ namespace Aaru.Tests.Checksums
|
||||
fs.Close();
|
||||
fs.Dispose();
|
||||
Crc32Context.Data(data, out byte[] result);
|
||||
Assert.AreEqual(_expectedEmpty, result);
|
||||
result.Should().BeEquivalentTo(_expectedEmpty);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Crc32EmptyFile()
|
||||
public void EmptyFile()
|
||||
{
|
||||
byte[] result = Crc32Context.File(Path.Combine(Consts.TEST_FILES_ROOT, "Checksum test files", "empty"));
|
||||
Assert.AreEqual(_expectedEmpty, result);
|
||||
result.Should().BeEquivalentTo(_expectedEmpty);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Crc32EmptyInstance()
|
||||
public void EmptyInstance()
|
||||
{
|
||||
byte[] data = new byte[1048576];
|
||||
|
||||
@@ -81,11 +82,11 @@ namespace Aaru.Tests.Checksums
|
||||
IChecksum ctx = new Crc32Context();
|
||||
ctx.Update(data);
|
||||
byte[] result = ctx.Final();
|
||||
Assert.AreEqual(_expectedEmpty, result);
|
||||
result.Should().BeEquivalentTo(_expectedEmpty);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Crc32RandomData()
|
||||
public void RandomData()
|
||||
{
|
||||
byte[] data = new byte[1048576];
|
||||
|
||||
@@ -96,18 +97,18 @@ namespace Aaru.Tests.Checksums
|
||||
fs.Close();
|
||||
fs.Dispose();
|
||||
Crc32Context.Data(data, out byte[] result);
|
||||
Assert.AreEqual(_expectedRandom, result);
|
||||
result.Should().BeEquivalentTo(_expectedRandom);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Crc32RandomFile()
|
||||
public void RandomFile()
|
||||
{
|
||||
byte[] result = Crc32Context.File(Path.Combine(Consts.TEST_FILES_ROOT, "Checksum test files", "random"));
|
||||
Assert.AreEqual(_expectedRandom, result);
|
||||
result.Should().BeEquivalentTo(_expectedRandom);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Crc32RandomInstance()
|
||||
public void RandomInstance()
|
||||
{
|
||||
byte[] data = new byte[1048576];
|
||||
|
||||
@@ -120,7 +121,7 @@ namespace Aaru.Tests.Checksums
|
||||
IChecksum ctx = new Crc32Context();
|
||||
ctx.Update(data);
|
||||
byte[] result = ctx.Final();
|
||||
Assert.AreEqual(_expectedRandom, result);
|
||||
result.Should().BeEquivalentTo(_expectedRandom);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -29,6 +29,7 @@
|
||||
using System.IO;
|
||||
using Aaru.Checksums;
|
||||
using Aaru.CommonTypes.Interfaces;
|
||||
using FluentAssertions;
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace Aaru.Tests.Checksums
|
||||
@@ -46,7 +47,7 @@ namespace Aaru.Tests.Checksums
|
||||
};
|
||||
|
||||
[Test]
|
||||
public void Crc64EmptyData()
|
||||
public void EmptyData()
|
||||
{
|
||||
byte[] data = new byte[1048576];
|
||||
|
||||
@@ -57,18 +58,18 @@ namespace Aaru.Tests.Checksums
|
||||
fs.Close();
|
||||
fs.Dispose();
|
||||
Crc64Context.Data(data, out byte[] result);
|
||||
Assert.AreEqual(_expectedEmpty, result);
|
||||
result.Should().BeEquivalentTo(_expectedEmpty);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Crc64EmptyFile()
|
||||
public void EmptyFile()
|
||||
{
|
||||
byte[] result = Crc64Context.File(Path.Combine(Consts.TEST_FILES_ROOT, "Checksum test files", "empty"));
|
||||
Assert.AreEqual(_expectedEmpty, result);
|
||||
result.Should().BeEquivalentTo(_expectedEmpty);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Crc64EmptyInstance()
|
||||
public void EmptyInstance()
|
||||
{
|
||||
byte[] data = new byte[1048576];
|
||||
|
||||
@@ -81,11 +82,11 @@ namespace Aaru.Tests.Checksums
|
||||
IChecksum ctx = new Crc64Context();
|
||||
ctx.Update(data);
|
||||
byte[] result = ctx.Final();
|
||||
Assert.AreEqual(_expectedEmpty, result);
|
||||
result.Should().BeEquivalentTo(_expectedEmpty);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Crc64RandomData()
|
||||
public void RandomData()
|
||||
{
|
||||
byte[] data = new byte[1048576];
|
||||
|
||||
@@ -96,18 +97,18 @@ namespace Aaru.Tests.Checksums
|
||||
fs.Close();
|
||||
fs.Dispose();
|
||||
Crc64Context.Data(data, out byte[] result);
|
||||
Assert.AreEqual(_expectedRandom, result);
|
||||
result.Should().BeEquivalentTo(_expectedRandom);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Crc64RandomFile()
|
||||
public void RandomFile()
|
||||
{
|
||||
byte[] result = Crc64Context.File(Path.Combine(Consts.TEST_FILES_ROOT, "Checksum test files", "random"));
|
||||
Assert.AreEqual(_expectedRandom, result);
|
||||
result.Should().BeEquivalentTo(_expectedRandom);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Crc64RandomInstance()
|
||||
public void RandomInstance()
|
||||
{
|
||||
byte[] data = new byte[1048576];
|
||||
|
||||
@@ -120,7 +121,7 @@ namespace Aaru.Tests.Checksums
|
||||
IChecksum ctx = new Crc64Context();
|
||||
ctx.Update(data);
|
||||
byte[] result = ctx.Final();
|
||||
Assert.AreEqual(_expectedRandom, result);
|
||||
result.Should().BeEquivalentTo(_expectedRandom);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -29,6 +29,7 @@
|
||||
using System.IO;
|
||||
using Aaru.Checksums;
|
||||
using Aaru.CommonTypes.Interfaces;
|
||||
using FluentAssertions;
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace Aaru.Tests.Checksums
|
||||
@@ -46,7 +47,7 @@ namespace Aaru.Tests.Checksums
|
||||
};
|
||||
|
||||
[Test]
|
||||
public void Md5EmptyData()
|
||||
public void EmptyData()
|
||||
{
|
||||
byte[] data = new byte[1048576];
|
||||
|
||||
@@ -57,18 +58,18 @@ namespace Aaru.Tests.Checksums
|
||||
fs.Close();
|
||||
fs.Dispose();
|
||||
Md5Context.Data(data, out byte[] result);
|
||||
Assert.AreEqual(_expectedEmpty, result);
|
||||
result.Should().BeEquivalentTo(_expectedEmpty);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Md5EmptyFile()
|
||||
public void EmptyFile()
|
||||
{
|
||||
byte[] result = Md5Context.File(Path.Combine(Consts.TEST_FILES_ROOT, "Checksum test files", "empty"));
|
||||
Assert.AreEqual(_expectedEmpty, result);
|
||||
result.Should().BeEquivalentTo(_expectedEmpty);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Md5EmptyInstance()
|
||||
public void EmptyInstance()
|
||||
{
|
||||
byte[] data = new byte[1048576];
|
||||
|
||||
@@ -81,11 +82,11 @@ namespace Aaru.Tests.Checksums
|
||||
IChecksum ctx = new Md5Context();
|
||||
ctx.Update(data);
|
||||
byte[] result = ctx.Final();
|
||||
Assert.AreEqual(_expectedEmpty, result);
|
||||
result.Should().BeEquivalentTo(_expectedEmpty);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Md5RandomData()
|
||||
public void RandomData()
|
||||
{
|
||||
byte[] data = new byte[1048576];
|
||||
|
||||
@@ -96,18 +97,18 @@ namespace Aaru.Tests.Checksums
|
||||
fs.Close();
|
||||
fs.Dispose();
|
||||
Md5Context.Data(data, out byte[] result);
|
||||
Assert.AreEqual(_expectedRandom, result);
|
||||
result.Should().BeEquivalentTo(_expectedRandom);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Md5RandomFile()
|
||||
public void RandomFile()
|
||||
{
|
||||
byte[] result = Md5Context.File(Path.Combine(Consts.TEST_FILES_ROOT, "Checksum test files", "random"));
|
||||
Assert.AreEqual(_expectedRandom, result);
|
||||
result.Should().BeEquivalentTo(_expectedRandom);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Md5RandomInstance()
|
||||
public void RandomInstance()
|
||||
{
|
||||
byte[] data = new byte[1048576];
|
||||
|
||||
@@ -120,7 +121,7 @@ namespace Aaru.Tests.Checksums
|
||||
IChecksum ctx = new Md5Context();
|
||||
ctx.Update(data);
|
||||
byte[] result = ctx.Final();
|
||||
Assert.AreEqual(_expectedRandom, result);
|
||||
result.Should().BeEquivalentTo(_expectedRandom);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -29,6 +29,7 @@
|
||||
using System.IO;
|
||||
using Aaru.Checksums;
|
||||
using Aaru.CommonTypes.Interfaces;
|
||||
using FluentAssertions;
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace Aaru.Tests.Checksums
|
||||
@@ -48,7 +49,7 @@ namespace Aaru.Tests.Checksums
|
||||
};
|
||||
|
||||
[Test]
|
||||
public void Sha1EmptyData()
|
||||
public void EmptyData()
|
||||
{
|
||||
byte[] data = new byte[1048576];
|
||||
|
||||
@@ -59,18 +60,18 @@ namespace Aaru.Tests.Checksums
|
||||
fs.Close();
|
||||
fs.Dispose();
|
||||
Sha1Context.Data(data, out byte[] result);
|
||||
Assert.AreEqual(_expectedEmpty, result);
|
||||
result.Should().BeEquivalentTo(_expectedEmpty);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Sha1EmptyFile()
|
||||
public void EmptyFile()
|
||||
{
|
||||
byte[] result = Sha1Context.File(Path.Combine(Consts.TEST_FILES_ROOT, "Checksum test files", "empty"));
|
||||
Assert.AreEqual(_expectedEmpty, result);
|
||||
result.Should().BeEquivalentTo(_expectedEmpty);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Sha1EmptyInstance()
|
||||
public void EmptyInstance()
|
||||
{
|
||||
byte[] data = new byte[1048576];
|
||||
|
||||
@@ -83,11 +84,11 @@ namespace Aaru.Tests.Checksums
|
||||
IChecksum ctx = new Sha1Context();
|
||||
ctx.Update(data);
|
||||
byte[] result = ctx.Final();
|
||||
Assert.AreEqual(_expectedEmpty, result);
|
||||
result.Should().BeEquivalentTo(_expectedEmpty);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Sha1RandomData()
|
||||
public void RandomData()
|
||||
{
|
||||
byte[] data = new byte[1048576];
|
||||
|
||||
@@ -98,18 +99,18 @@ namespace Aaru.Tests.Checksums
|
||||
fs.Close();
|
||||
fs.Dispose();
|
||||
Sha1Context.Data(data, out byte[] result);
|
||||
Assert.AreEqual(_expectedRandom, result);
|
||||
result.Should().BeEquivalentTo(_expectedRandom);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Sha1RandomFile()
|
||||
public void RandomFile()
|
||||
{
|
||||
byte[] result = Sha1Context.File(Path.Combine(Consts.TEST_FILES_ROOT, "Checksum test files", "random"));
|
||||
Assert.AreEqual(_expectedRandom, result);
|
||||
result.Should().BeEquivalentTo(_expectedRandom);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Sha1RandomInstance()
|
||||
public void RandomInstance()
|
||||
{
|
||||
byte[] data = new byte[1048576];
|
||||
|
||||
@@ -122,7 +123,7 @@ namespace Aaru.Tests.Checksums
|
||||
IChecksum ctx = new Sha1Context();
|
||||
ctx.Update(data);
|
||||
byte[] result = ctx.Final();
|
||||
Assert.AreEqual(_expectedRandom, result);
|
||||
result.Should().BeEquivalentTo(_expectedRandom);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -29,6 +29,7 @@
|
||||
using System.IO;
|
||||
using Aaru.Checksums;
|
||||
using Aaru.CommonTypes.Interfaces;
|
||||
using FluentAssertions;
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace Aaru.Tests.Checksums
|
||||
@@ -48,7 +49,7 @@ namespace Aaru.Tests.Checksums
|
||||
};
|
||||
|
||||
[Test]
|
||||
public void Sha256EmptyData()
|
||||
public void EmptyData()
|
||||
{
|
||||
byte[] data = new byte[1048576];
|
||||
|
||||
@@ -59,18 +60,18 @@ namespace Aaru.Tests.Checksums
|
||||
fs.Close();
|
||||
fs.Dispose();
|
||||
Sha256Context.Data(data, out byte[] result);
|
||||
Assert.AreEqual(_expectedEmpty, result);
|
||||
result.Should().BeEquivalentTo(_expectedEmpty);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Sha256EmptyFile()
|
||||
public void EmptyFile()
|
||||
{
|
||||
byte[] result = Sha256Context.File(Path.Combine(Consts.TEST_FILES_ROOT, "Checksum test files", "empty"));
|
||||
Assert.AreEqual(_expectedEmpty, result);
|
||||
result.Should().BeEquivalentTo(_expectedEmpty);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Sha256EmptyInstance()
|
||||
public void EmptyInstance()
|
||||
{
|
||||
byte[] data = new byte[1048576];
|
||||
|
||||
@@ -83,11 +84,11 @@ namespace Aaru.Tests.Checksums
|
||||
IChecksum ctx = new Sha256Context();
|
||||
ctx.Update(data);
|
||||
byte[] result = ctx.Final();
|
||||
Assert.AreEqual(_expectedEmpty, result);
|
||||
result.Should().BeEquivalentTo(_expectedEmpty);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Sha256RandomData()
|
||||
public void RandomData()
|
||||
{
|
||||
byte[] data = new byte[1048576];
|
||||
|
||||
@@ -98,18 +99,18 @@ namespace Aaru.Tests.Checksums
|
||||
fs.Close();
|
||||
fs.Dispose();
|
||||
Sha256Context.Data(data, out byte[] result);
|
||||
Assert.AreEqual(_expectedRandom, result);
|
||||
result.Should().BeEquivalentTo(_expectedRandom);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Sha256RandomFile()
|
||||
public void RandomFile()
|
||||
{
|
||||
byte[] result = Sha256Context.File(Path.Combine(Consts.TEST_FILES_ROOT, "Checksum test files", "random"));
|
||||
Assert.AreEqual(_expectedRandom, result);
|
||||
result.Should().BeEquivalentTo(_expectedRandom);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Sha256RandomInstance()
|
||||
public void RandomInstance()
|
||||
{
|
||||
byte[] data = new byte[1048576];
|
||||
|
||||
@@ -122,7 +123,7 @@ namespace Aaru.Tests.Checksums
|
||||
IChecksum ctx = new Sha256Context();
|
||||
ctx.Update(data);
|
||||
byte[] result = ctx.Final();
|
||||
Assert.AreEqual(_expectedRandom, result);
|
||||
result.Should().BeEquivalentTo(_expectedRandom);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -29,6 +29,7 @@
|
||||
using System.IO;
|
||||
using Aaru.Checksums;
|
||||
using Aaru.CommonTypes.Interfaces;
|
||||
using FluentAssertions;
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace Aaru.Tests.Checksums
|
||||
@@ -50,7 +51,7 @@ namespace Aaru.Tests.Checksums
|
||||
};
|
||||
|
||||
[Test]
|
||||
public void Sha384EmptyData()
|
||||
public void EmptyData()
|
||||
{
|
||||
byte[] data = new byte[1048576];
|
||||
|
||||
@@ -61,18 +62,18 @@ namespace Aaru.Tests.Checksums
|
||||
fs.Close();
|
||||
fs.Dispose();
|
||||
Sha384Context.Data(data, out byte[] result);
|
||||
Assert.AreEqual(_expectedEmpty, result);
|
||||
result.Should().BeEquivalentTo(_expectedEmpty);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Sha384EmptyFile()
|
||||
public void EmptyFile()
|
||||
{
|
||||
byte[] result = Sha384Context.File(Path.Combine(Consts.TEST_FILES_ROOT, "Checksum test files", "empty"));
|
||||
Assert.AreEqual(_expectedEmpty, result);
|
||||
result.Should().BeEquivalentTo(_expectedEmpty);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Sha384EmptyInstance()
|
||||
public void EmptyInstance()
|
||||
{
|
||||
byte[] data = new byte[1048576];
|
||||
|
||||
@@ -85,11 +86,11 @@ namespace Aaru.Tests.Checksums
|
||||
IChecksum ctx = new Sha384Context();
|
||||
ctx.Update(data);
|
||||
byte[] result = ctx.Final();
|
||||
Assert.AreEqual(_expectedEmpty, result);
|
||||
result.Should().BeEquivalentTo(_expectedEmpty);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Sha384RandomData()
|
||||
public void RandomData()
|
||||
{
|
||||
byte[] data = new byte[1048576];
|
||||
|
||||
@@ -100,18 +101,18 @@ namespace Aaru.Tests.Checksums
|
||||
fs.Close();
|
||||
fs.Dispose();
|
||||
Sha384Context.Data(data, out byte[] result);
|
||||
Assert.AreEqual(_expectedRandom, result);
|
||||
result.Should().BeEquivalentTo(_expectedRandom);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Sha384RandomFile()
|
||||
public void RandomFile()
|
||||
{
|
||||
byte[] result = Sha384Context.File(Path.Combine(Consts.TEST_FILES_ROOT, "Checksum test files", "random"));
|
||||
Assert.AreEqual(_expectedRandom, result);
|
||||
result.Should().BeEquivalentTo(_expectedRandom);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Sha384RandomInstance()
|
||||
public void RandomInstance()
|
||||
{
|
||||
byte[] data = new byte[1048576];
|
||||
|
||||
@@ -124,7 +125,7 @@ namespace Aaru.Tests.Checksums
|
||||
IChecksum ctx = new Sha384Context();
|
||||
ctx.Update(data);
|
||||
byte[] result = ctx.Final();
|
||||
Assert.AreEqual(_expectedRandom, result);
|
||||
result.Should().BeEquivalentTo(_expectedRandom);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -29,6 +29,7 @@
|
||||
using System.IO;
|
||||
using Aaru.Checksums;
|
||||
using Aaru.CommonTypes.Interfaces;
|
||||
using FluentAssertions;
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace Aaru.Tests.Checksums
|
||||
@@ -52,7 +53,7 @@ namespace Aaru.Tests.Checksums
|
||||
};
|
||||
|
||||
[Test]
|
||||
public void Sha512EmptyData()
|
||||
public void EmptyData()
|
||||
{
|
||||
byte[] data = new byte[1048576];
|
||||
|
||||
@@ -63,18 +64,18 @@ namespace Aaru.Tests.Checksums
|
||||
fs.Close();
|
||||
fs.Dispose();
|
||||
Sha512Context.Data(data, out byte[] result);
|
||||
Assert.AreEqual(_expectedEmpty, result);
|
||||
result.Should().BeEquivalentTo(_expectedEmpty);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Sha512EmptyFile()
|
||||
public void EmptyFile()
|
||||
{
|
||||
byte[] result = Sha512Context.File(Path.Combine(Consts.TEST_FILES_ROOT, "Checksum test files", "empty"));
|
||||
Assert.AreEqual(_expectedEmpty, result);
|
||||
result.Should().BeEquivalentTo(_expectedEmpty);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Sha512EmptyInstance()
|
||||
public void EmptyInstance()
|
||||
{
|
||||
byte[] data = new byte[1048576];
|
||||
|
||||
@@ -87,11 +88,11 @@ namespace Aaru.Tests.Checksums
|
||||
IChecksum ctx = new Sha512Context();
|
||||
ctx.Update(data);
|
||||
byte[] result = ctx.Final();
|
||||
Assert.AreEqual(_expectedEmpty, result);
|
||||
result.Should().BeEquivalentTo(_expectedEmpty);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Sha512RandomData()
|
||||
public void RandomData()
|
||||
{
|
||||
byte[] data = new byte[1048576];
|
||||
|
||||
@@ -106,14 +107,14 @@ namespace Aaru.Tests.Checksums
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Sha512RandomFile()
|
||||
public void RandomFile()
|
||||
{
|
||||
byte[] result = Sha512Context.File(Path.Combine(Consts.TEST_FILES_ROOT, "Checksum test files", "random"));
|
||||
Assert.AreEqual(_expectedRandom, result);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Sha512RandomInstance()
|
||||
public void RandomInstance()
|
||||
{
|
||||
byte[] data = new byte[1048576];
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace Aaru.Tests.Checksums
|
||||
const string EXPECTED_RANDOM = "24576:3dvzuAsHTQ16pc7O1Q/gS9qze+Swwn9s6IX:8/TQQpaVqze+JN6IX";
|
||||
|
||||
[Test]
|
||||
public void SpamSumEmptyData()
|
||||
public void EmptyData()
|
||||
{
|
||||
byte[] data = new byte[1048576];
|
||||
|
||||
@@ -55,7 +55,7 @@ namespace Aaru.Tests.Checksums
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void SpamSumEmptyInstance()
|
||||
public void EmptyInstance()
|
||||
{
|
||||
byte[] data = new byte[1048576];
|
||||
|
||||
@@ -72,7 +72,7 @@ namespace Aaru.Tests.Checksums
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void SpamSumRandomData()
|
||||
public void RandomData()
|
||||
{
|
||||
byte[] data = new byte[1048576];
|
||||
|
||||
@@ -87,7 +87,7 @@ namespace Aaru.Tests.Checksums
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void SpamSumRandomInstance()
|
||||
public void RandomInstance()
|
||||
{
|
||||
byte[] data = new byte[1048576];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user