Files
Oleksandr Bezdieniezhnykh 6b2c2d998e [AZ-577] [AZ-578] [AZ-579] [AZ-580] Implement E2E test batch 2
Adds 26 blackbox tests (FT-P-01..18, FT-N-01..08) covering full AC
matrices for Vehicles/Missions/Waypoints/Health/Errors. Three
spec-vs-code carry-forwards documented in batch_02_report.md and
pinned with [Trait("carry_forward", ...)].

Shared scaffolding: ApiDtos.cs, AssertProblemEnvelopeAsync helper,
Seeds.cs, StubSchema.cs, CascadeF3/F4 fixtures, PostgresStopStart
fixture (gated by COMPOSE_RESTART_ENABLED). Removes the 4 placeholder
Sanity.cs files (now superseded). docker-compose.test.yml gains the
expected_results volume mount + FIXTURE_SQL_DIR for the consumer.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-15 08:28:37 +03:00

35 lines
1.3 KiB
C#

using Azaion.Missions.E2E.Helpers;
namespace Azaion.Missions.E2E.Fixtures;
/// <summary>
/// Loads <c>fixture_cascade_F3.sql</c> into a freshly-reset DB. The fixture
/// builds a full mission cascade chain (1 mission → 2 waypoints → 2 media →
/// 2 annotations → 2 detection rows + 3 map_objects) so a single
/// <c>DELETE /missions/{id}</c> exercises every dependency table.
/// </summary>
/// <remarks>
/// The borrowed-schema tables (media, annotations, detection) must exist
/// before the SQL runs — see <see cref="StubSchema"/>. The fixture is
/// deliberately destructive (TRUNCATE … CASCADE in the reset step) so it
/// must NOT share state with read-path scenarios; tests using it should
/// live in their own xUnit collection.
/// </remarks>
public sealed class CascadeF3Fixture : IDisposable
{
public static readonly Guid VehicleId =
Guid.Parse("11111111-0000-0000-0000-000000000001");
public static readonly Guid MissionId =
Guid.Parse("22222222-0000-0000-0000-000000000001");
public CascadeF3Fixture()
{
DbResetFixture.ResetDatabase(TestEnvironment.DbSideChannel);
StubSchema.EnsureCreated();
Seeds.Apply(FixtureSql.Load("fixture_cascade_F3"));
}
public void Dispose() { /* Next fixture's reset cleans up. */ }
}