diff --git a/Content.IntegrationTests/ContentIntegrationTest.cs b/Content.IntegrationTests/ContentIntegrationTest.cs index ed7a98f57c..a5596482a9 100644 --- a/Content.IntegrationTests/ContentIntegrationTest.cs +++ b/Content.IntegrationTests/ContentIntegrationTest.cs @@ -1,9 +1,13 @@ using Content.Client; using Content.Client.Interfaces.Parallax; +using Content.Server; +using Content.Server.GameTicking; +using Content.Server.Interfaces.GameTicking; using Robust.Shared.ContentPack; using Robust.Shared.Interfaces.Configuration; using Robust.Shared.IoC; using Robust.UnitTesting; +using EntryPoint = Content.Client.EntryPoint; namespace Content.IntegrationTests { @@ -11,7 +15,7 @@ namespace Content.IntegrationTests { protected override ClientIntegrationInstance StartClient(ClientIntegrationOptions options = null) { - options = options ?? new ClientIntegrationOptions(); + options ??= new ClientIntegrationOptions(); // ReSharper disable once RedundantNameQualifier options.ClientContentAssembly = typeof(EntryPoint).Assembly; options.SharedContentAssembly = typeof(Shared.EntryPoint).Assembly; @@ -33,10 +37,27 @@ namespace Content.IntegrationTests protected override ServerIntegrationInstance StartServer(ServerIntegrationOptions options = null) { - options = options ?? new ServerIntegrationOptions(); + options ??= new ServerIntegrationOptions(); options.ServerContentAssembly = typeof(Server.EntryPoint).Assembly; options.SharedContentAssembly = typeof(Shared.EntryPoint).Assembly; return base.StartServer(options); } + + protected ServerIntegrationInstance StartServerDummyTicker(ServerIntegrationOptions options = null) + { + options ??= new ServerIntegrationOptions(); + options.BeforeStart += () => + { + IoCManager.Resolve().SetModuleBaseCallbacks(new ServerModuleTestingCallbacks + { + ServerBeforeIoC = () => + { + IoCManager.Register(true); + } + }); + }; + + return StartServer(options); + } } } diff --git a/Content.IntegrationTests/DummyGameTicker.cs b/Content.IntegrationTests/DummyGameTicker.cs new file mode 100644 index 0000000000..ae1ddc2272 --- /dev/null +++ b/Content.IntegrationTests/DummyGameTicker.cs @@ -0,0 +1,67 @@ +using System; +using System.Collections.Generic; +using Content.Server.GameTicking; +using Content.Server.Interfaces.GameTicking; +using Content.Shared; +using Robust.Server.Interfaces.Player; +using Robust.Shared.Timing; + +namespace Content.IntegrationTests +{ + public class DummyGameTicker : SharedGameTicker, IGameTicker + { + public GameRunLevel RunLevel { get; } = GameRunLevel.InRound; + public event Action OnRunLevelChanged; + + public void Initialize() + { + } + + public void Update(FrameEventArgs frameEventArgs) + { + } + + public void RestartRound() + { + } + + public void StartRound() + { + } + + public void EndRound() + { + } + + public void Respawn(IPlayerSession targetPlayer) + { + } + + public void MakeObserve(IPlayerSession player) + { + } + + public void MakeJoinGame(IPlayerSession player) + { + } + + public void ToggleReady(IPlayerSession player, bool ready) + { + } + + public T AddGameRule() where T : GameRule, new() + { + return new T(); + } + + public void RemoveGameRule(GameRule rule) + { + } + + public IEnumerable ActiveGameRules { get; } = Array.Empty(); + + public void SetStartPreset(Type type) + { + } + } +} diff --git a/Content.IntegrationTests/ConnectTest.cs b/Content.IntegrationTests/Tests/ConnectTest.cs similarity index 97% rename from Content.IntegrationTests/ConnectTest.cs rename to Content.IntegrationTests/Tests/ConnectTest.cs index 6dabb5ebaa..fc385f63fb 100644 --- a/Content.IntegrationTests/ConnectTest.cs +++ b/Content.IntegrationTests/Tests/ConnectTest.cs @@ -7,7 +7,7 @@ using Robust.Shared.Interfaces.GameObjects; using Robust.Shared.Interfaces.Network; using Robust.Shared.IoC; -namespace Content.IntegrationTests +namespace Content.IntegrationTests.Tests { [TestFixture] public class ConnectTest : ContentIntegrationTest diff --git a/Content.IntegrationTests/SaveLoadSaveTest.cs b/Content.IntegrationTests/Tests/SaveLoadSaveTest.cs similarity index 98% rename from Content.IntegrationTests/SaveLoadSaveTest.cs rename to Content.IntegrationTests/Tests/SaveLoadSaveTest.cs index 8ed57f07e3..dfbe8bf834 100644 --- a/Content.IntegrationTests/SaveLoadSaveTest.cs +++ b/Content.IntegrationTests/Tests/SaveLoadSaveTest.cs @@ -8,7 +8,7 @@ using Robust.Shared.Interfaces.Resources; using Robust.Shared.Map; using Robust.Shared.Utility; -namespace Content.IntegrationTests +namespace Content.IntegrationTests.Tests { /// /// Tests that the diff --git a/Content.IntegrationTests/StartTest.cs b/Content.IntegrationTests/Tests/StartTest.cs similarity index 97% rename from Content.IntegrationTests/StartTest.cs rename to Content.IntegrationTests/Tests/StartTest.cs index 8de172ddda..bedb94136c 100644 --- a/Content.IntegrationTests/StartTest.cs +++ b/Content.IntegrationTests/Tests/StartTest.cs @@ -2,7 +2,7 @@ using System.Threading.Tasks; using NUnit.Framework; using Robust.Shared.Exceptions; -namespace Content.IntegrationTests +namespace Content.IntegrationTests.Tests { [TestFixture] public class StartTest : ContentIntegrationTest