]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Add integration test for MobPriceComponent (#39524)
authorWinkarst-cpu <74284083+Winkarst-cpu@users.noreply.github.com>
Fri, 15 Aug 2025 05:46:27 +0000 (08:46 +0300)
committerGitHub <noreply@github.com>
Fri, 15 Aug 2025 05:46:27 +0000 (22:46 -0700)
Test

Content.IntegrationTests/Tests/CargoTest.cs
Resources/Prototypes/Entities/Clothing/Head/misc.yml

index e5f9fa1e815b191948aefca187f7e672ef9c75ea..5830ea59daad9e93fd8914c8bc2e1802643bdd89 100644 (file)
@@ -5,7 +5,9 @@ using Content.Server.Cargo.Components;
 using Content.Server.Cargo.Systems;
 using Content.Server.Nutrition.Components;
 using Content.Server.Nutrition.EntitySystems;
+using Content.Shared.Body.Components;
 using Content.Shared.Cargo.Prototypes;
+using Content.Shared.Mobs.Components;
 using Content.Shared.Prototypes;
 using Content.Shared.Stacks;
 using Content.Shared.Whitelist;
@@ -250,4 +252,26 @@ public sealed class CargoTest
 
         await pair.CleanReturnAsync();
     }
+
+    [Test]
+    public async Task MobPrice()
+    {
+        await using var pair = await PoolManager.GetServerClient();
+
+        var componentFactory = pair.Server.ResolveDependency<IComponentFactory>();
+
+        await pair.Server.WaitAssertion(() =>
+        {
+            Assert.Multiple(() =>
+            {
+                foreach (var (proto, comp) in pair.GetPrototypesWithComponent<MobPriceComponent>())
+                {
+                    Assert.That(proto.TryGetComponent<BodyComponent>(out _, componentFactory), $"Found MobPriceComponent on {proto.ID}, but no BodyComponent!");
+                    Assert.That(proto.TryGetComponent<MobStateComponent>(out _, componentFactory), $"Found MobPriceComponent on {proto.ID}, but no MobStateComponent!");
+                }
+            });
+        });
+
+        await pair.CleanReturnAsync();
+    }
 }
index 96844d40177d5641f555dddda968efa1aa02e643..da0f17f32486ccb51c994572c591d013c7a846b5 100644 (file)
     sprite: Clothing/Head/Misc/fancycrown.rsi
   - type: TypingIndicatorClothing
     proto: regal
-  - type: MobPrice
+  - type: StaticPrice
     price: 3000
   - type: AddAccentClothing
     accent: MobsterAccent