Add test to check that there are no pending database model changes (#25762)

This commit is contained in:
DrSmugleaf
2024-03-01 20:10:49 -08:00
committed by GitHub
parent c38b44ea69
commit 2904ff421a
2 changed files with 17 additions and 1 deletions

View File

@@ -11,7 +11,6 @@ using Robust.Shared.Enums;
using Robust.Shared.Log;
using Robust.Shared.Maths;
using Robust.Shared.Network;
using Robust.Shared.Prototypes;
using Robust.UnitTesting;
namespace Content.IntegrationTests.Tests.Preferences
@@ -119,6 +118,17 @@ namespace Content.IntegrationTests.Tests.Preferences
await pair.CleanReturnAsync();
}
[Test]
public async Task TestNoPendingDatabaseChanges()
{
var pair = await PoolManager.GetServerClient();
var server = pair.Server;
var db = GetDb(server);
Assert.That(async () => await db.HasPendingModelChanges(), Is.False,
"The database has pending model changes. Add a new migration to apply them. See https://learn.microsoft.com/en-us/ef/core/managing-schemas/migrations");
await pair.CleanReturnAsync();
}
private static NetUserId NewUserId()
{
return new(Guid.NewGuid());