Files
Anubis/tests/Anubis.Tests/TestDatabaseTests.cs
T
Alby96andClaude Opus 5.5 b4bf864f74
ci / test (postgres) (push) Successful in 1m18s
ci / test (sqlite) (push) Successful in 1m23s
ci / image (push) Successful in 41s
Set up phase 0: .NET 10 solution, toolchain, minimal app, Docker and CI
Empty but complete solution so every later phase starts from a working
toolchain: analyzers as errors, locked restore, format check, policy tests
that keep packages within ADR 0004 and keep live trading switched off,
a /health endpoint served from Docker, and a Gitea workflow with only
run steps. API facts of SPEC section 4 re-checked in docs/API-NOTES.md;
ADR 0006 records what changed (MSTest base packages, Ubuntu images,
OKX WebSocket on 443, Alpaca margin-only accounts).

refs #1 refs #2 refs #3 refs #4 refs #5

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 09:51:41 +01:00

29 lines
935 B
C#

namespace Anubis.Tests;
/// <summary>The suite runs on SQLite and on PostgreSQL (SPEC 16): the engine comes from ANUBIS_TEST_DB.</summary>
[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}.");
}
}