* Mega Antag Refactor * last minute delta save * more workshopping * more shit * ok tested this for once * okkkkk sure * generic delays for starting rules * well darn * nukies partially * ouagh * ballin' faded and smonkin wed * obliterated the diff * Spread my arms and soak up congratulations * I've got plenty of love, but nothing to show for it * but there’s too much sunlight Shining on my laptop monitor, so I Can’t see anything with any amount of clarity * ok this junk * OOK! * fubar * most of sloth's review * oh boy * eek * hell yea! * ASDFJASDJFvsakcvjkzjnhhhyh
45 lines
1.4 KiB
C#
45 lines
1.4 KiB
C#
using System.Linq;
|
|
using Content.Server.GameTicking;
|
|
using Robust.Shared.GameObjects;
|
|
|
|
namespace Content.IntegrationTests.Tests.GameRules;
|
|
|
|
[TestFixture]
|
|
public sealed class SecretStartsTest
|
|
{
|
|
/// <summary>
|
|
/// Tests that when secret is started, all of the game rules it successfully adds are also started.
|
|
/// </summary>
|
|
[Test]
|
|
public async Task TestSecretStarts()
|
|
{
|
|
await using var pair = await PoolManager.GetServerClient(new PoolSettings { Dirty = true });
|
|
|
|
var server = pair.Server;
|
|
await server.WaitIdleAsync();
|
|
var entMan = server.ResolveDependency<IEntityManager>();
|
|
var gameTicker = server.ResolveDependency<IEntitySystemManager>().GetEntitySystem<GameTicker>();
|
|
|
|
await server.WaitAssertion(() =>
|
|
{
|
|
// this mimics roundflow:
|
|
// rules added, then round starts
|
|
gameTicker.AddGameRule("Secret");
|
|
gameTicker.StartGamePresetRules();
|
|
});
|
|
|
|
// Wait three ticks for any random update loops that might happen
|
|
await server.WaitRunTicks(3);
|
|
|
|
await server.WaitAssertion(() =>
|
|
{
|
|
Assert.That(gameTicker.GetAddedGameRules().Count(), Is.GreaterThan(1), $"No additional rules started by secret rule.");
|
|
|
|
// End all rules
|
|
gameTicker.ClearGameRules();
|
|
});
|
|
|
|
await pair.CleanReturnAsync();
|
|
}
|
|
}
|