diff --git a/Content.IntegrationTests/Tests/Nyanotrasen/Metempsychosis/MetempsychosisTest.cs b/Content.IntegrationTests/Tests/Nyanotrasen/Metempsychosis/MetempsychosisTest.cs index d2091a4404b..cd6a4b4c2b9 100644 --- a/Content.IntegrationTests/Tests/Nyanotrasen/Metempsychosis/MetempsychosisTest.cs +++ b/Content.IntegrationTests/Tests/Nyanotrasen/Metempsychosis/MetempsychosisTest.cs @@ -1,8 +1,6 @@ -using System.Linq; using Content.Server.Nyanotrasen.Cloning; +using Content.Shared.Humanoid.Prototypes; using Content.Shared.Random; -using Robust.Shared.GameObjects; -using Robust.Shared.Map; using Robust.Shared.Prototypes; namespace Content.IntegrationTests.Tests.DeltaV; @@ -11,8 +9,6 @@ namespace Content.IntegrationTests.Tests.DeltaV; [TestOf(typeof(MetempsychoticMachineSystem))] public sealed class MetempsychosisTest { - private readonly IPrototypeManager _prototypeManager = default!; - [Test] public async Task AllHumanoidPoolSpeciesExist() { @@ -21,47 +17,36 @@ public async Task AllHumanoidPoolSpeciesExist() // Per RobustIntegrationTest.cs, wait until state is settled to access it. await server.WaitIdleAsync(); - var mapManager = server.ResolveDependency(); var prototypeManager = server.ResolveDependency(); - var entityManager = server.ResolveDependency(); - var entitySystemManager = server.ResolveDependency(); - var metemSystem = entitySystemManager.GetEntitySystem(); var metemComponent = new MetempsychoticMachineComponent(); - var testMap = await pair.CreateTestMap(); - await server.WaitAssertion(() => { - _prototypeManager.TryIndex(metemComponent.MetempsychoticHumanoidPool, out var humanoidPool); - _prototypeManager.TryIndex(metemComponent.MetempsychoticNonHumanoidPool, out var nonHumanoidPool); + prototypeManager.TryIndex(metemComponent.MetempsychoticHumanoidPool, + out var humanoidPool); + prototypeManager.TryIndex(metemComponent.MetempsychoticNonHumanoidPool, + out var nonHumanoidPool); - var coordinates = testMap.GridCoords; + Assert.That(humanoidPool, Is.Not.Null, "MetempsychoticHumanoidPool is null!"); + Assert.That(nonHumanoidPool, Is.Not.Null, "MetempsychoticNonHumanoidPool is null!"); - Assert.That(humanoidPool.Weights.Any(), "MetempsychoticHumanoidPool has no valid prototypes!"); - Assert.That(nonHumanoidPool.Weights.Any(), "MetempsychoticNonHumanoidPool has no valid prototypes!"); + Assert.That(humanoidPool.Weights, Is.Not.Empty, + "MetempsychoticHumanoidPool has no valid prototypes!"); + Assert.That(nonHumanoidPool.Weights, Is.Not.Empty, + "MetempsychoticNonHumanoidPool has no valid prototypes!"); - foreach (var (key, weight) in humanoidPool.Weights) + foreach (var key in humanoidPool.Weights.Keys) { - Assert.That(prototypeManager.TryIndex(key, out var _), + Assert.That(prototypeManager.TryIndex(key, out _), $"MetempsychoticHumanoidPool has invalid prototype {key}!"); - - var spawned = entityManager.SpawnEntity(key, coordinates); } - foreach (var (key, weight) in nonHumanoidPool.Weights) + foreach (var key in nonHumanoidPool.Weights.Keys) { - Assert.That(prototypeManager.TryIndex(key, out var _), + Assert.That(prototypeManager.TryIndex(key, out _), $"MetempsychoticNonHumanoidPool has invalid prototype {key}!"); - - var spawned = entityManager.SpawnEntity(key, coordinates); } - - // Because Server/Client pairs can be re-used between Tests, we - // need to clean up anything that might affect other tests, - // otherwise this pair cannot be considered clean, and the - // CleanReturnAsync call would need to be removed. - mapManager.DeleteMap(testMap.MapId); }); await pair.CleanReturnAsync(); }