From: DrSmugleaf <10968691+DrSmugleaf@users.noreply.github.com> Date: Tue, 23 Sep 2025 21:52:15 +0000 (-0700) Subject: Fix SpawnAndDeleteEntityCountTest Entities and last assert being incorrect (#40511) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=dddb6163f5c256b2d9b6c38959c2690c89f330cd;p=space-station-14.git Fix SpawnAndDeleteEntityCountTest Entities and last assert being incorrect (#40511) Fix SpawnAndDeleteEntityCountTest last assert being incorrect --- diff --git a/Content.IntegrationTests/Tests/EntityTest.cs b/Content.IntegrationTests/Tests/EntityTest.cs index 1222096e01..9b0e7729f5 100644 --- a/Content.IntegrationTests/Tests/EntityTest.cs +++ b/Content.IntegrationTests/Tests/EntityTest.cs @@ -271,7 +271,7 @@ namespace Content.IntegrationTests.Tests // We consider only non-audio entities, as some entities will just play sounds when they spawn. int Count(IEntityManager ent) => ent.EntityCount - ent.Count(); - IEnumerable Entities(IEntityManager entMan) => entMan.GetEntities().Where(entMan.HasComponent); + IEnumerable Entities(IEntityManager entMan) => entMan.GetEntities().Where(e => !entMan.HasComponent(e)); await Assert.MultipleAsync(async () => { @@ -311,8 +311,8 @@ namespace Content.IntegrationTests.Tests // Check that the number of entities has gone back to the original value. Assert.That(Count(server.EntMan), Is.EqualTo(count), $"Server prototype {protoId} failed on deletion: count didn't reset properly\n" + BuildDiffString(serverEntities, Entities(server.EntMan), server.EntMan)); - Assert.That(client.EntMan.EntityCount, Is.EqualTo(clientCount), $"Client prototype {protoId} failed on deletion: count didn't reset properly:\n" + - $"Expected {clientCount} and found {client.EntMan.EntityCount}.\n" + + Assert.That(Count(client.EntMan), Is.EqualTo(clientCount), $"Client prototype {protoId} failed on deletion: count didn't reset properly:\n" + + $"Expected {clientCount} and found {Count(client.EntMan)}.\n" + $"Server count was {count}.\n" + BuildDiffString(clientEntities, Entities(client.EntMan), client.EntMan)); }