mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-02-14 19:29:36 +01:00
Robust.UnitTesting was both ALL tests for RT, and also API surface for content tests. Tests are now split into separate projects as appropriate, and the API side has also been split off.
43 lines
1.3 KiB
C#
43 lines
1.3 KiB
C#
using System;
|
|
using Robust.Client;
|
|
using Robust.Server;
|
|
using Robust.Shared.ContentPack;
|
|
using Robust.Shared.IoC;
|
|
using Robust.Shared.Testing;
|
|
|
|
namespace Robust.UnitTesting
|
|
{
|
|
public partial class RobustUnitTest
|
|
{
|
|
/// <summary>
|
|
/// Registers all the types into the <see cref="IoCManager"/> with <see cref="IoCManager.Register{TInterface, TImplementation}"/>
|
|
/// </summary>
|
|
private void RegisterIoC()
|
|
{
|
|
var dependencies = IoCManager.Instance!;
|
|
|
|
switch (Project)
|
|
{
|
|
case UnitTestProject.Client:
|
|
ClientIoC.RegisterIoC(GameController.DisplayMode.Headless, dependencies);
|
|
break;
|
|
|
|
case UnitTestProject.Server:
|
|
ServerIoC.RegisterIoC(dependencies);
|
|
break;
|
|
|
|
default:
|
|
throw new NotSupportedException($"Unknown testing project: {Project}");
|
|
}
|
|
|
|
dependencies.Register<IModLoader, TestingModLoader>(overwrite: true);
|
|
dependencies.Register<IModLoaderInternal, TestingModLoader>(overwrite: true);
|
|
dependencies.Register<TestingModLoader, TestingModLoader>(overwrite: true);
|
|
|
|
OverrideIoC();
|
|
|
|
dependencies.BuildGraph();
|
|
}
|
|
}
|
|
}
|