diff --git a/src/Syroot.Worms.Test/ArchiveTests.cs b/src/Syroot.Worms.Test/ArchiveTests.cs index e913551..94d5929 100644 --- a/src/Syroot.Worms.Test/ArchiveTests.cs +++ b/src/Syroot.Worms.Test/ArchiveTests.cs @@ -1,13 +1,11 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; -using Syroot.Worms; using Syroot.Worms.Test.Common; -namespace Syroot.Worms.Test.Gen2 +namespace Syroot.Worms.Test { /// /// Represents a collection of tests for the class. /// - [TestCategory("Gen2")] [TestClass] public class ArchiveTests { diff --git a/src/Syroot.Worms.Test/Armageddon/GeneratedMapTests.cs b/src/Syroot.Worms.Test/Armageddon/GeneratedMapTests.cs index 76538b3..a27ad3d 100644 --- a/src/Syroot.Worms.Test/Armageddon/GeneratedMapTests.cs +++ b/src/Syroot.Worms.Test/Armageddon/GeneratedMapTests.cs @@ -2,12 +2,11 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; using Syroot.Worms.Armageddon; using Syroot.Worms.Test.Common; -namespace Syroot.Worms.Test.Gen2.Armageddon +namespace Syroot.Worms.Test.Armageddon { /// /// Represents a collection of tests for the class. /// - [TestCategory("Armageddon")] [TestClass] public class GeneratedMapTests { diff --git a/src/Syroot.Worms.Test/Armageddon/LandDataTests.cs b/src/Syroot.Worms.Test/Armageddon/LandDataTests.cs index 570a23a..e561a26 100644 --- a/src/Syroot.Worms.Test/Armageddon/LandDataTests.cs +++ b/src/Syroot.Worms.Test/Armageddon/LandDataTests.cs @@ -2,12 +2,11 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; using Syroot.Worms.Armageddon; using Syroot.Worms.Test.Common; -namespace Syroot.Worms.Test.Gen2.Armageddon +namespace Syroot.Worms.Test.Armageddon { /// /// Represents a collection of tests for the class. /// - [TestCategory("Armageddon")] [TestClass] public class LandDataTests { diff --git a/src/Syroot.Worms.Test/Armageddon/ProjectX/LibraryTests.cs b/src/Syroot.Worms.Test/Armageddon/ProjectX/LibraryTests.cs index a392e57..5c6fa48 100644 --- a/src/Syroot.Worms.Test/Armageddon/ProjectX/LibraryTests.cs +++ b/src/Syroot.Worms.Test/Armageddon/ProjectX/LibraryTests.cs @@ -2,12 +2,11 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; using Syroot.Worms.Armageddon.ProjectX; using Syroot.Worms.Test.Common; -namespace Syroot.Worms.Test.Gen2.Armageddon.ProjectX +namespace Syroot.Worms.Test.Armageddon.ProjectX { /// /// Represents a collection of tests for the class. /// - [TestCategory("ProjectX")] [TestClass] public class LibraryTests { diff --git a/src/Syroot.Worms.Test/Armageddon/ProjectX/SchemeTests.cs b/src/Syroot.Worms.Test/Armageddon/ProjectX/SchemeTests.cs index 921172e..875c742 100644 --- a/src/Syroot.Worms.Test/Armageddon/ProjectX/SchemeTests.cs +++ b/src/Syroot.Worms.Test/Armageddon/ProjectX/SchemeTests.cs @@ -2,12 +2,11 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; using Syroot.Worms.Armageddon.ProjectX; using Syroot.Worms.Test.Common; -namespace Syroot.Worms.Test.Gen2.Armageddon.ProjectX +namespace Syroot.Worms.Test.Armageddon.ProjectX { /// /// Represents a collection of tests for the class. /// - [TestCategory("ProjectX")] [TestClass] public class SchemeTests { diff --git a/src/Syroot.Worms.Test/Armageddon/SchemeTests.cs b/src/Syroot.Worms.Test/Armageddon/SchemeTests.cs index afda839..2d106a2 100644 --- a/src/Syroot.Worms.Test/Armageddon/SchemeTests.cs +++ b/src/Syroot.Worms.Test/Armageddon/SchemeTests.cs @@ -2,12 +2,11 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; using Syroot.Worms.Armageddon; using Syroot.Worms.Test.Common; -namespace Syroot.Worms.Test.Gen2.Armageddon +namespace Syroot.Worms.Test.Armageddon { /// /// Represents a collection of tests for the class. /// - [TestCategory("Armageddon")] [TestClass] public class SchemeTests { diff --git a/src/Syroot.Worms.Test/Armageddon/TeamContainerTests.cs b/src/Syroot.Worms.Test/Armageddon/TeamContainerTests.cs index c850e42..a4b69d2 100644 --- a/src/Syroot.Worms.Test/Armageddon/TeamContainerTests.cs +++ b/src/Syroot.Worms.Test/Armageddon/TeamContainerTests.cs @@ -2,12 +2,11 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; using Syroot.Worms.Armageddon; using Syroot.Worms.Test.Common; -namespace Syroot.Worms.Test.Gen2.Armageddon +namespace Syroot.Worms.Test.Armageddon { /// /// Represents a collection of tests for the class. /// - [TestCategory("Armageddon")] [TestClass] public class TeamContainerTests { diff --git a/src/Syroot.Worms.Test/Core/TestHelpers.cs b/src/Syroot.Worms.Test/Core/TestHelpers.cs index 88e28d0..c9d7f29 100644 --- a/src/Syroot.Worms.Test/Core/TestHelpers.cs +++ b/src/Syroot.Worms.Test/Core/TestHelpers.cs @@ -47,15 +47,13 @@ namespace Syroot.Worms.Test.Common } // ---- METHODS (PRIVATE) -------------------------------------------------------------------------------------- - + private static List FindFiles(Game games, string wildcard) { List gamePaths = GetGamePaths(games); List files = new List(); foreach (string testPath in gamePaths) - { files.AddRange(Directory.GetFiles(testPath, wildcard, SearchOption.AllDirectories)); - } return files; } @@ -63,17 +61,11 @@ namespace Syroot.Worms.Test.Common { List gamePaths = new List(); if (game.HasFlag(Game.Worms2)) - { gamePaths.AddRange(_gamePathsWorms2); - } if (game.HasFlag(Game.WormsArmageddon)) - { gamePaths.AddRange(_gamePathsWormsArmageddon); - } if (game.HasFlag(Game.WormsWorldParty)) - { gamePaths.AddRange(_gamePathsWormsWorldParty); - } return gamePaths; } } diff --git a/src/Syroot.Worms.Test/ImageTests.cs b/src/Syroot.Worms.Test/ImageTests.cs index 208bcf0..53f8855 100644 --- a/src/Syroot.Worms.Test/ImageTests.cs +++ b/src/Syroot.Worms.Test/ImageTests.cs @@ -1,13 +1,11 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; -using Syroot.Worms; using Syroot.Worms.Test.Common; -namespace Syroot.Worms.Test.Gen2 +namespace Syroot.Worms.Test { /// /// Represents a collection of tests for the class. /// - [TestCategory("Gen2")] [TestClass] public class ImageTests { diff --git a/src/Syroot.Worms.Test/OnlineWorms/LaunchConfigTests.cs b/src/Syroot.Worms.Test/OnlineWorms/LaunchConfigTests.cs new file mode 100644 index 0000000..34ecf39 --- /dev/null +++ b/src/Syroot.Worms.Test/OnlineWorms/LaunchConfigTests.cs @@ -0,0 +1,32 @@ +using System; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using Syroot.Worms.OnlineWorms; + +namespace Syroot.Worms.Test.OnlineWorms +{ + /// + /// Represents a collection of tests for the class. + /// + [TestClass] + public class LaunchConfigTests + { + // ---- METHODS (PUBLIC) --------------------------------------------------------------------------------------- + + /// + /// Tests if encryptind and decrypting passwords yields the same results. + /// + [TestMethod] + public void CryptPassword() + { + LaunchConfig launchConfig = new LaunchConfig(); + Random random = new Random(326988912); + foreach (string password in new[] { "Unknown123Test", "blablabl10235", "3252380", "SJDAKDFJS", "fdsklfj" }) + { + uint key = (uint)random.Next(0, Int32.MaxValue); + launchConfig.SetPassword(password, key); + string decryptedPassword = launchConfig.GetPassword(); + Assert.Equals(password, decryptedPassword); + } + } + } +} diff --git a/src/Syroot.Worms.Test/PaletteTests.cs b/src/Syroot.Worms.Test/PaletteTests.cs index 7a186e1..d3b7b4d 100644 --- a/src/Syroot.Worms.Test/PaletteTests.cs +++ b/src/Syroot.Worms.Test/PaletteTests.cs @@ -1,13 +1,11 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; -using Syroot.Worms; using Syroot.Worms.Test.Common; -namespace Syroot.Worms.Test.Gen2 +namespace Syroot.Worms.Test { /// /// Represents a collection of tests for the class. /// - [TestCategory("Gen2")] [TestClass] public class PaletteTests { diff --git a/src/Syroot.Worms.Test/Syroot.Worms.Test.csproj b/src/Syroot.Worms.Test/Syroot.Worms.Test.csproj index b9a8f24..b9ff566 100644 --- a/src/Syroot.Worms.Test/Syroot.Worms.Test.csproj +++ b/src/Syroot.Worms.Test/Syroot.Worms.Test.csproj @@ -3,10 +3,9 @@ netcoreapp2.1 - - - + + + - diff --git a/src/Syroot.Worms.Test/WorldParty/LandDataTests.cs b/src/Syroot.Worms.Test/WorldParty/LandDataTests.cs index a249f49..057ed60 100644 --- a/src/Syroot.Worms.Test/WorldParty/LandDataTests.cs +++ b/src/Syroot.Worms.Test/WorldParty/LandDataTests.cs @@ -1,13 +1,12 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; -using Syroot.Worms.WorldParty; using Syroot.Worms.Test.Common; +using Syroot.Worms.WorldParty; -namespace Syroot.Worms.Test.Gen2.WorldParty +namespace Syroot.Worms.Test.WorldParty { /// /// Represents a collection of tests for the class. /// - [TestCategory("WorldParty")] [TestClass] public class LandDataTests { diff --git a/src/Syroot.Worms.Test/WorldParty/TeamContainerTests.cs b/src/Syroot.Worms.Test/WorldParty/TeamContainerTests.cs index 880566f..449bbdc 100644 --- a/src/Syroot.Worms.Test/WorldParty/TeamContainerTests.cs +++ b/src/Syroot.Worms.Test/WorldParty/TeamContainerTests.cs @@ -1,13 +1,12 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; -using Syroot.Worms.WorldParty; using Syroot.Worms.Test.Common; +using Syroot.Worms.WorldParty; -namespace Syroot.Worms.Test.Gen2.WorldParty +namespace Syroot.Worms.Test.WorldParty { /// /// Represents a collection of tests for the class. /// - [TestCategory("WorldParty")] [TestClass] public class TeamContainerTests { diff --git a/src/Syroot.Worms.Test/Worms2/LandDataTests.cs b/src/Syroot.Worms.Test/Worms2/LandDataTests.cs index e5d2076..8e77cd2 100644 --- a/src/Syroot.Worms.Test/Worms2/LandDataTests.cs +++ b/src/Syroot.Worms.Test/Worms2/LandDataTests.cs @@ -1,13 +1,12 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; -using Syroot.Worms.Worms2; using Syroot.Worms.Test.Common; +using Syroot.Worms.Worms2; -namespace Syroot.Worms.Test.Gen2.Worms2 +namespace Syroot.Worms.Test.Worms2 { /// /// Represents a collection of tests for the class. /// - [TestCategory("Worms2")] [TestClass] public class LandDataTests { diff --git a/src/Syroot.Worms.Test/Worms2/SchemeOptionsTests.cs b/src/Syroot.Worms.Test/Worms2/SchemeOptionsTests.cs index d50502c..4d4a1aa 100644 --- a/src/Syroot.Worms.Test/Worms2/SchemeOptionsTests.cs +++ b/src/Syroot.Worms.Test/Worms2/SchemeOptionsTests.cs @@ -1,13 +1,12 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; -using Syroot.Worms.Worms2; using Syroot.Worms.Test.Common; +using Syroot.Worms.Worms2; -namespace Syroot.Worms.Test.Gen2.Worms2 +namespace Syroot.Worms.Test.Worms2 { /// /// Represents a collection of tests for the class. /// - [TestCategory("Worms2")] [TestClass] public class SchemeOptionsTests { diff --git a/src/Syroot.Worms.Test/Worms2/SchemeWeaponsTests.cs b/src/Syroot.Worms.Test/Worms2/SchemeWeaponsTests.cs index 74efaff..8131b75 100644 --- a/src/Syroot.Worms.Test/Worms2/SchemeWeaponsTests.cs +++ b/src/Syroot.Worms.Test/Worms2/SchemeWeaponsTests.cs @@ -1,13 +1,12 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; -using Syroot.Worms.Worms2; using Syroot.Worms.Test.Common; +using Syroot.Worms.Worms2; -namespace Syroot.Worms.Test.Gen2.Worms2 +namespace Syroot.Worms.Test.Worms2 { /// /// Represents a collection of tests for the class. /// - [TestCategory("Worms2")] [TestClass] public class SchemeWeaponsTests { diff --git a/src/Syroot.Worms.Test/Worms2/TeamContainerTests.cs b/src/Syroot.Worms.Test/Worms2/TeamContainerTests.cs index aa9342c..a88deb9 100644 --- a/src/Syroot.Worms.Test/Worms2/TeamContainerTests.cs +++ b/src/Syroot.Worms.Test/Worms2/TeamContainerTests.cs @@ -1,13 +1,12 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; -using Syroot.Worms.Worms2; using Syroot.Worms.Test.Common; +using Syroot.Worms.Worms2; -namespace Syroot.Worms.Test.Gen2.Worms2 +namespace Syroot.Worms.Test.Worms2 { /// /// Represents a collection of tests for the class. /// - [TestCategory("Worms2")] [TestClass] public class TeamContainerTests {