Skip to content

Commit

Permalink
add test to check for pending model changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Barsonax committed May 9, 2024
1 parent 7b27c21 commit b2acdfc
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions CleanAspCore.Api.Tests/Data/MigrationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,14 @@ public async Task MigrationsUpAndDown_NoErrors2(MigrationScript migration)
upResult.ExitCode.Should().Be(0, $"Error during migration up2: {upResult2.Stderr}");
}

[Test]
public void ModelShouldNotHavePendingModelChanges()
{
using DbContext context = new HrContext();
var hasPendingModelChanges = context.Database.HasPendingModelChanges();
hasPendingModelChanges.Should().BeFalse();
}

[SuppressMessage("CodeQuality", "CA1812:Avoid uninstantiated internal classes")]
private sealed class MigrationTestCases : IEnumerable
{
Expand Down

0 comments on commit b2acdfc

Please sign in to comment.