Refactor SQLite Database Provider
- Removed unused classes and files related to SQLite database provider, including SqliteDesignTimeJellyfinDbFactory, ModelBuilderExtensions, PragmaConnectionInterceptor, AssemblyInfo, SqliteDatabaseProvider, DateTimeKindValueConverter. - Updated tests to remove dependencies on removed classes and adjusted mocking for configuration sections. - Added Microsoft.EntityFrameworkCore.Sqlite package reference to test project. - Improved string handling in tests for better consistency and clarity. - Refactored logging methods in JellyfinApplicationFactory for better readability and maintainability.
This commit is contained in:
@@ -8,7 +8,6 @@ using System;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Jellyfin.Database.Implementations;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Jellyfin.Database.Implementations.Entities;
|
||||
using Jellyfin.Database.Implementations.Locking;
|
||||
using Jellyfin.Server.Implementations.Item;
|
||||
@@ -116,7 +115,7 @@ public class BaseItemRepositoryTests
|
||||
|
||||
await context.SaveChangesAsync();
|
||||
|
||||
var placeholder = await context.BaseItems.SingleAsync(e => e.Id == BaseItemRepository.PlaceholderId);
|
||||
var placeholder = await context.BaseItems.SingleAsync(e => e.Id.Equals(BaseItemRepository.PlaceholderId));
|
||||
context.BaseItems.Remove(placeholder);
|
||||
await context.SaveChangesAsync();
|
||||
|
||||
@@ -133,11 +132,11 @@ public class BaseItemRepositoryTests
|
||||
await repository.DeleteItemAsync([itemId], CancellationToken.None);
|
||||
|
||||
await using var verificationContext = await dbFactory.CreateDbContextAsync(CancellationToken.None);
|
||||
var recreatedPlaceholder = await verificationContext.BaseItems.SingleOrDefaultAsync(e => e.Id == BaseItemRepository.PlaceholderId);
|
||||
var recreatedPlaceholder = await verificationContext.BaseItems.SingleOrDefaultAsync(e => e.Id.Equals(BaseItemRepository.PlaceholderId));
|
||||
var detachedUserData = await verificationContext.UserData.SingleAsync();
|
||||
|
||||
Assert.NotNull(recreatedPlaceholder);
|
||||
Assert.Null(await verificationContext.BaseItems.SingleOrDefaultAsync(e => e.Id == itemId));
|
||||
Assert.Null(await verificationContext.BaseItems.SingleOrDefaultAsync(e => e.Id.Equals(itemId)));
|
||||
Assert.Equal(BaseItemRepository.PlaceholderId, detachedUserData.ItemId);
|
||||
Assert.NotNull(detachedUserData.RetentionDate);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user