Basic Metadata Polish (#3548)
This commit is contained in:
parent
c0b59d87a4
commit
4c44dbf3e2
20 changed files with 3596 additions and 467 deletions
|
|
@ -26,6 +26,7 @@ public abstract class AbstractDbTest : IDisposable
|
|||
protected readonly DbConnection _connection;
|
||||
protected readonly DataContext _context;
|
||||
protected readonly IUnitOfWork _unitOfWork;
|
||||
protected readonly IMapper _mapper;
|
||||
|
||||
|
||||
protected const string CacheDirectory = "C:/kavita/config/cache/";
|
||||
|
|
@ -42,6 +43,7 @@ public abstract class AbstractDbTest : IDisposable
|
|||
{
|
||||
var contextOptions = new DbContextOptionsBuilder<DataContext>()
|
||||
.UseSqlite(CreateInMemoryDatabase())
|
||||
.EnableSensitiveDataLogging()
|
||||
.Options;
|
||||
|
||||
_connection = RelationalOptionsExtension.Extract(contextOptions).Connection;
|
||||
|
|
@ -53,10 +55,10 @@ public abstract class AbstractDbTest : IDisposable
|
|||
Task.Run(SeedDb).GetAwaiter().GetResult();
|
||||
|
||||
var config = new MapperConfiguration(cfg => cfg.AddProfile<AutoMapperProfiles>());
|
||||
var mapper = config.CreateMapper();
|
||||
_mapper = config.CreateMapper();
|
||||
|
||||
GlobalConfiguration.Configuration.UseInMemoryStorage();
|
||||
_unitOfWork = new UnitOfWork(_context, mapper, null);
|
||||
_unitOfWork = new UnitOfWork(_context, _mapper, null);
|
||||
}
|
||||
|
||||
private static DbConnection CreateInMemoryDatabase()
|
||||
|
|
@ -92,6 +94,7 @@ public abstract class AbstractDbTest : IDisposable
|
|||
|
||||
|
||||
_context.Library.Add(new LibraryBuilder("Manga")
|
||||
.WithAllowMetadataMatching(true)
|
||||
.WithFolderPath(new FolderPathBuilder(DataDirectory).Build())
|
||||
.Build());
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue