From ca8018f9f9e9b742e3da82bd57fb6ae74b7f7330 Mon Sep 17 00:00:00 2001 From: DrSmugleaf Date: Sat, 12 Sep 2020 15:47:57 +0200 Subject: [PATCH] Make PostMapInitTest ignore test maps instead of those in an array (#2066) --- Content.IntegrationTests/Tests/PostMapInitTest.cs | 11 +++++------ Resources/Maps/{ => Test}/Pathfinding/simple.yml | 0 2 files changed, 5 insertions(+), 6 deletions(-) rename Resources/Maps/{ => Test}/Pathfinding/simple.yml (100%) diff --git a/Content.IntegrationTests/Tests/PostMapInitTest.cs b/Content.IntegrationTests/Tests/PostMapInitTest.cs index e29926951e..feddf591e5 100644 --- a/Content.IntegrationTests/Tests/PostMapInitTest.cs +++ b/Content.IntegrationTests/Tests/PostMapInitTest.cs @@ -11,10 +11,8 @@ namespace Content.IntegrationTests.Tests [TestFixture] public class PostMapInitTest : ContentIntegrationTest { - public readonly string[] SkippedMaps = - { - "/Maps/Pathfinding/simple.yml" - }; + public const bool SkipTestMaps = true; + public const string TestMapsPath = "/Maps/Test/"; [Test] public async Task NoSavedPostMapInitTest() @@ -34,7 +32,8 @@ namespace Content.IntegrationTests.Tests { var rootedPath = map.ToRootedPath(); - if (SkippedMaps.Contains(rootedPath.ToString())) + // ReSharper disable once RedundantLogicalConditionalExpressionOperand + if (SkipTestMaps && rootedPath.ToString().StartsWith(TestMapsPath)) { continue; } @@ -53,7 +52,7 @@ namespace Content.IntegrationTests.Tests var meta = root["meta"]; var postMapInit = meta["postmapinit"].AsBool(); - Assert.False(postMapInit); + Assert.False(postMapInit, $"Map {map.Filename} was saved postmapinit"); } } } diff --git a/Resources/Maps/Pathfinding/simple.yml b/Resources/Maps/Test/Pathfinding/simple.yml similarity index 100% rename from Resources/Maps/Pathfinding/simple.yml rename to Resources/Maps/Test/Pathfinding/simple.yml