aboutsummaryrefslogtreecommitdiff
path: root/tests/Jellyfin.Server.Implementations.Tests
diff options
context:
space:
mode:
authorJPVenson <github@jpb.email>2024-10-21 05:27:27 +0200
committerGitHub <noreply@github.com>2024-10-20 21:27:27 -0600
commit88fb668cc564fe18a1b7853b6712564cb94d19e3 (patch)
tree0679d2a57cfc09ce7a34e7baacf82e97c0da763d /tests/Jellyfin.Server.Implementations.Tests
parent5b696124fc24e183aa62e5132cfba640791e210c (diff)
Added Unittest to check for unapplied model changes (#12854)
Diffstat (limited to 'tests/Jellyfin.Server.Implementations.Tests')
-rw-r--r--tests/Jellyfin.Server.Implementations.Tests/EfMigrations/EfMigrationTests.cs18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/Jellyfin.Server.Implementations.Tests/EfMigrations/EfMigrationTests.cs b/tests/Jellyfin.Server.Implementations.Tests/EfMigrations/EfMigrationTests.cs
new file mode 100644
index 000000000..e6ccae183
--- /dev/null
+++ b/tests/Jellyfin.Server.Implementations.Tests/EfMigrations/EfMigrationTests.cs
@@ -0,0 +1,18 @@
+using System;
+using System.Threading.Tasks;
+using Jellyfin.Server.Implementations.Migrations;
+using Microsoft.EntityFrameworkCore;
+using Xunit;
+
+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.");
+ }
+}