diff options
| author | JPVenson <github@jpb.email> | 2025-02-02 02:21:34 +0000 |
|---|---|---|
| committer | JPVenson <github@jpb.email> | 2025-02-02 02:21:34 +0000 |
| commit | 61b2ad7f496b6e47ed3646636f57d96916ffbf33 (patch) | |
| tree | a65ad037b37416dac1b9d40d2c9e2df57b1a6800 /tests | |
| parent | 2e5ff6842af11c4e8ba70a6df83e1676ba1bb5e0 (diff) | |
Added missing assembly info and fixed migration tests
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/Jellyfin.Server.Implementations.Tests/EfMigrations/EfMigrationTests.cs | 24 | ||||
| -rw-r--r-- | tests/Jellyfin.Server.Implementations.Tests/Jellyfin.Server.Implementations.Tests.csproj | 3 |
2 files changed, 20 insertions, 7 deletions
diff --git a/tests/Jellyfin.Server.Implementations.Tests/EfMigrations/EfMigrationTests.cs b/tests/Jellyfin.Server.Implementations.Tests/EfMigrations/EfMigrationTests.cs index 54d5d2adf..ab388eca8 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 4f018ba69..84a3951f6 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 @@ <ProjectReference Include="..\..\Emby.Server.Implementations\Emby.Server.Implementations.csproj" /> <ProjectReference Include="..\..\Jellyfin.Server.Implementations\Jellyfin.Server.Implementations.csproj" /> <ProjectReference Include="..\Jellyfin.Server.Integration.Tests\Jellyfin.Server.Integration.Tests.csproj" /> + <ProjectReference Include="..\..\Jellyfin.Database\Jellyfin.Database.Implementations\Jellyfin.Database.Implementations.csproj" /> + <ProjectReference Include="..\..\Jellyfin.Database\Jellyfin.Database.Providers.SqLite\Jellyfin.Database.Providers.SqLite.csproj" /> + <ProjectReference Include="..\..\Jellyfin.Database\Jellyfin.Database.Providers.PgSql\Jellyfin.Database.Providers.PgSql.csproj" /> </ItemGroup> </Project> |
