namespace Anubis.Tests; /// The suite runs on SQLite and on PostgreSQL (SPEC 16): the engine comes from ANUBIS_TEST_DB. [TestClass] public sealed class TestDatabaseTests { [TestMethod] [TestCategory(Category.Unit)] public void EngineIsSqliteOrPostgres() { Assert.IsTrue(TestDatabase.Engine is "sqlite" or "postgres", $"ANUBIS_TEST_DB non valido: {TestDatabase.Engine}"); } [TestMethod] [TestCategory(Category.Integration)] public async Task PostgresIsReachableWhenSelected() { if (TestDatabase.Engine != "postgres") { Assert.Inconclusive("Giro su SQLite: PostgreSQL non richiesto."); } var (host, port) = TestDatabase.Postgres; Assert.IsTrue( await TestDatabase.PostgresReachableAsync(TimeSpan.FromSeconds(5)).ConfigureAwait(false), $"PostgreSQL non raggiungibile su {host}:{port}."); } }