diff --git a/Client.Tests/Core/Compression/JpgCompressionTests.cs b/Client.Tests/Core/Compression/JpgCompressionTests.cs index 59235f35..17cc8c47 100644 --- a/Client.Tests/Core/Compression/JpgCompressionTests.cs +++ b/Client.Tests/Core/Compression/JpgCompressionTests.cs @@ -1,10 +1,7 @@ using System; using System.Drawing; -using System.Drawing.Imaging; -using System.Linq; using Microsoft.VisualStudio.TestTools.UnitTesting; using xClient.Core.Compression; -using xClient.Core.Helper; namespace xClient.Tests.Core.Compression { @@ -12,7 +9,7 @@ namespace xClient.Tests.Core.Compression public class JpgCompressionTests { [TestMethod] - public void EncryptAndDecryptStringTest() + public void CompressionTest() { var quality = Int64.MaxValue; var jpg = new JpgCompression(quality); diff --git a/Client.Tests/Core/Encryption/AES.Tests.cs b/Client.Tests/Core/Encryption/AES.Tests.cs index 0e72f3d3..99f9aadb 100644 --- a/Client.Tests/Core/Encryption/AES.Tests.cs +++ b/Client.Tests/Core/Encryption/AES.Tests.cs @@ -1,4 +1,5 @@ using System.Linq; +using System.Text; using Microsoft.VisualStudio.TestTools.UnitTesting; using xClient.Core.Encryption; using xClient.Core.Helper; @@ -27,10 +28,10 @@ public void EncryptAndDecryptStringTest() public void EncryptAndDecryptByteArrayTest() { var input = Helper.GetRandomName(100); - var inputByte = GetBytes(input); + var inputByte = Encoding.UTF8.GetBytes(input); var password = Helper.GetRandomName(50); - var passwordByte = GetBytes(password); + var passwordByte = Encoding.UTF8.GetBytes(password); var encrypted = AES.Encrypt(inputByte, passwordByte); Assert.IsNotNull(encrypted); @@ -38,19 +39,10 @@ public void EncryptAndDecryptByteArrayTest() var decrypted = AES.Decrypt(encrypted, passwordByte); - //The decryption method is adding on 9 blank bytes. - var realDecrypted = decrypted.Take(200).ToArray(); + //The decryption method is adding on blank bytes. + var realDecrypted = decrypted.Take(100).ToArray(); CollectionAssert.AreEqual(inputByte,realDecrypted); } - - - private static byte[] GetBytes(string str) - { - byte[] bytes = new byte[str.Length * sizeof(char)]; - System.Buffer.BlockCopy(str.ToCharArray(), 0, bytes, 0, bytes.Length); - return bytes; - } - } } \ No newline at end of file diff --git a/Client.Tests/Core/Information/GeoIPTests.cs b/Client.Tests/Core/Information/GeoIPTests.cs index fea49649..d210c31d 100644 --- a/Client.Tests/Core/Information/GeoIPTests.cs +++ b/Client.Tests/Core/Information/GeoIPTests.cs @@ -1,6 +1,4 @@ -using System; -using System.Runtime.CompilerServices; -using Microsoft.VisualStudio.TestTools.UnitTesting; +using Microsoft.VisualStudio.TestTools.UnitTesting; using xClient.Core.Information; @@ -10,7 +8,7 @@ namespace xClient.Tests.Core.Information public class GeoIPTests { [TestMethod] - public void EncryptAndDecryptStringTest() + public void GetGeoIPTest() { var ipInformation = new GeoIP(); Assert.IsNotNull(ipInformation.City); diff --git a/Server/Properties/AssemblyInfo.cs b/Server/Properties/AssemblyInfo.cs index c784f58c..3ddd267e 100644 --- a/Server/Properties/AssemblyInfo.cs +++ b/Server/Properties/AssemblyInfo.cs @@ -1,4 +1,5 @@ using System.Reflection; +using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using xServer.Settings; @@ -13,6 +14,7 @@ [assembly: AssemblyCopyright("Copyright © MaxX0r 2015")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] +[assembly: InternalsVisibleTo("Server.Tests")] // Durch Festlegen von ComVisible auf "false" werden die Typen in dieser Assembly unsichtbar // für COM-Komponenten. Wenn Sie auf einen Typ in dieser Assembly von