Remove Gen2 namespace from tests.

This commit is contained in:
Ray Koopa 2019-01-02 16:30:37 +01:00
parent 61377411a1
commit 13f97d706a
18 changed files with 57 additions and 52 deletions

View File

@ -1,13 +1,11 @@
using Microsoft.VisualStudio.TestTools.UnitTesting; using Microsoft.VisualStudio.TestTools.UnitTesting;
using Syroot.Worms;
using Syroot.Worms.Test.Common; using Syroot.Worms.Test.Common;
namespace Syroot.Worms.Test.Gen2 namespace Syroot.Worms.Test
{ {
/// <summary> /// <summary>
/// Represents a collection of tests for the <see cref="Archive"/> class. /// Represents a collection of tests for the <see cref="Archive"/> class.
/// </summary> /// </summary>
[TestCategory("Gen2")]
[TestClass] [TestClass]
public class ArchiveTests public class ArchiveTests
{ {

View File

@ -2,12 +2,11 @@ using Microsoft.VisualStudio.TestTools.UnitTesting;
using Syroot.Worms.Armageddon; using Syroot.Worms.Armageddon;
using Syroot.Worms.Test.Common; using Syroot.Worms.Test.Common;
namespace Syroot.Worms.Test.Gen2.Armageddon namespace Syroot.Worms.Test.Armageddon
{ {
/// <summary> /// <summary>
/// Represents a collection of tests for the <see cref="GeneratedMap"/> class. /// Represents a collection of tests for the <see cref="GeneratedMap"/> class.
/// </summary> /// </summary>
[TestCategory("Armageddon")]
[TestClass] [TestClass]
public class GeneratedMapTests public class GeneratedMapTests
{ {

View File

@ -2,12 +2,11 @@ using Microsoft.VisualStudio.TestTools.UnitTesting;
using Syroot.Worms.Armageddon; using Syroot.Worms.Armageddon;
using Syroot.Worms.Test.Common; using Syroot.Worms.Test.Common;
namespace Syroot.Worms.Test.Gen2.Armageddon namespace Syroot.Worms.Test.Armageddon
{ {
/// <summary> /// <summary>
/// Represents a collection of tests for the <see cref="LandData"/> class. /// Represents a collection of tests for the <see cref="LandData"/> class.
/// </summary> /// </summary>
[TestCategory("Armageddon")]
[TestClass] [TestClass]
public class LandDataTests public class LandDataTests
{ {

View File

@ -2,12 +2,11 @@ using Microsoft.VisualStudio.TestTools.UnitTesting;
using Syroot.Worms.Armageddon.ProjectX; using Syroot.Worms.Armageddon.ProjectX;
using Syroot.Worms.Test.Common; using Syroot.Worms.Test.Common;
namespace Syroot.Worms.Test.Gen2.Armageddon.ProjectX namespace Syroot.Worms.Test.Armageddon.ProjectX
{ {
/// <summary> /// <summary>
/// Represents a collection of tests for the <see cref="Library"/> class. /// Represents a collection of tests for the <see cref="Library"/> class.
/// </summary> /// </summary>
[TestCategory("ProjectX")]
[TestClass] [TestClass]
public class LibraryTests public class LibraryTests
{ {

View File

@ -2,12 +2,11 @@ using Microsoft.VisualStudio.TestTools.UnitTesting;
using Syroot.Worms.Armageddon.ProjectX; using Syroot.Worms.Armageddon.ProjectX;
using Syroot.Worms.Test.Common; using Syroot.Worms.Test.Common;
namespace Syroot.Worms.Test.Gen2.Armageddon.ProjectX namespace Syroot.Worms.Test.Armageddon.ProjectX
{ {
/// <summary> /// <summary>
/// Represents a collection of tests for the <see cref="Scheme"/> class. /// Represents a collection of tests for the <see cref="Scheme"/> class.
/// </summary> /// </summary>
[TestCategory("ProjectX")]
[TestClass] [TestClass]
public class SchemeTests public class SchemeTests
{ {

View File

@ -2,12 +2,11 @@ using Microsoft.VisualStudio.TestTools.UnitTesting;
using Syroot.Worms.Armageddon; using Syroot.Worms.Armageddon;
using Syroot.Worms.Test.Common; using Syroot.Worms.Test.Common;
namespace Syroot.Worms.Test.Gen2.Armageddon namespace Syroot.Worms.Test.Armageddon
{ {
/// <summary> /// <summary>
/// Represents a collection of tests for the <see cref="Scheme"/> class. /// Represents a collection of tests for the <see cref="Scheme"/> class.
/// </summary> /// </summary>
[TestCategory("Armageddon")]
[TestClass] [TestClass]
public class SchemeTests public class SchemeTests
{ {

View File

@ -2,12 +2,11 @@ using Microsoft.VisualStudio.TestTools.UnitTesting;
using Syroot.Worms.Armageddon; using Syroot.Worms.Armageddon;
using Syroot.Worms.Test.Common; using Syroot.Worms.Test.Common;
namespace Syroot.Worms.Test.Gen2.Armageddon namespace Syroot.Worms.Test.Armageddon
{ {
/// <summary> /// <summary>
/// Represents a collection of tests for the <see cref="TeamContainer"/> class. /// Represents a collection of tests for the <see cref="TeamContainer"/> class.
/// </summary> /// </summary>
[TestCategory("Armageddon")]
[TestClass] [TestClass]
public class TeamContainerTests public class TeamContainerTests
{ {

View File

@ -53,9 +53,7 @@ namespace Syroot.Worms.Test.Common
List<string> gamePaths = GetGamePaths(games); List<string> gamePaths = GetGamePaths(games);
List<string> files = new List<string>(); List<string> files = new List<string>();
foreach (string testPath in gamePaths) foreach (string testPath in gamePaths)
{
files.AddRange(Directory.GetFiles(testPath, wildcard, SearchOption.AllDirectories)); files.AddRange(Directory.GetFiles(testPath, wildcard, SearchOption.AllDirectories));
}
return files; return files;
} }
@ -63,17 +61,11 @@ namespace Syroot.Worms.Test.Common
{ {
List<string> gamePaths = new List<string>(); List<string> gamePaths = new List<string>();
if (game.HasFlag(Game.Worms2)) if (game.HasFlag(Game.Worms2))
{
gamePaths.AddRange(_gamePathsWorms2); gamePaths.AddRange(_gamePathsWorms2);
}
if (game.HasFlag(Game.WormsArmageddon)) if (game.HasFlag(Game.WormsArmageddon))
{
gamePaths.AddRange(_gamePathsWormsArmageddon); gamePaths.AddRange(_gamePathsWormsArmageddon);
}
if (game.HasFlag(Game.WormsWorldParty)) if (game.HasFlag(Game.WormsWorldParty))
{
gamePaths.AddRange(_gamePathsWormsWorldParty); gamePaths.AddRange(_gamePathsWormsWorldParty);
}
return gamePaths; return gamePaths;
} }
} }

View File

@ -1,13 +1,11 @@
using Microsoft.VisualStudio.TestTools.UnitTesting; using Microsoft.VisualStudio.TestTools.UnitTesting;
using Syroot.Worms;
using Syroot.Worms.Test.Common; using Syroot.Worms.Test.Common;
namespace Syroot.Worms.Test.Gen2 namespace Syroot.Worms.Test
{ {
/// <summary> /// <summary>
/// Represents a collection of tests for the <see cref="Img"/> class. /// Represents a collection of tests for the <see cref="Img"/> class.
/// </summary> /// </summary>
[TestCategory("Gen2")]
[TestClass] [TestClass]
public class ImageTests public class ImageTests
{ {

View File

@ -0,0 +1,32 @@
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Syroot.Worms.OnlineWorms;
namespace Syroot.Worms.Test.OnlineWorms
{
/// <summary>
/// Represents a collection of tests for the <see cref="LaunchConfig"/> class.
/// </summary>
[TestClass]
public class LaunchConfigTests
{
// ---- METHODS (PUBLIC) ---------------------------------------------------------------------------------------
/// <summary>
/// Tests if encryptind and decrypting passwords yields the same results.
/// </summary>
[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);
}
}
}
}

View File

@ -1,13 +1,11 @@
using Microsoft.VisualStudio.TestTools.UnitTesting; using Microsoft.VisualStudio.TestTools.UnitTesting;
using Syroot.Worms;
using Syroot.Worms.Test.Common; using Syroot.Worms.Test.Common;
namespace Syroot.Worms.Test.Gen2 namespace Syroot.Worms.Test
{ {
/// <summary> /// <summary>
/// Represents a collection of tests for the <see cref="RiffPalette"/> class. /// Represents a collection of tests for the <see cref="RiffPalette"/> class.
/// </summary> /// </summary>
[TestCategory("Gen2")]
[TestClass] [TestClass]
public class PaletteTests public class PaletteTests
{ {

View File

@ -3,10 +3,9 @@
<TargetFramework>netcoreapp2.1</TargetFramework> <TargetFramework>netcoreapp2.1</TargetFramework>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0" /> <PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
<PackageReference Include="MSTest.TestAdapter" Version="1.1.11" /> <PackageReference Include="MSTest.TestAdapter" Version="1.4.0" />
<PackageReference Include="MSTest.TestFramework" Version="1.1.11" /> <PackageReference Include="MSTest.TestFramework" Version="1.4.0" />
<ProjectReference Include="..\Syroot.Worms\Syroot.Worms.csproj" /> <ProjectReference Include="..\Syroot.Worms\Syroot.Worms.csproj" />
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -1,13 +1,12 @@
using Microsoft.VisualStudio.TestTools.UnitTesting; using Microsoft.VisualStudio.TestTools.UnitTesting;
using Syroot.Worms.WorldParty;
using Syroot.Worms.Test.Common; using Syroot.Worms.Test.Common;
using Syroot.Worms.WorldParty;
namespace Syroot.Worms.Test.Gen2.WorldParty namespace Syroot.Worms.Test.WorldParty
{ {
/// <summary> /// <summary>
/// Represents a collection of tests for the <see cref="LandData"/> class. /// Represents a collection of tests for the <see cref="LandData"/> class.
/// </summary> /// </summary>
[TestCategory("WorldParty")]
[TestClass] [TestClass]
public class LandDataTests public class LandDataTests
{ {

View File

@ -1,13 +1,12 @@
using Microsoft.VisualStudio.TestTools.UnitTesting; using Microsoft.VisualStudio.TestTools.UnitTesting;
using Syroot.Worms.WorldParty;
using Syroot.Worms.Test.Common; using Syroot.Worms.Test.Common;
using Syroot.Worms.WorldParty;
namespace Syroot.Worms.Test.Gen2.WorldParty namespace Syroot.Worms.Test.WorldParty
{ {
/// <summary> /// <summary>
/// Represents a collection of tests for the <see cref="TeamContainer"/> class. /// Represents a collection of tests for the <see cref="TeamContainer"/> class.
/// </summary> /// </summary>
[TestCategory("WorldParty")]
[TestClass] [TestClass]
public class TeamContainerTests public class TeamContainerTests
{ {

View File

@ -1,13 +1,12 @@
using Microsoft.VisualStudio.TestTools.UnitTesting; using Microsoft.VisualStudio.TestTools.UnitTesting;
using Syroot.Worms.Worms2;
using Syroot.Worms.Test.Common; using Syroot.Worms.Test.Common;
using Syroot.Worms.Worms2;
namespace Syroot.Worms.Test.Gen2.Worms2 namespace Syroot.Worms.Test.Worms2
{ {
/// <summary> /// <summary>
/// Represents a collection of tests for the <see cref="LandData"/> class. /// Represents a collection of tests for the <see cref="LandData"/> class.
/// </summary> /// </summary>
[TestCategory("Worms2")]
[TestClass] [TestClass]
public class LandDataTests public class LandDataTests
{ {

View File

@ -1,13 +1,12 @@
using Microsoft.VisualStudio.TestTools.UnitTesting; using Microsoft.VisualStudio.TestTools.UnitTesting;
using Syroot.Worms.Worms2;
using Syroot.Worms.Test.Common; using Syroot.Worms.Test.Common;
using Syroot.Worms.Worms2;
namespace Syroot.Worms.Test.Gen2.Worms2 namespace Syroot.Worms.Test.Worms2
{ {
/// <summary> /// <summary>
/// Represents a collection of tests for the <see cref="SchemeOptions"/> class. /// Represents a collection of tests for the <see cref="SchemeOptions"/> class.
/// </summary> /// </summary>
[TestCategory("Worms2")]
[TestClass] [TestClass]
public class SchemeOptionsTests public class SchemeOptionsTests
{ {

View File

@ -1,13 +1,12 @@
using Microsoft.VisualStudio.TestTools.UnitTesting; using Microsoft.VisualStudio.TestTools.UnitTesting;
using Syroot.Worms.Worms2;
using Syroot.Worms.Test.Common; using Syroot.Worms.Test.Common;
using Syroot.Worms.Worms2;
namespace Syroot.Worms.Test.Gen2.Worms2 namespace Syroot.Worms.Test.Worms2
{ {
/// <summary> /// <summary>
/// Represents a collection of tests for the <see cref="SchemeWeapons"/> class. /// Represents a collection of tests for the <see cref="SchemeWeapons"/> class.
/// </summary> /// </summary>
[TestCategory("Worms2")]
[TestClass] [TestClass]
public class SchemeWeaponsTests public class SchemeWeaponsTests
{ {

View File

@ -1,13 +1,12 @@
using Microsoft.VisualStudio.TestTools.UnitTesting; using Microsoft.VisualStudio.TestTools.UnitTesting;
using Syroot.Worms.Worms2;
using Syroot.Worms.Test.Common; using Syroot.Worms.Test.Common;
using Syroot.Worms.Worms2;
namespace Syroot.Worms.Test.Gen2.Worms2 namespace Syroot.Worms.Test.Worms2
{ {
/// <summary> /// <summary>
/// Represents a collection of tests for the <see cref="TeamContainer"/> class. /// Represents a collection of tests for the <see cref="TeamContainer"/> class.
/// </summary> /// </summary>
[TestCategory("Worms2")]
[TestClass] [TestClass]
public class TeamContainerTests public class TeamContainerTests
{ {