2026-07-27 16:33:06 -03:00
|
|
|
using Data.SeaHavenIndustries;
|
|
|
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
|
|
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
|
|
|
|
|
|
namespace SeaHavenIndustries.Tests;
|
|
|
|
|
|
|
|
|
|
public class WorkOrderMigrationDiscoveryTests
|
|
|
|
|
{
|
|
|
|
|
[Fact]
|
|
|
|
|
public void Phase7_ExternalWorkOrderIdUnique_is_discoverable_by_ef_runtime()
|
|
|
|
|
{
|
|
|
|
|
var options = new DbContextOptionsBuilder<ApplicationDbContext>()
|
|
|
|
|
.UseSqlite("DataSource=:memory:")
|
|
|
|
|
.Options;
|
|
|
|
|
|
|
|
|
|
using var context = new ApplicationDbContext(options);
|
|
|
|
|
var migrations = context.Database.GetMigrations().ToList();
|
|
|
|
|
|
|
|
|
|
Assert.Contains("20260713120000_Phase7_ExternalWorkOrderIdUnique", migrations);
|
|
|
|
|
}
|
2026-08-24 15:14:31 -03:00
|
|
|
|
|
|
|
|
[Fact]
|
|
|
|
|
public void SH117_AvetaRequired_is_discoverable_by_ef_runtime()
|
|
|
|
|
{
|
|
|
|
|
var options = new DbContextOptionsBuilder<ApplicationDbContext>()
|
|
|
|
|
.UseSqlite("DataSource=:memory:")
|
|
|
|
|
.Options;
|
|
|
|
|
|
|
|
|
|
using var context = new ApplicationDbContext(options);
|
|
|
|
|
var migrations = context.Database.GetMigrations().ToList();
|
|
|
|
|
|
|
|
|
|
Assert.Contains("20260824150000_SH117_AvetaRequired", migrations);
|
|
|
|
|
}
|
2026-08-26 10:00:02 -03:00
|
|
|
|
|
|
|
|
[Fact]
|
|
|
|
|
public void SH221_LocationAccountScope_is_discoverable_by_ef_runtime()
|
|
|
|
|
{
|
|
|
|
|
var options = new DbContextOptionsBuilder<ApplicationDbContext>()
|
|
|
|
|
.UseSqlite("DataSource=:memory:")
|
|
|
|
|
.Options;
|
|
|
|
|
|
|
|
|
|
using var context = new ApplicationDbContext(options);
|
|
|
|
|
var migrations = context.Database.GetMigrations().ToList();
|
|
|
|
|
|
|
|
|
|
Assert.Contains("20260826120000_SH221_LocationAccountScope", migrations);
|
|
|
|
|
}
|
2026-09-29 17:58:52 -03:00
|
|
|
|
|
|
|
|
[Fact]
|
|
|
|
|
public void SH411_TechnicianAssigned_is_discoverable_by_ef_runtime()
|
|
|
|
|
{
|
|
|
|
|
var options = new DbContextOptionsBuilder<ApplicationDbContext>()
|
|
|
|
|
.UseSqlite("DataSource=:memory:")
|
|
|
|
|
.Options;
|
|
|
|
|
|
|
|
|
|
using var context = new ApplicationDbContext(options);
|
|
|
|
|
var migrations = context.Database.GetMigrations().ToList();
|
|
|
|
|
|
|
|
|
|
Assert.Contains("20260929210000_SH411WorkOrderTechnicianAssigned", migrations);
|
|
|
|
|
}
|
2026-07-27 16:33:06 -03:00
|
|
|
}
|