using Microsoft.EntityFrameworkCore; using ZB.MOM.WW.ScadaBridge.Commons.Types.Templates; using ZB.MOM.WW.ScadaBridge.Commons.Entities.Templates; using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Repositories; namespace ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests; /// /// Gitea #89: reads only a template's /// inheritance chain — fully included like , /// tracked or not on request — instead of the whole library. Asserted against real SQL on SQLite /// with the reader commands recorded. /// public class TemplateChainRepositoryTests : IDisposable { private const int UnrelatedTemplates = 40; private const string Body = "/* script body the resolver projects */"; 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 TemplateChainRepositoryTests() { _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