using Content.IntegrationTests.Fixtures; using NUnit.Framework.Interfaces; namespace Content.IntegrationTests.NUnit.Utilities; public static class ITestExtensions { extension(T test) where T : ITest { /// /// Ensures the given fixture is a , and if not gives a nice error message. /// /// The caller's type, usually an attribute. /// The . /// Thrown when the given test isn't a public void EnsureFixtureIsGameTest(Type callingType, out GameTest gt) { if (test.Fixture is not GameTest gameTest) { throw new NotSupportedException( $"The fixture {test.Fixture?.GetType()} needs to be a GameTest for {callingType.Name} to work."); } gt = gameTest; } } }