Fix release mode tag test (#17053)

This commit is contained in:
Leon Friedrich
2023-06-02 12:47:24 +12:00
committed by GitHub
parent c40c2aac72
commit 6434522d66

View File

@@ -119,36 +119,6 @@ namespace Content.IntegrationTests.Tests.Tag
sPrototypeManager.Index<TagPrototype>(UnregisteredTag);
});
// Single
Assert.Throws<DebugAssertException>(() =>
{
tagSystem.HasTag(sTagDummy, UnregisteredTag);
});
Assert.Throws<DebugAssertException>(() =>
{
tagSystem.HasTag(sTagComponent, UnregisteredTag);
});
// Any
Assert.Throws<DebugAssertException>(() =>
{
tagSystem.HasAnyTag(sTagDummy, UnregisteredTag);
});
Assert.Throws<DebugAssertException>(() =>
{
tagSystem.HasAnyTag(sTagComponent, UnregisteredTag);
});
// All
Assert.Throws<DebugAssertException>(() =>
{
tagSystem.HasAllTags(sTagDummy, UnregisteredTag);
});
Assert.Throws<DebugAssertException>(() =>
{
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<DebugAssertException>(() =>
{
tagSystem.HasTag(sTagDummy, UnregisteredTag);
});
Assert.Throws<DebugAssertException>(() =>
{
tagSystem.HasTag(sTagComponent, UnregisteredTag);
});
// Any
Assert.Throws<DebugAssertException>(() =>
{
tagSystem.HasAnyTag(sTagDummy, UnregisteredTag);
});
Assert.Throws<DebugAssertException>(() =>
{
tagSystem.HasAnyTag(sTagComponent, UnregisteredTag);
});
// All
Assert.Throws<DebugAssertException>(() =>
{
tagSystem.HasAllTags(sTagDummy, UnregisteredTag);
});
Assert.Throws<DebugAssertException>(() =>
{
tagSystem.HasAllTags(sTagComponent, UnregisteredTag);
});
});
await pairTracker.CleanReturnAsync();
}