Fix build and add tests (#6)
Some checks failed
Build & Test / build (ubuntu-latest) (push) Has been cancelled

This commit is contained in:
metalgearsloth 2026-08-06 22:25:17 +10:00 • committed by GitHub
parent 750039957c
commit 3c4568c59e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 138 additions and 16 deletions

View file

@ -0,0 +1,40 @@
using NUnit.Framework;
using Robust.Client;
using Robust.Shared.IoC;
using Robust.UnitTesting;
using Template.Game;
namespace Template.Tests;
[TestFixture]
public sealed class StartupTest : RobustIntegrationTest
{
[Test]
public async Task GameStartsSingleplayer()
{
var client = StartClient(new ClientIntegrationOptions
{
ContentStart = true,
ContentAssemblies = [typeof(EntryPoint).Assembly],
Options = new GameControllerOptions
{
ContentModulePrefix = "Template.",
ContentBuildDirectory = "Template.Game",
LoadConfigAndUserData = false,
LoadContentResources = false,
},
});
await client.WaitIdleAsync();
Assert.That(client.IsAlive, Is.True);
Assert.That(client.UnhandledException, Is.Null);
await client.WaitAssertion(() =>
{
var baseClient = IoCManager.Resolve<IBaseClient>();
Assert.That(baseClient.RunLevel, Is.EqualTo(ClientRunLevel.SinglePlayerGame));
});
}
}