]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Add test of `StaminaComponent` crit vs animation thresholds (#39249)
authorTayrtahn <tayrtahn@gmail.com>
Sat, 2 Aug 2025 14:33:22 +0000 (10:33 -0400)
committerGitHub <noreply@github.com>
Sat, 2 Aug 2025 14:33:22 +0000 (16:33 +0200)
Add test of StaminaComponent crit vs animation thresholds

Content.IntegrationTests/Tests/Damageable/StaminaComponentTest.cs [new file with mode: 0644]

diff --git a/Content.IntegrationTests/Tests/Damageable/StaminaComponentTest.cs b/Content.IntegrationTests/Tests/Damageable/StaminaComponentTest.cs
new file mode 100644 (file)
index 0000000..f0a594d
--- /dev/null
@@ -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();
+    }
+}