Added more UI logic. Added a manga pipeline test.

This commit is contained in:
2025-06-04 02:21:30 -04:00
parent 7dbcdc6169
commit 70513559cb
21 changed files with 264 additions and 73 deletions

View File

@@ -0,0 +1,36 @@
using MangaReader.Core.Data;
using Microsoft.Data.Sqlite;
using Microsoft.EntityFrameworkCore;
namespace MangaReader.Tests.Utilities;
public class TestDbContextFactory : IDisposable
{
private readonly SqliteConnection _connection;
private readonly DbContextOptions<MangaContext> _options;
public TestDbContextFactory()
{
_connection = new SqliteConnection("DataSource=:memory:");
_connection.Open();
_options = new DbContextOptionsBuilder<MangaContext>()
.UseSqlite(_connection)
.EnableSensitiveDataLogging() // Optional: helps with debugging
.Options;
using MangaContext context = new(_options);
context.Database.EnsureCreated();
}
public MangaContext CreateContext()
{
return new MangaContext(_options);
}
public void Dispose()
{
_connection.Close();
_connection.Dispose();
}
}