소스 검색

Added Unittest to check for unapplied model changes (#12854)

JPVenson 7 달 전
부모
커밋
88fb668cc5
1개의 변경된 파일18개의 추가작업 그리고 0개의 파일을 삭제
  1. 18 0
      tests/Jellyfin.Server.Implementations.Tests/EfMigrations/EfMigrationTests.cs

+ 18 - 0
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.");
+    }
+}