From 61b2ad7f496b6e47ed3646636f57d96916ffbf33 Mon Sep 17 00:00:00 2001 From: JPVenson Date: Sun, 2 Feb 2025 02:21:34 +0000 Subject: Added missing assembly info and fixed migration tests --- .../EfMigrations/EfMigrationTests.cs | 24 +++++++++++++++------- .../Jellyfin.Server.Implementations.Tests.csproj | 3 +++ 2 files changed, 20 insertions(+), 7 deletions(-) (limited to 'tests') diff --git a/tests/Jellyfin.Server.Implementations.Tests/EfMigrations/EfMigrationTests.cs b/tests/Jellyfin.Server.Implementations.Tests/EfMigrations/EfMigrationTests.cs index 54d5d2adf8..ab388eca86 100644 --- a/tests/Jellyfin.Server.Implementations.Tests/EfMigrations/EfMigrationTests.cs +++ b/tests/Jellyfin.Server.Implementations.Tests/EfMigrations/EfMigrationTests.cs @@ -1,5 +1,7 @@ using System; using System.Threading.Tasks; +using Jellyfin.Database.Providers.PgSql; +using Jellyfin.Server.Implementations.Migrations; using Microsoft.EntityFrameworkCore; using Xunit; @@ -7,11 +9,19 @@ namespace Jellyfin.Server.Implementations.Tests.EfMigrations; public class EfMigrationTests { - // [Fact] - // public void CheckForUnappliedMigrations() - // { - // var dbDesignContext = new DesignTimeJellyfinDbFactory(); - // var context = dbDesignContext.CreateDbContext([]); - // Assert.False(context.Database.HasPendingModelChanges(), "There are unapplied changes to the EfCore model. Please create a Migration."); - // } + [Fact] + public void CheckForUnappliedMigrations_PgSQL() + { + var dbDesignContext = new PgSqlDesignTimeJellyfinDbFactory(); + var context = dbDesignContext.CreateDbContext([]); + Assert.False(context.Database.HasPendingModelChanges(), "There are unapplied changes to the EfCore model for PgSQL. Please create a Migration."); + } + + [Fact] + public void CheckForUnappliedMigrations_SqLite() + { + var dbDesignContext = new SqliteDesignTimeJellyfinDbFactory(); + var context = dbDesignContext.CreateDbContext([]); + Assert.False(context.Database.HasPendingModelChanges(), "There are unapplied changes to the EfCore model for PgSQL. Please create a Migration."); + } } diff --git a/tests/Jellyfin.Server.Implementations.Tests/Jellyfin.Server.Implementations.Tests.csproj b/tests/Jellyfin.Server.Implementations.Tests/Jellyfin.Server.Implementations.Tests.csproj index 4f018ba694..84a3951f67 100644 --- a/tests/Jellyfin.Server.Implementations.Tests/Jellyfin.Server.Implementations.Tests.csproj +++ b/tests/Jellyfin.Server.Implementations.Tests/Jellyfin.Server.Implementations.Tests.csproj @@ -29,6 +29,9 @@ + + + -- cgit v1.2.3