Files
crystall-punk-14/Content.IntegrationTests/Tests/Chameleon/ChameleonJobLoadoutTest.cs
Ed b581f5d132 Merge remote-tracking branch 'upstream/stable' into ed-23-06-2025-upstream-sync
# Conflicts:
#	.github/workflows/check-trailing-whitespace.yml
#	Content.IntegrationTests/Tests/Access/AccessReaderTest.cs
#	Content.IntegrationTests/Tests/Chameleon/ChameleonJobLoadoutTest.cs
#	Content.IntegrationTests/Tests/GameRules/NukeOpsTest.cs
#	Content.IntegrationTests/Tests/PostMapInitTest.cs
#	Content.Server/Administration/Systems/AdminVerbSystem.Antags.cs
#	Content.Shared/Light/Components/SunShadowCycleComponent.cs
#	Resources/Prototypes/Damage/modifier_sets.yml
#	Resources/Prototypes/Maps/Pools/default.yml
2025-06-23 16:37:22 +03:00

69 lines
2.0 KiB
C#

using System.Collections.Generic;
using Content.IntegrationTests.Tests.Interaction;
using Content.Shared.Clothing;
using Content.Shared.Implants;
using Content.Shared.Preferences.Loadouts;
using Content.Shared.Roles;
using Robust.Shared.Prototypes;
namespace Content.IntegrationTests.Tests.Chameleon;
/// <summary>
/// Ensures all <see cref="IsProbablyRoundStartJob">"round start jobs"</see> have an associated chameleon loadout.
/// </summary>
public sealed class ChameleonJobLoadoutTest : InteractionTest
{/* //CP14 we dont wanna chameleons, disabled test
private static readonly List<ProtoId<JobPrototype>> JobBlacklist =
[
];
[Test]
public Task CheckAllJobs()
{
var alljobs = ProtoMan.EnumeratePrototypes<JobPrototype>();
// Job -> number of references
Dictionary<ProtoId<JobPrototype>, int> validJobs = new();
// Only add stuff that actually has clothing! We don't want stuff like AI or borgs.
foreach (var job in alljobs)
{
if (!IsProbablyRoundStartJob(job) || JobBlacklist.Contains(job.ID))
continue;
validJobs.Add(job.ID, 0);
}
var chameleons = ProtoMan.EnumeratePrototypes<ChameleonOutfitPrototype>();
foreach (var chameleon in chameleons)
{
if (chameleon.Job == null || !validJobs.ContainsKey(chameleon.Job.Value))
continue;
validJobs[chameleon.Job.Value] += 1;
}
Assert.Multiple(() =>
{
foreach (var job in validJobs)
{
Assert.That(job.Value, Is.Not.Zero,
$"{job.Key} has no chameleonOutfit prototype.");
}
});
return Task.CompletedTask;
}
/// <summary>
/// Best guess at what a "round start" job is.
/// </summary>
private bool IsProbablyRoundStartJob(JobPrototype job)
{
return job.StartingGear != null && ProtoMan.HasIndex<RoleLoadoutPrototype>(LoadoutSystem.GetJobPrototype(job.ID));
}
*/ //CP14 disabled test
}