From 6434522d66573c07a6c0f35ee42a8fc830fedc75 Mon Sep 17 00:00:00 2001 From: Leon Friedrich <60421075+ElectroJr@users.noreply.github.com> Date: Fri, 2 Jun 2023 12:47:24 +1200 Subject: [PATCH] Fix release mode tag test (#17053) --- Content.IntegrationTests/Tests/Tag/TagTest.cs | 64 ++++++++++--------- 1 file changed, 34 insertions(+), 30 deletions(-) diff --git a/Content.IntegrationTests/Tests/Tag/TagTest.cs b/Content.IntegrationTests/Tests/Tag/TagTest.cs index 0fa425dfef..1b9c313093 100644 --- a/Content.IntegrationTests/Tests/Tag/TagTest.cs +++ b/Content.IntegrationTests/Tests/Tag/TagTest.cs @@ -119,36 +119,6 @@ namespace Content.IntegrationTests.Tests.Tag sPrototypeManager.Index(UnregisteredTag); }); - // Single - Assert.Throws(() => - { - tagSystem.HasTag(sTagDummy, UnregisteredTag); - }); - Assert.Throws(() => - { - tagSystem.HasTag(sTagComponent, UnregisteredTag); - }); - - // Any - Assert.Throws(() => - { - tagSystem.HasAnyTag(sTagDummy, UnregisteredTag); - }); - Assert.Throws(() => - { - tagSystem.HasAnyTag(sTagComponent, UnregisteredTag); - }); - - // All - Assert.Throws(() => - { - tagSystem.HasAllTags(sTagDummy, UnregisteredTag); - }); - Assert.Throws(() => - { - tagSystem.HasAllTags(sTagComponent, UnregisteredTag); - }); - // Cannot add the starting tag again Assert.That(tagSystem.AddTag(sTagComponent, StartingTag), Is.False); Assert.That(tagSystem.AddTags(sTagComponent, StartingTag, StartingTag), Is.False); @@ -215,6 +185,40 @@ namespace Content.IntegrationTests.Tests.Tag // No tags left in the component Assert.That(sTagComponent.Tags, Is.Empty); + + #if !DEBUG + return; + #endif + + // Single + Assert.Throws(() => + { + tagSystem.HasTag(sTagDummy, UnregisteredTag); + }); + Assert.Throws(() => + { + tagSystem.HasTag(sTagComponent, UnregisteredTag); + }); + + // Any + Assert.Throws(() => + { + tagSystem.HasAnyTag(sTagDummy, UnregisteredTag); + }); + Assert.Throws(() => + { + tagSystem.HasAnyTag(sTagComponent, UnregisteredTag); + }); + + // All + Assert.Throws(() => + { + tagSystem.HasAllTags(sTagDummy, UnregisteredTag); + }); + Assert.Throws(() => + { + tagSystem.HasAllTags(sTagComponent, UnregisteredTag); + }); }); await pairTracker.CleanReturnAsync(); }