2019-06-29 01:58:16 +02:00
|
|
|
using Content.Client;
|
|
|
|
|
using Content.Client.Interfaces.Parallax;
|
2020-01-20 22:14:44 +01:00
|
|
|
using Content.Server;
|
|
|
|
|
using Content.Server.GameTicking;
|
|
|
|
|
using Content.Server.Interfaces.GameTicking;
|
2019-06-29 01:58:16 +02:00
|
|
|
using Robust.Shared.ContentPack;
|
2019-07-08 23:17:37 +02:00
|
|
|
using Robust.Shared.Interfaces.Configuration;
|
2019-06-29 01:58:16 +02:00
|
|
|
using Robust.Shared.IoC;
|
|
|
|
|
using Robust.UnitTesting;
|
2020-01-20 22:14:44 +01:00
|
|
|
using EntryPoint = Content.Client.EntryPoint;
|
2019-06-29 01:58:16 +02:00
|
|
|
|
|
|
|
|
namespace Content.IntegrationTests
|
|
|
|
|
{
|
|
|
|
|
public abstract class ContentIntegrationTest : RobustIntegrationTest
|
|
|
|
|
{
|
|
|
|
|
protected override ClientIntegrationInstance StartClient(ClientIntegrationOptions options = null)
|
|
|
|
|
{
|
2020-01-20 22:14:44 +01:00
|
|
|
options ??= new ClientIntegrationOptions();
|
2019-08-22 10:21:54 +02:00
|
|
|
// ReSharper disable once RedundantNameQualifier
|
2019-11-13 17:37:46 -05:00
|
|
|
options.ClientContentAssembly = typeof(EntryPoint).Assembly;
|
2019-08-22 10:21:54 +02:00
|
|
|
options.SharedContentAssembly = typeof(Shared.EntryPoint).Assembly;
|
2019-06-29 01:58:16 +02:00
|
|
|
options.BeforeStart += () =>
|
|
|
|
|
{
|
2019-07-08 23:17:37 +02:00
|
|
|
// Connecting to Discord is a massive waste of time.
|
|
|
|
|
// Basically just makes the CI logs a mess.
|
|
|
|
|
IoCManager.Resolve<IConfigurationManager>().SetCVar("discord.enabled", false);
|
2019-06-29 01:58:16 +02:00
|
|
|
IoCManager.Resolve<IModLoader>().SetModuleBaseCallbacks(new ClientModuleTestingCallbacks
|
|
|
|
|
{
|
|
|
|
|
ClientBeforeIoC = () =>
|
|
|
|
|
{
|
|
|
|
|
IoCManager.Register<IParallaxManager, DummyParallaxManager>(true);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
return base.StartClient(options);
|
|
|
|
|
}
|
2019-08-22 10:21:54 +02:00
|
|
|
|
|
|
|
|
protected override ServerIntegrationInstance StartServer(ServerIntegrationOptions options = null)
|
|
|
|
|
{
|
2020-01-20 22:14:44 +01:00
|
|
|
options ??= new ServerIntegrationOptions();
|
2019-08-22 10:21:54 +02:00
|
|
|
options.ServerContentAssembly = typeof(Server.EntryPoint).Assembly;
|
|
|
|
|
options.SharedContentAssembly = typeof(Shared.EntryPoint).Assembly;
|
|
|
|
|
return base.StartServer(options);
|
|
|
|
|
}
|
2020-01-20 22:14:44 +01:00
|
|
|
|
|
|
|
|
protected ServerIntegrationInstance StartServerDummyTicker(ServerIntegrationOptions options = null)
|
|
|
|
|
{
|
|
|
|
|
options ??= new ServerIntegrationOptions();
|
|
|
|
|
options.BeforeStart += () =>
|
|
|
|
|
{
|
|
|
|
|
IoCManager.Resolve<IModLoader>().SetModuleBaseCallbacks(new ServerModuleTestingCallbacks
|
|
|
|
|
{
|
|
|
|
|
ServerBeforeIoC = () =>
|
|
|
|
|
{
|
|
|
|
|
IoCManager.Register<IGameTicker, DummyGameTicker>(true);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
return StartServer(options);
|
|
|
|
|
}
|
2019-06-29 01:58:16 +02:00
|
|
|
}
|
|
|
|
|
}
|