Add test of StaminaComponent crit vs animation thresholds (#39249)

Add test of StaminaComponent crit vs animation thresholds
This commit is contained in:
Tayrtahn
2025-08-02 10:33:22 -04:00
committed by GitHub
parent fbed76e067
commit c444db0e58

View File

@@ -0,0 +1,29 @@
using Content.Shared.Damage.Components;
namespace Content.IntegrationTests.Tests.Damageable;
public sealed class StaminaComponentTest
{
[Test]
public async Task ValidatePrototypes()
{
await using var pair = await PoolManager.GetServerClient();
var server = pair.Server;
var protos = pair.GetPrototypesWithComponent<StaminaComponent>();
await server.WaitAssertion(() =>
{
Assert.Multiple(() =>
{
foreach (var (proto, comp) in protos)
{
Assert.That(comp.AnimationThreshold, Is.LessThan(comp.CritThreshold),
$"Animation threshold on {proto.ID} must be less than its crit threshold.");
}
});
});
await pair.CleanReturnAsync();
}
}