Add NukeOps Test (#27207)
* Add NukeOps Test * Update EvacShuttleTest to also check mapinit * Update RuleMaxTimeRestartTest * Fix cvar cleanup * A * Revert some changes * comments * Add MappingTests * Finally fix the test * A
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
#nullable enable
|
||||
using Robust.Shared.Timing;
|
||||
|
||||
namespace Content.IntegrationTests.Pair;
|
||||
|
||||
@@ -19,6 +18,22 @@ public sealed partial class TestPair
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Convert a time interval to some number of ticks.
|
||||
/// </summary>
|
||||
public int SecondsToTicks(float seconds)
|
||||
{
|
||||
return (int) Math.Ceiling(seconds / Server.Timing.TickPeriod.TotalSeconds);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Run the server & client in sync for some amount of time
|
||||
/// </summary>
|
||||
public async Task RunSeconds(float seconds)
|
||||
{
|
||||
await RunTicksSync(SecondsToTicks(seconds));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Runs the server-client pair in sync, but also ensures they are both idle each tick.
|
||||
/// </summary>
|
||||
@@ -59,4 +74,4 @@ public sealed partial class TestPair
|
||||
delta = cTick - sTick;
|
||||
Assert.That(delta, Is.EqualTo(targetDelta));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user