From 5a0378f2f2b978485929d24c50fa972495abdc5e Mon Sep 17 00:00:00 2001 From: yankejustin Date: Thu, 21 May 2015 15:13:04 -0400 Subject: [PATCH 1/3] Removed useless test The information returned by constructing a GeoIP class is never null or empty. It will return information stating that the information is "unknown" or provide some type of default value. --- Client.Tests/Core/Information/GeoIP.Tests.cs | 21 -------------------- 1 file changed, 21 deletions(-) delete mode 100644 Client.Tests/Core/Information/GeoIP.Tests.cs diff --git a/Client.Tests/Core/Information/GeoIP.Tests.cs b/Client.Tests/Core/Information/GeoIP.Tests.cs deleted file mode 100644 index d210c31d..00000000 --- a/Client.Tests/Core/Information/GeoIP.Tests.cs +++ /dev/null @@ -1,21 +0,0 @@ -using Microsoft.VisualStudio.TestTools.UnitTesting; -using xClient.Core.Information; - - -namespace xClient.Tests.Core.Information -{ - [TestClass] - public class GeoIPTests - { - [TestMethod] - public void GetGeoIPTest() - { - var ipInformation = new GeoIP(); - Assert.IsNotNull(ipInformation.City); - Assert.IsNotNull(ipInformation.Country); - Assert.IsNotNull(ipInformation.CountryCode); - Assert.IsNotNull(ipInformation.Region); - Assert.IsNotNull(ipInformation.WanIp); - } - } -} \ No newline at end of file From 630b27bde3785adc604567325dc99a9d53907b21 Mon Sep 17 00:00:00 2001 From: yankejustin Date: Thu, 21 May 2015 16:12:58 -0400 Subject: [PATCH 2/3] Added Unit Tests for SafeQuickLZ Added Unit Tests with small random and large random sets of data. --- Client.Tests/Client.Tests.csproj | 6 +- .../Core/Compression/SafeQuickLZ.Tests.cs | 131 ++++++++++++++++++ .../Core/Compression/SafeQuickLZ.Tests.cs | 131 ++++++++++++++++++ Server.Tests/Server.Tests.csproj | 1 + 4 files changed, 267 insertions(+), 2 deletions(-) create mode 100644 Client.Tests/Core/Compression/SafeQuickLZ.Tests.cs create mode 100644 Server.Tests/Core/Compression/SafeQuickLZ.Tests.cs diff --git a/Client.Tests/Client.Tests.csproj b/Client.Tests/Client.Tests.csproj index 7da6b759..2659278a 100644 --- a/Client.Tests/Client.Tests.csproj +++ b/Client.Tests/Client.Tests.csproj @@ -55,9 +55,9 @@ + - @@ -66,7 +66,9 @@ Client - + + + diff --git a/Client.Tests/Core/Compression/SafeQuickLZ.Tests.cs b/Client.Tests/Core/Compression/SafeQuickLZ.Tests.cs new file mode 100644 index 00000000..324f22a7 --- /dev/null +++ b/Client.Tests/Core/Compression/SafeQuickLZ.Tests.cs @@ -0,0 +1,131 @@ +using System; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using xClient.Core.Compression; + +namespace xClient.Tests.Core.Compression +{ + [TestClass] + public class SafeQuickLZTests + { + // Tests using pseudo-randomly generated data. + #region Random Data + + /* + * Purpose: To validate a small amount of data after compression/decompression + * using SafeQuickLZ with level 1 compression. + */ + [TestMethod] + [TestCategory("Compression")] + public void SmallDataTestLevel1() + { + SafeQuickLZ safeQuickLZtest = new SafeQuickLZ(); + byte[] SmallData = new byte[100]; + + // Fill the small data array with random data. + new Random().NextBytes(SmallData); + + // Store the compressed data. + byte[] SmallDataCompressed = safeQuickLZtest.Compress(SmallData, 0, SmallData.Length, 1); + + // The original should not equal the compressed data. + Assert.AreNotEqual(SmallData, SmallDataCompressed, "Original data is equal to the compressed data!"); + + // Store the decompressed data. + byte[] SmallDataDecompressed = safeQuickLZtest.Decompress(SmallDataCompressed, 0, SmallDataCompressed.Length); + + // The compressed data should not equal the decompressed data. + Assert.AreNotEqual(SmallDataCompressed, SmallDataDecompressed, "Compressed data is equal to the decompressed data!"); + // The original data must equal the decompressed data; must be able to make a round-trip. + CollectionAssert.AreEqual(SmallData, SmallDataDecompressed, "Original data does not match the decompressed data!"); + } + + /* + * Purpose: To validate a small amount of data after compression/decompression + * using SafeQuickLZ with level 3 compression. + */ + [TestMethod] + [TestCategory("Compression")] + public void SmallDataTestLevel3() + { + SafeQuickLZ safeQuickLZtest = new SafeQuickLZ(); + byte[] SmallData = new byte[100]; + + // Fill the small data array with random data. + new Random().NextBytes(SmallData); + + // Store the compressed data. + byte[] SmallDataCompressed = safeQuickLZtest.Compress(SmallData, 0, SmallData.Length, 3); + + // The original should not equal the compressed data. + Assert.AreNotEqual(SmallData, SmallDataCompressed, "Original data is equal to the compressed data!"); + + // Store the decompressed data. + byte[] SmallDataDecompressed = safeQuickLZtest.Decompress(SmallDataCompressed, 0, SmallDataCompressed.Length); + + // The compressed data should not equal the decompressed data. + Assert.AreNotEqual(SmallDataCompressed, SmallDataDecompressed, "Compressed data is equal to the decompressed data!"); + // The original data must equal the decompressed data; must be able to make a round-trip. + CollectionAssert.AreEqual(SmallData, SmallDataDecompressed, "Original data does not match the decompressed data!"); + } + + /* + * Purpose: To validate a large amount of data after compression/decompression + * using SafeQuickLZ with level 1 compression. + */ + [TestMethod] + [TestCategory("Compression")] + public void BigDataTestLevel1() + { + SafeQuickLZ safeQuickLZtest = new SafeQuickLZ(); + byte[] BigData = new byte[100000]; + + // Fill the big data array with random data. + new Random().NextBytes(BigData); + + // Store the compressed data. + byte[] BigDataCompressed = safeQuickLZtest.Compress(BigData, 0, BigData.Length, 1); + + // The original should not equal the compressed data. + Assert.AreNotEqual(BigData, BigDataCompressed, "Original data is equal to the compressed data!"); + + // Store the decompressed data. + byte[] BigDataDecompressed = safeQuickLZtest.Decompress(BigDataCompressed, 0, BigDataCompressed.Length); + + // The compressed data should not equal the decompressed data. + Assert.AreNotEqual(BigDataCompressed, BigDataDecompressed, "Compressed data is equal to the decompressed data!"); + // The original data must equal the decompressed data; must be able to make a round-trip. + CollectionAssert.AreEqual(BigData, BigDataDecompressed, "Original data does not match the decompressed data!"); + } + + /* + * Purpose: To validate a large amount of data after compression/decompression + * using SafeQuickLZ with level 3 compression. + */ + [TestMethod] + [TestCategory("Compression")] + public void BigDataTestLevel3() + { + SafeQuickLZ safeQuickLZtest = new SafeQuickLZ(); + byte[] BigData = new byte[100000]; + + // Fill the big data array with random data. + new Random().NextBytes(BigData); + + // Store the compressed data. + byte[] BigDataCompressed = safeQuickLZtest.Compress(BigData, 0, BigData.Length, 3); + + // The original should not equal the compressed data. + Assert.AreNotEqual(BigData, BigDataCompressed, "Original data is equal to the compressed data!"); + + // Store the decompressed data. + byte[] BigDataDecompressed = safeQuickLZtest.Decompress(BigDataCompressed, 0, BigDataCompressed.Length); + + // The compressed data should not equal the decompressed data. + Assert.AreNotEqual(BigDataCompressed, BigDataDecompressed, "Compressed data is equal to the decompressed data!"); + // The original data must equal the decompressed data; must be able to make a round-trip. + CollectionAssert.AreEqual(BigData, BigDataDecompressed, "Original data does not match the decompressed data!"); + } + + #endregion + } +} \ No newline at end of file diff --git a/Server.Tests/Core/Compression/SafeQuickLZ.Tests.cs b/Server.Tests/Core/Compression/SafeQuickLZ.Tests.cs new file mode 100644 index 00000000..5317ac43 --- /dev/null +++ b/Server.Tests/Core/Compression/SafeQuickLZ.Tests.cs @@ -0,0 +1,131 @@ +using System; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using xServer.Core.Compression; + +namespace xServer.Tests.Core.Compression +{ + [TestClass] + public class SafeQuickLZTests + { + // Tests using pseudo-randomly generated data. + #region Random Data + + /* + * Purpose: To validate a small amount of data after compression/decompression + * using SafeQuickLZ with level 1 compression. + */ + [TestMethod] + [TestCategory("Compression")] + public void SmallDataTestLevel1() + { + SafeQuickLZ safeQuickLZtest = new SafeQuickLZ(); + byte[] SmallData = new byte[100]; + + // Fill the small data array with random data. + new Random().NextBytes(SmallData); + + // Store the compressed data. + byte[] SmallDataCompressed = safeQuickLZtest.Compress(SmallData, 0, SmallData.Length, 1); + + // The original should not equal the compressed data. + Assert.AreNotEqual(SmallData, SmallDataCompressed, "Original data is equal to the compressed data!"); + + // Store the decompressed data. + byte[] SmallDataDecompressed = safeQuickLZtest.Decompress(SmallDataCompressed, 0, SmallDataCompressed.Length); + + // The compressed data should not equal the decompressed data. + Assert.AreNotEqual(SmallDataCompressed, SmallDataDecompressed, "Compressed data is equal to the decompressed data!"); + // The original data must equal the decompressed data; must be able to make a round-trip. + CollectionAssert.AreEqual(SmallData, SmallDataDecompressed, "Original data does not match the decompressed data!"); + } + + /* + * Purpose: To validate a small amount of data after compression/decompression + * using SafeQuickLZ with level 3 compression. + */ + [TestMethod] + [TestCategory("Compression")] + public void SmallDataTestLevel3() + { + SafeQuickLZ safeQuickLZtest = new SafeQuickLZ(); + byte[] SmallData = new byte[100]; + + // Fill the small data array with random data. + new Random().NextBytes(SmallData); + + // Store the compressed data. + byte[] SmallDataCompressed = safeQuickLZtest.Compress(SmallData, 0, SmallData.Length, 3); + + // The original should not equal the compressed data. + Assert.AreNotEqual(SmallData, SmallDataCompressed, "Original data is equal to the compressed data!"); + + // Store the decompressed data. + byte[] SmallDataDecompressed = safeQuickLZtest.Decompress(SmallDataCompressed, 0, SmallDataCompressed.Length); + + // The compressed data should not equal the decompressed data. + Assert.AreNotEqual(SmallDataCompressed, SmallDataDecompressed, "Compressed data is equal to the decompressed data!"); + // The original data must equal the decompressed data; must be able to make a round-trip. + CollectionAssert.AreEqual(SmallData, SmallDataDecompressed, "Original data does not match the decompressed data!"); + } + + /* + * Purpose: To validate a large amount of data after compression/decompression + * using SafeQuickLZ with level 1 compression. + */ + [TestMethod] + [TestCategory("Compression")] + public void BigDataTestLevel1() + { + SafeQuickLZ safeQuickLZtest = new SafeQuickLZ(); + byte[] BigData = new byte[100000]; + + // Fill the big data array with random data. + new Random().NextBytes(BigData); + + // Store the compressed data. + byte[] BigDataCompressed = safeQuickLZtest.Compress(BigData, 0, BigData.Length, 1); + + // The original should not equal the compressed data. + Assert.AreNotEqual(BigData, BigDataCompressed, "Original data is equal to the compressed data!"); + + // Store the decompressed data. + byte[] BigDataDecompressed = safeQuickLZtest.Decompress(BigDataCompressed, 0, BigDataCompressed.Length); + + // The compressed data should not equal the decompressed data. + Assert.AreNotEqual(BigDataCompressed, BigDataDecompressed, "Compressed data is equal to the decompressed data!"); + // The original data must equal the decompressed data; must be able to make a round-trip. + CollectionAssert.AreEqual(BigData, BigDataDecompressed, "Original data does not match the decompressed data!"); + } + + /* + * Purpose: To validate a large amount of data after compression/decompression + * using SafeQuickLZ with level 3 compression. + */ + [TestMethod] + [TestCategory("Compression")] + public void BigDataTestLevel3() + { + SafeQuickLZ safeQuickLZtest = new SafeQuickLZ(); + byte[] BigData = new byte[100000]; + + // Fill the big data array with random data. + new Random().NextBytes(BigData); + + // Store the compressed data. + byte[] BigDataCompressed = safeQuickLZtest.Compress(BigData, 0, BigData.Length, 3); + + // The original should not equal the compressed data. + Assert.AreNotEqual(BigData, BigDataCompressed, "Original data is equal to the compressed data!"); + + // Store the decompressed data. + byte[] BigDataDecompressed = safeQuickLZtest.Decompress(BigDataCompressed, 0, BigDataCompressed.Length); + + // The compressed data should not equal the decompressed data. + Assert.AreNotEqual(BigDataCompressed, BigDataDecompressed, "Compressed data is equal to the decompressed data!"); + // The original data must equal the decompressed data; must be able to make a round-trip. + CollectionAssert.AreEqual(BigData, BigDataDecompressed, "Original data does not match the decompressed data!"); + } + + #endregion + } +} \ No newline at end of file diff --git a/Server.Tests/Server.Tests.csproj b/Server.Tests/Server.Tests.csproj index f84adae7..3e60cec7 100644 --- a/Server.Tests/Server.Tests.csproj +++ b/Server.Tests/Server.Tests.csproj @@ -53,6 +53,7 @@ + From e3591b5e022e568fad6de9d7295ee0f7cde9b00f Mon Sep 17 00:00:00 2001 From: MaxXor Date: Sat, 23 May 2015 09:56:32 +0200 Subject: [PATCH 3/3] Small changes to unit test --- Client.Tests/Client.Tests.csproj | 4 +- .../Core/Compression/SafeQuickLZ.Tests.cs | 69 +++++++++---------- .../Core/Compression/SafeQuickLZ.Tests.cs | 61 ++++++++-------- 3 files changed, 61 insertions(+), 73 deletions(-) diff --git a/Client.Tests/Client.Tests.csproj b/Client.Tests/Client.Tests.csproj index 99dd4b1d..9647ec61 100644 --- a/Client.Tests/Client.Tests.csproj +++ b/Client.Tests/Client.Tests.csproj @@ -66,9 +66,7 @@ Client - - - + diff --git a/Client.Tests/Core/Compression/SafeQuickLZ.Tests.cs b/Client.Tests/Core/Compression/SafeQuickLZ.Tests.cs index 324f22a7..1fef6496 100644 --- a/Client.Tests/Core/Compression/SafeQuickLZ.Tests.cs +++ b/Client.Tests/Core/Compression/SafeQuickLZ.Tests.cs @@ -7,36 +7,33 @@ namespace xClient.Tests.Core.Compression [TestClass] public class SafeQuickLZTests { - // Tests using pseudo-randomly generated data. - #region Random Data - /* * Purpose: To validate a small amount of data after compression/decompression * using SafeQuickLZ with level 1 compression. */ [TestMethod] [TestCategory("Compression")] - public void SmallDataTestLevel1() + public void SmallDataCompressionTestLevel1() { SafeQuickLZ safeQuickLZtest = new SafeQuickLZ(); - byte[] SmallData = new byte[100]; + byte[] smallData = new byte[100]; // Fill the small data array with random data. - new Random().NextBytes(SmallData); + new Random().NextBytes(smallData); // Store the compressed data. - byte[] SmallDataCompressed = safeQuickLZtest.Compress(SmallData, 0, SmallData.Length, 1); + byte[] smallDataCompressed = safeQuickLZtest.Compress(smallData, 0, smallData.Length, 1); // The original should not equal the compressed data. - Assert.AreNotEqual(SmallData, SmallDataCompressed, "Original data is equal to the compressed data!"); + Assert.AreNotEqual(smallData, smallDataCompressed, "Original data is equal to the compressed data!"); // Store the decompressed data. - byte[] SmallDataDecompressed = safeQuickLZtest.Decompress(SmallDataCompressed, 0, SmallDataCompressed.Length); + byte[] smallDataDecompressed = safeQuickLZtest.Decompress(smallDataCompressed, 0, smallDataCompressed.Length); // The compressed data should not equal the decompressed data. - Assert.AreNotEqual(SmallDataCompressed, SmallDataDecompressed, "Compressed data is equal to the decompressed data!"); + Assert.AreNotEqual(smallDataCompressed, smallDataDecompressed, "Compressed data is equal to the decompressed data!"); // The original data must equal the decompressed data; must be able to make a round-trip. - CollectionAssert.AreEqual(SmallData, SmallDataDecompressed, "Original data does not match the decompressed data!"); + CollectionAssert.AreEqual(smallData, smallDataDecompressed, "Original data does not match the decompressed data!"); } /* @@ -45,27 +42,27 @@ namespace xClient.Tests.Core.Compression */ [TestMethod] [TestCategory("Compression")] - public void SmallDataTestLevel3() + public void SmallDataCompressionTestLevel3() { SafeQuickLZ safeQuickLZtest = new SafeQuickLZ(); - byte[] SmallData = new byte[100]; + byte[] smallData = new byte[100]; // Fill the small data array with random data. - new Random().NextBytes(SmallData); + new Random().NextBytes(smallData); // Store the compressed data. - byte[] SmallDataCompressed = safeQuickLZtest.Compress(SmallData, 0, SmallData.Length, 3); + byte[] smallDataCompressed = safeQuickLZtest.Compress(smallData, 0, smallData.Length, 3); // The original should not equal the compressed data. - Assert.AreNotEqual(SmallData, SmallDataCompressed, "Original data is equal to the compressed data!"); + Assert.AreNotEqual(smallData, smallDataCompressed, "Original data is equal to the compressed data!"); // Store the decompressed data. - byte[] SmallDataDecompressed = safeQuickLZtest.Decompress(SmallDataCompressed, 0, SmallDataCompressed.Length); + byte[] smallDataDecompressed = safeQuickLZtest.Decompress(smallDataCompressed, 0, smallDataCompressed.Length); // The compressed data should not equal the decompressed data. - Assert.AreNotEqual(SmallDataCompressed, SmallDataDecompressed, "Compressed data is equal to the decompressed data!"); + Assert.AreNotEqual(smallDataCompressed, smallDataDecompressed, "Compressed data is equal to the decompressed data!"); // The original data must equal the decompressed data; must be able to make a round-trip. - CollectionAssert.AreEqual(SmallData, SmallDataDecompressed, "Original data does not match the decompressed data!"); + CollectionAssert.AreEqual(smallData, smallDataDecompressed, "Original data does not match the decompressed data!"); } /* @@ -74,27 +71,27 @@ namespace xClient.Tests.Core.Compression */ [TestMethod] [TestCategory("Compression")] - public void BigDataTestLevel1() + public void BigDataCompressionTestLevel1() { SafeQuickLZ safeQuickLZtest = new SafeQuickLZ(); - byte[] BigData = new byte[100000]; + byte[] bigData = new byte[100000]; // Fill the big data array with random data. - new Random().NextBytes(BigData); + new Random().NextBytes(bigData); // Store the compressed data. - byte[] BigDataCompressed = safeQuickLZtest.Compress(BigData, 0, BigData.Length, 1); + byte[] bigDataCompressed = safeQuickLZtest.Compress(bigData, 0, bigData.Length, 1); // The original should not equal the compressed data. - Assert.AreNotEqual(BigData, BigDataCompressed, "Original data is equal to the compressed data!"); + Assert.AreNotEqual(bigData, bigDataCompressed, "Original data is equal to the compressed data!"); // Store the decompressed data. - byte[] BigDataDecompressed = safeQuickLZtest.Decompress(BigDataCompressed, 0, BigDataCompressed.Length); + byte[] bigDataDecompressed = safeQuickLZtest.Decompress(bigDataCompressed, 0, bigDataCompressed.Length); // The compressed data should not equal the decompressed data. - Assert.AreNotEqual(BigDataCompressed, BigDataDecompressed, "Compressed data is equal to the decompressed data!"); + Assert.AreNotEqual(bigDataCompressed, bigDataDecompressed, "Compressed data is equal to the decompressed data!"); // The original data must equal the decompressed data; must be able to make a round-trip. - CollectionAssert.AreEqual(BigData, BigDataDecompressed, "Original data does not match the decompressed data!"); + CollectionAssert.AreEqual(bigData, bigDataDecompressed, "Original data does not match the decompressed data!"); } /* @@ -103,29 +100,27 @@ namespace xClient.Tests.Core.Compression */ [TestMethod] [TestCategory("Compression")] - public void BigDataTestLevel3() + public void BigDataCompressionTestLevel3() { SafeQuickLZ safeQuickLZtest = new SafeQuickLZ(); - byte[] BigData = new byte[100000]; + byte[] bigData = new byte[100000]; // Fill the big data array with random data. - new Random().NextBytes(BigData); + new Random().NextBytes(bigData); // Store the compressed data. - byte[] BigDataCompressed = safeQuickLZtest.Compress(BigData, 0, BigData.Length, 3); + byte[] bigDataCompressed = safeQuickLZtest.Compress(bigData, 0, bigData.Length, 3); // The original should not equal the compressed data. - Assert.AreNotEqual(BigData, BigDataCompressed, "Original data is equal to the compressed data!"); + Assert.AreNotEqual(bigData, bigDataCompressed, "Original data is equal to the compressed data!"); // Store the decompressed data. - byte[] BigDataDecompressed = safeQuickLZtest.Decompress(BigDataCompressed, 0, BigDataCompressed.Length); + byte[] bigDataDecompressed = safeQuickLZtest.Decompress(bigDataCompressed, 0, bigDataCompressed.Length); // The compressed data should not equal the decompressed data. - Assert.AreNotEqual(BigDataCompressed, BigDataDecompressed, "Compressed data is equal to the decompressed data!"); + Assert.AreNotEqual(bigDataCompressed, bigDataDecompressed, "Compressed data is equal to the decompressed data!"); // The original data must equal the decompressed data; must be able to make a round-trip. - CollectionAssert.AreEqual(BigData, BigDataDecompressed, "Original data does not match the decompressed data!"); + CollectionAssert.AreEqual(bigData, bigDataDecompressed, "Original data does not match the decompressed data!"); } - - #endregion } } \ No newline at end of file diff --git a/Server.Tests/Core/Compression/SafeQuickLZ.Tests.cs b/Server.Tests/Core/Compression/SafeQuickLZ.Tests.cs index 5317ac43..a6cf29ea 100644 --- a/Server.Tests/Core/Compression/SafeQuickLZ.Tests.cs +++ b/Server.Tests/Core/Compression/SafeQuickLZ.Tests.cs @@ -7,9 +7,6 @@ namespace xServer.Tests.Core.Compression [TestClass] public class SafeQuickLZTests { - // Tests using pseudo-randomly generated data. - #region Random Data - /* * Purpose: To validate a small amount of data after compression/decompression * using SafeQuickLZ with level 1 compression. @@ -19,24 +16,24 @@ namespace xServer.Tests.Core.Compression public void SmallDataTestLevel1() { SafeQuickLZ safeQuickLZtest = new SafeQuickLZ(); - byte[] SmallData = new byte[100]; + byte[] smallData = new byte[100]; // Fill the small data array with random data. - new Random().NextBytes(SmallData); + new Random().NextBytes(smallData); // Store the compressed data. - byte[] SmallDataCompressed = safeQuickLZtest.Compress(SmallData, 0, SmallData.Length, 1); + byte[] smallDataCompressed = safeQuickLZtest.Compress(smallData, 0, smallData.Length, 1); // The original should not equal the compressed data. - Assert.AreNotEqual(SmallData, SmallDataCompressed, "Original data is equal to the compressed data!"); + Assert.AreNotEqual(smallData, smallDataCompressed, "Original data is equal to the compressed data!"); // Store the decompressed data. - byte[] SmallDataDecompressed = safeQuickLZtest.Decompress(SmallDataCompressed, 0, SmallDataCompressed.Length); + byte[] smallDataDecompressed = safeQuickLZtest.Decompress(smallDataCompressed, 0, smallDataCompressed.Length); // The compressed data should not equal the decompressed data. - Assert.AreNotEqual(SmallDataCompressed, SmallDataDecompressed, "Compressed data is equal to the decompressed data!"); + Assert.AreNotEqual(smallDataCompressed, smallDataDecompressed, "Compressed data is equal to the decompressed data!"); // The original data must equal the decompressed data; must be able to make a round-trip. - CollectionAssert.AreEqual(SmallData, SmallDataDecompressed, "Original data does not match the decompressed data!"); + CollectionAssert.AreEqual(smallData, smallDataDecompressed, "Original data does not match the decompressed data!"); } /* @@ -48,24 +45,24 @@ namespace xServer.Tests.Core.Compression public void SmallDataTestLevel3() { SafeQuickLZ safeQuickLZtest = new SafeQuickLZ(); - byte[] SmallData = new byte[100]; + byte[] smallData = new byte[100]; // Fill the small data array with random data. - new Random().NextBytes(SmallData); + new Random().NextBytes(smallData); // Store the compressed data. - byte[] SmallDataCompressed = safeQuickLZtest.Compress(SmallData, 0, SmallData.Length, 3); + byte[] smallDataCompressed = safeQuickLZtest.Compress(smallData, 0, smallData.Length, 3); // The original should not equal the compressed data. - Assert.AreNotEqual(SmallData, SmallDataCompressed, "Original data is equal to the compressed data!"); + Assert.AreNotEqual(smallData, smallDataCompressed, "Original data is equal to the compressed data!"); // Store the decompressed data. - byte[] SmallDataDecompressed = safeQuickLZtest.Decompress(SmallDataCompressed, 0, SmallDataCompressed.Length); + byte[] smallDataDecompressed = safeQuickLZtest.Decompress(smallDataCompressed, 0, smallDataCompressed.Length); // The compressed data should not equal the decompressed data. - Assert.AreNotEqual(SmallDataCompressed, SmallDataDecompressed, "Compressed data is equal to the decompressed data!"); + Assert.AreNotEqual(smallDataCompressed, smallDataDecompressed, "Compressed data is equal to the decompressed data!"); // The original data must equal the decompressed data; must be able to make a round-trip. - CollectionAssert.AreEqual(SmallData, SmallDataDecompressed, "Original data does not match the decompressed data!"); + CollectionAssert.AreEqual(smallData, smallDataDecompressed, "Original data does not match the decompressed data!"); } /* @@ -77,24 +74,24 @@ namespace xServer.Tests.Core.Compression public void BigDataTestLevel1() { SafeQuickLZ safeQuickLZtest = new SafeQuickLZ(); - byte[] BigData = new byte[100000]; + byte[] bigData = new byte[100000]; // Fill the big data array with random data. - new Random().NextBytes(BigData); + new Random().NextBytes(bigData); // Store the compressed data. - byte[] BigDataCompressed = safeQuickLZtest.Compress(BigData, 0, BigData.Length, 1); + byte[] bigDataCompressed = safeQuickLZtest.Compress(bigData, 0, bigData.Length, 1); // The original should not equal the compressed data. - Assert.AreNotEqual(BigData, BigDataCompressed, "Original data is equal to the compressed data!"); + Assert.AreNotEqual(bigData, bigDataCompressed, "Original data is equal to the compressed data!"); // Store the decompressed data. - byte[] BigDataDecompressed = safeQuickLZtest.Decompress(BigDataCompressed, 0, BigDataCompressed.Length); + byte[] bigDataDecompressed = safeQuickLZtest.Decompress(bigDataCompressed, 0, bigDataCompressed.Length); // The compressed data should not equal the decompressed data. - Assert.AreNotEqual(BigDataCompressed, BigDataDecompressed, "Compressed data is equal to the decompressed data!"); + Assert.AreNotEqual(bigDataCompressed, bigDataDecompressed, "Compressed data is equal to the decompressed data!"); // The original data must equal the decompressed data; must be able to make a round-trip. - CollectionAssert.AreEqual(BigData, BigDataDecompressed, "Original data does not match the decompressed data!"); + CollectionAssert.AreEqual(bigData, bigDataDecompressed, "Original data does not match the decompressed data!"); } /* @@ -106,26 +103,24 @@ namespace xServer.Tests.Core.Compression public void BigDataTestLevel3() { SafeQuickLZ safeQuickLZtest = new SafeQuickLZ(); - byte[] BigData = new byte[100000]; + byte[] bigData = new byte[100000]; // Fill the big data array with random data. - new Random().NextBytes(BigData); + new Random().NextBytes(bigData); // Store the compressed data. - byte[] BigDataCompressed = safeQuickLZtest.Compress(BigData, 0, BigData.Length, 3); + byte[] bigDataCompressed = safeQuickLZtest.Compress(bigData, 0, bigData.Length, 3); // The original should not equal the compressed data. - Assert.AreNotEqual(BigData, BigDataCompressed, "Original data is equal to the compressed data!"); + Assert.AreNotEqual(bigData, bigDataCompressed, "Original data is equal to the compressed data!"); // Store the decompressed data. - byte[] BigDataDecompressed = safeQuickLZtest.Decompress(BigDataCompressed, 0, BigDataCompressed.Length); + byte[] bigDataDecompressed = safeQuickLZtest.Decompress(bigDataCompressed, 0, bigDataCompressed.Length); // The compressed data should not equal the decompressed data. - Assert.AreNotEqual(BigDataCompressed, BigDataDecompressed, "Compressed data is equal to the decompressed data!"); + Assert.AreNotEqual(bigDataCompressed, bigDataDecompressed, "Compressed data is equal to the decompressed data!"); // The original data must equal the decompressed data; must be able to make a round-trip. - CollectionAssert.AreEqual(BigData, BigDataDecompressed, "Original data does not match the decompressed data!"); + CollectionAssert.AreEqual(bigData, bigDataDecompressed, "Original data does not match the decompressed data!"); } - - #endregion } } \ No newline at end of file