aboutsummaryrefslogtreecommitdiff
path: root/tests/Jellyfin.Server.Implementations.Tests/Item/AlternateVersionQueryTranslationTests.cs
diff options
context:
space:
mode:
authorCody Robibero <cody@robibe.ro>2026-08-22 08:45:42 -0400
committerGitHub <noreply@github.com>2026-08-22 08:45:42 -0400
commit0d4cbb999bbac9920caeeb5cd7174b1dc9758bff (patch)
treeac3b70bb41af69de26d59e71465fc99db42273ed /tests/Jellyfin.Server.Implementations.Tests/Item/AlternateVersionQueryTranslationTests.cs
parentc04f11bd76acd19a1440bbb4351160642a09ef9c (diff)
parent587f06dccc67a6ad67b43cf8889b6b7605950bcf (diff)
Merge pull request #17607 from Shadowghost/optimize-db-helper-memory
Optimize query helper memory
Diffstat (limited to 'tests/Jellyfin.Server.Implementations.Tests/Item/AlternateVersionQueryTranslationTests.cs')
-rw-r--r--tests/Jellyfin.Server.Implementations.Tests/Item/AlternateVersionQueryTranslationTests.cs33
1 files changed, 1 insertions, 32 deletions
diff --git a/tests/Jellyfin.Server.Implementations.Tests/Item/AlternateVersionQueryTranslationTests.cs b/tests/Jellyfin.Server.Implementations.Tests/Item/AlternateVersionQueryTranslationTests.cs
index b7fca74310..2d520f8b8b 100644
--- a/tests/Jellyfin.Server.Implementations.Tests/Item/AlternateVersionQueryTranslationTests.cs
+++ b/tests/Jellyfin.Server.Implementations.Tests/Item/AlternateVersionQueryTranslationTests.cs
@@ -4,11 +4,6 @@ using System;
using System.Linq;
using Jellyfin.Database.Implementations;
using Jellyfin.Database.Implementations.Entities;
-using Jellyfin.Database.Implementations.Locking;
-using Jellyfin.Database.Providers.Sqlite;
-using Microsoft.Data.Sqlite;
-using Microsoft.EntityFrameworkCore;
-using Microsoft.Extensions.Logging.Abstractions;
using Xunit;
namespace Jellyfin.Server.Implementations.Tests.Item;
@@ -18,22 +13,10 @@ namespace Jellyfin.Server.Implementations.Tests.Item;
/// (BaseItemRepository.TranslateQuery) and the DatePlayed ordering (OrderMapper) translate
/// and evaluate correctly on the SQLite provider.
/// </summary>
-public sealed class AlternateVersionQueryTranslationTests : IDisposable
+public sealed class AlternateVersionQueryTranslationTests : SqliteDbTestFixture
{
- private readonly SqliteConnection _connection;
- private readonly DbContextOptions<JellyfinDbContext> _dbOptions;
-
public AlternateVersionQueryTranslationTests()
{
- _connection = new SqliteConnection("Data Source=:memory:");
- _connection.Open();
-
- _dbOptions = new DbContextOptionsBuilder<JellyfinDbContext>()
- .UseSqlite(_connection)
- .Options;
-
- using var ctx = CreateDbContext();
- ctx.Database.EnsureCreated();
}
[Fact]
@@ -220,18 +203,4 @@ public sealed class AlternateVersionQueryTranslationTests : IDisposable
ctx.SaveChanges();
return (user.Id, primary.Id, versionA.Id, versionB.Id);
}
-
- private JellyfinDbContext CreateDbContext()
- {
- return new JellyfinDbContext(
- _dbOptions,
- NullLogger<JellyfinDbContext>.Instance,
- new SqliteDatabaseProvider(null!, NullLogger<SqliteDatabaseProvider>.Instance),
- new NoLockBehavior(NullLogger<NoLockBehavior>.Instance));
- }
-
- public void Dispose()
- {
- _connection.Dispose();
- }
}