using Titano.Core.Localization; using Titano.Testing; namespace Titano.Core.Tests; internal static class TestMain { public static Task Main(string[] args) { // The UI language is process-wide: a test that leaves English outside a serial class races with the English // assertions of the classes running beside it, so it fails at the switch instead of making another one flaky. Loc.CultureChanged += (_, _) => { if (TestContext.Current is { IsSerial: false } test && Loc.Culture.TwoLetterISOLanguageName != "en") throw new AssertionException($"{test.TestName} switched the UI language to '{Loc.Culture.Name}' outside a [Serial] class"); }; return TestRunner.RunAsync(args, typeof(TestMain).Assembly); } }