Files
tbd-station-14/Content.IntegrationTests/Tests/StationEvents/StationEventsSystemTest.cs
DrSmugleaf 74943a2770 Typo, redundant string interpolation, namespaces and imports cleanup (#2068)
* Readonly, typos and redundant string interpolations

* Namespaces

* Optimize imports

* Address reviews

* but actually

* Localize missing strings

* Remove redundant vars
2020-09-13 14:23:52 +02:00

43 lines
1.4 KiB
C#

using System.Threading.Tasks;
using Content.Server.GameObjects.EntitySystems.StationEvents;
using NUnit.Framework;
using Robust.Shared.GameObjects.Systems;
using Robust.Shared.Interfaces.Timing;
using Robust.Shared.IoC;
namespace Content.IntegrationTests.Tests.StationEvents
{
[TestFixture]
public class StationEventsSystemTest : ContentIntegrationTest
{
[Test]
public async Task Test()
{
var server = StartServerDummyTicker();
server.Assert(() =>
{
// Idle each event once
var stationEventsSystem = EntitySystem.Get<StationEventSystem>();
var dummyFrameTime = (float) IoCManager.Resolve<IGameTiming>().TickPeriod.TotalSeconds;
foreach (var stationEvent in stationEventsSystem.StationEvents)
{
stationEvent.Startup();
stationEvent.Update(dummyFrameTime);
stationEvent.Shutdown();
Assert.That(stationEvent.Occurrences == 1);
}
stationEventsSystem.ResettingCleanup();
foreach (var stationEvent in stationEventsSystem.StationEvents)
{
Assert.That(stationEvent.Occurrences == 0);
}
});
await server.WaitIdleAsync();
}
}
}