From 251acec10224baef49e2973ee88987b180a37cca Mon Sep 17 00:00:00 2001 From: Kamron Batman <3953314+kamronbatman@users.noreply.github.com> Date: Sun, 29 Aug 2021 00:48:11 -0700 Subject: [PATCH] fix: Fixes tests that require races to be loaded (#745) --- .../Server.Tests/Fixtures/ServerFixture.cs | 2 +- .../UOContent.Tests/Fixtures/ServerFixture.cs | 38 +++++++++++++++++++ 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 Projects/UOContent.Tests/Fixtures/ServerFixture.cs diff --git a/Projects/Server.Tests/Fixtures/ServerFixture.cs b/Projects/Server.Tests/Fixtures/ServerFixture.cs index fa4669c32..4b0b7cae6 100644 --- a/Projects/Server.Tests/Fixtures/ServerFixture.cs +++ b/Projects/Server.Tests/Fixtures/ServerFixture.cs @@ -2,7 +2,7 @@ using System; namespace Server.Tests { - public class ServerFixture : IDisposable + internal class ServerFixture : IDisposable { // Global setup static ServerFixture() diff --git a/Projects/UOContent.Tests/Fixtures/ServerFixture.cs b/Projects/UOContent.Tests/Fixtures/ServerFixture.cs new file mode 100644 index 000000000..ab391505b --- /dev/null +++ b/Projects/UOContent.Tests/Fixtures/ServerFixture.cs @@ -0,0 +1,38 @@ +using System; +using Server.Misc; + +namespace Server.Tests +{ + internal class ServerFixture : IDisposable + { + // Global setup + static ServerFixture() + { + Core.LoopContext = new EventLoopContext(); + + Core.Expansion = Expansion.EJ; + + // Load Configurations + ServerConfiguration.Load(true); + + // Configure / Initialize + TestMapDefinitions.ConfigureTestMapDefinitions(); + + // Configure the world + World.Configure(); + + Timer.Init(0); + + // Configure Races + RaceDefinitions.Configure(); + + // Load the world + World.Load(); + } + + public void Dispose() + { + Timer.Init(0); + } + } +}