Add Job preference tests (#28625)
* Misc Job related changes * Add JobTest * A * Aa * Lets not confuse the yaml linter * fixes * a
This commit is contained in:
@@ -7,7 +7,6 @@ using Content.Shared.Preferences;
|
||||
using Content.Shared.Roles;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Log;
|
||||
using Robust.Shared.Map;
|
||||
using Robust.Shared.Network;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Timing;
|
||||
@@ -46,8 +45,6 @@ public sealed class StationJobsTest
|
||||
stationProto: StandardNanotrasenStation
|
||||
components:
|
||||
- type: StationJobs
|
||||
overflowJobs:
|
||||
- Passenger
|
||||
availableJobs:
|
||||
TMime: [0, -1]
|
||||
TAssistant: [-1, -1]
|
||||
@@ -164,7 +161,6 @@ public sealed class StationJobsTest
|
||||
var server = pair.Server;
|
||||
|
||||
var prototypeManager = server.ResolveDependency<IPrototypeManager>();
|
||||
var mapManager = server.ResolveDependency<IMapManager>();
|
||||
var fooStationProto = prototypeManager.Index<GameMapPrototype>("FooStation");
|
||||
var entSysMan = server.ResolveDependency<IEntityManager>().EntitySysManager;
|
||||
var stationJobs = entSysMan.GetEntitySystem<StationJobsSystem>();
|
||||
@@ -215,6 +211,8 @@ public sealed class StationJobsTest
|
||||
var server = pair.Server;
|
||||
|
||||
var prototypeManager = server.ResolveDependency<IPrototypeManager>();
|
||||
var compFact = server.ResolveDependency<IComponentFactory>();
|
||||
var name = compFact.GetComponentName<StationJobsComponent>();
|
||||
|
||||
await server.WaitAssertion(() =>
|
||||
{
|
||||
@@ -233,11 +231,14 @@ public sealed class StationJobsTest
|
||||
{
|
||||
foreach (var (stationId, station) in gameMap.Stations)
|
||||
{
|
||||
if (!station.StationComponentOverrides.TryGetComponent("StationJobs", out var comp))
|
||||
if (!station.StationComponentOverrides.TryGetComponent(name, out var comp))
|
||||
continue;
|
||||
|
||||
foreach (var (job, _) in ((StationJobsComponent) comp).SetupAvailableJobs)
|
||||
foreach (var (job, array) in ((StationJobsComponent) comp).SetupAvailableJobs)
|
||||
{
|
||||
Assert.That(array.Length, Is.EqualTo(2));
|
||||
Assert.That(array[0] is -1 or >= 0);
|
||||
Assert.That(array[1] is -1 or >= 0);
|
||||
Assert.That(invalidJobs, Does.Not.Contain(job), $"Station {stationId} contains job prototype {job} which cannot be present roundstart.");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user