using Microsoft.EntityFrameworkCore; using ZB.MOM.WW.ScadaBridge.Commons.Entities.Templates; using ZB.MOM.WW.ScadaBridge.Commons.Types.Templates; using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Repositories; namespace ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests; /// /// Gitea #86: reads only a /// template's derived subtree + inheritance chain — tracked and fully included, the same shape as /// — instead of the whole library. /// Asserted against real SQL on SQLite with the reader commands recorded. /// public class TemplateReconcileClosureRepositoryTests : IDisposable { private const int UnrelatedTemplates = 40; private const string Body = "/* script body the reconcile compares and copies */"; private readonly SqlReaderCommandRecorder _recorder = new(); private readonly ScadaBridgeDbContext _context; private readonly TemplateEngineRepository _repository; /// Initializes the test class with an in-memory context and repository. public TemplateReconcileClosureRepositoryTests() { _context = SqliteTestHelper.CreateInMemoryContext(_recorder); _repository = new TemplateEngineRepository(_context, new TemplateGraphWatermark()); } /// Releases the resources held by this test class. public void Dispose() { _context.Database.CloseConnection(); _context.Dispose(); } private async Task