Allow multiple module testing callbacks

This commit is contained in:
DrSmugleaf
2020-10-29 17:50:25 +01:00
parent 60bee860cb
commit 0321a74bb6
3 changed files with 18 additions and 9 deletions

View File

@@ -57,6 +57,20 @@ namespace Content.IntegrationTests
options ??= new ServerIntegrationOptions();
options.ServerContentAssembly = typeof(Server.EntryPoint).Assembly;
options.SharedContentAssembly = typeof(Shared.EntryPoint).Assembly;
options.BeforeStart += () =>
{
IoCManager.Resolve<IModLoader>().SetModuleBaseCallbacks(new ServerModuleTestingCallbacks
{
ServerBeforeIoC = () =>
{
if (options is ServerContentIntegrationOption contentOptions)
{
contentOptions.ContentBeforeIoC?.Invoke();
}
}
});
};
return base.StartServer(options);
}
@@ -69,11 +83,6 @@ namespace Content.IntegrationTests
{
ServerBeforeIoC = () =>
{
if (options is ServerContentIntegrationOption contentOptions)
{
contentOptions.ContentBeforeIoC?.Invoke();
}
IoCManager.Register<IGameTicker, DummyGameTicker>(true);
}
});