Skip to content

Commit

Permalink
horror show init test
Browse files Browse the repository at this point in the history
  • Loading branch information
Truoizys committed Jul 14, 2024
1 parent 85e73b7 commit 5553fc0
Showing 1 changed file with 6 additions and 21 deletions.
27 changes: 6 additions & 21 deletions Content.IntegrationTests/Tests/PostMapInitTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,12 @@ public sealed class PostMapInitTest
{
private const bool SkipTestMaps = true;
private const string TestMapsPath = "/Maps/Test/";
await using var pair = await PoolManager.GetServerClient();
var server = pair.Server;
var protoMan = server.ResolveDependency<IPrototypeManager>();
var gameMaps = protoMan.EnumeratePrototypes<GameMapPrototype>().Where(x => !pair.IsTestPrototype(x)).Select(x => x.ID).ToHashSet();

private static readonly string[] NoSpawnMaps =
private static readonly string[] NoSpawnMaps =
{
"CentComm",
"Dart",
Expand Down Expand Up @@ -154,7 +158,7 @@ public async Task NoSavedPostMapInitTest()
await pair.CleanReturnAsync();
}

[Test, TestCaseSource(nameof(GameMaps))]
[Test, TestCaseSource(nameof(gameMaps))]
public async Task GameMapsLoadableTest(string mapProto)
{
await using var pair = await PoolManager.GetServerClient(new PoolSettings
Expand Down Expand Up @@ -298,25 +302,6 @@ private static int GetCountLateSpawn<T>(List<EntityUid> gridUids, IEntityManager
return resultCount;
}

[Test]
public async Task AllMapsTested()
{
await using var pair = await PoolManager.GetServerClient();
var server = pair.Server;
var protoMan = server.ResolveDependency<IPrototypeManager>();

var gameMaps = protoMan.EnumeratePrototypes<GameMapPrototype>()
.Where(x => !pair.IsTestPrototype(x))
.Select(x => x.ID)
.ToHashSet();

Assert.That(gameMaps.Remove(PoolManager.TestMap));

Assert.That(gameMaps, Is.EquivalentTo(GameMaps.ToHashSet()), "Game map prototype missing from test cases.");

await pair.CleanReturnAsync();
}

[Test]
public async Task NonGameMapsLoadableTest()
{
Expand Down

0 comments on commit 5553fc0

Please sign in to comment.