diff --git a/Content.Client/EntryPoint.cs b/Content.Client/EntryPoint.cs index 0020a6d7ce..66e2898088 100644 --- a/Content.Client/EntryPoint.cs +++ b/Content.Client/EntryPoint.cs @@ -82,9 +82,9 @@ namespace Content.Client ClientContentIoC.Register(); - if (TestingCallbacks != null) + foreach (var callback in TestingCallbacks) { - var cast = (ClientModuleTestingCallbacks) TestingCallbacks; + var cast = (ClientModuleTestingCallbacks) callback; cast.ClientBeforeIoC?.Invoke(); } diff --git a/Content.IntegrationTests/ContentIntegrationTest.cs b/Content.IntegrationTests/ContentIntegrationTest.cs index 3db9c53884..cd73571d31 100644 --- a/Content.IntegrationTests/ContentIntegrationTest.cs +++ b/Content.IntegrationTests/ContentIntegrationTest.cs @@ -55,6 +55,20 @@ namespace Content.IntegrationTests options ??= new ServerIntegrationOptions(); options.ServerContentAssembly = typeof(Server.EntryPoint).Assembly; options.SharedContentAssembly = typeof(Shared.EntryPoint).Assembly; + options.BeforeStart += () => + { + IoCManager.Resolve().SetModuleBaseCallbacks(new ServerModuleTestingCallbacks + { + ServerBeforeIoC = () => + { + if (options is ServerContentIntegrationOption contentOptions) + { + contentOptions.ContentBeforeIoC?.Invoke(); + } + } + }); + }; + return base.StartServer(options); } @@ -67,11 +81,6 @@ namespace Content.IntegrationTests { ServerBeforeIoC = () => { - if (options is ServerContentIntegrationOption contentOptions) - { - contentOptions.ContentBeforeIoC?.Invoke(); - } - IoCManager.Register(true); } }); diff --git a/Content.Server/EntryPoint.cs b/Content.Server/EntryPoint.cs index 8afeb571d8..bede93ad71 100644 --- a/Content.Server/EntryPoint.cs +++ b/Content.Server/EntryPoint.cs @@ -44,9 +44,9 @@ namespace Content.Server ServerContentIoC.Register(); - if (TestingCallbacks != null) + foreach (var callback in TestingCallbacks) { - var cast = (ServerModuleTestingCallbacks) TestingCallbacks; + var cast = (ServerModuleTestingCallbacks) callback; cast.ServerBeforeIoC?.Invoke(); }