Files
tbd-station-14/Content.IntegrationTests/Tests/Atmos/ConstantsTest.cs
DrSmugleaf 4f8fbe2749 Fix parallel tests unreliably failing due to statics in Atmospherics (#1914)
* Fix atmospherics statics unreliably failing parallel tests

* Cache getting atmosphere system
2020-08-25 16:14:26 +02:00

32 lines
860 B
C#

using System;
using System.Linq;
using System.Threading.Tasks;
using Content.Server.GameObjects.EntitySystems;
using Content.Shared.Atmos;
using NUnit.Framework;
namespace Content.IntegrationTests.Tests.Atmos
{
[TestFixture]
[TestOf(typeof(Atmospherics))]
public class ConstantsTest : ContentIntegrationTest
{
[Test]
public async Task TotalGasesTest()
{
var server = StartServerDummyTicker();
await server.WaitIdleAsync();
var atmosSystem = server.ResolveDependency<AtmosphereSystem>();
server.Post(() =>
{
Assert.That(atmosSystem.Gases.Count(), Is.EqualTo(Atmospherics.TotalNumberOfGases));
Assert.That(Enum.GetValues(typeof(Gas)).Length, Is.EqualTo(Atmospherics.TotalNumberOfGases));
});
}
}
}