Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .codacy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
exclude_paths:
- "HealthMonitoring/Migrations/**"
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
using HealthMonitoring.Persistence;
using Microsoft.EntityFrameworkCore;

namespace HealthMonitoring.Tests.Persistence;

public sealed class HealthMonitoringMigrationsTests
{
[Fact]
public void Health_monitoring_context_has_an_EF_migration()
{
var options = new DbContextOptionsBuilder<HealthMonitoringDbContext>()
.UseSqlServer("Server=(localdb)\\MSSQLLocalDB;Database=HealthMonitoringTest;")
.Options;

using var context = new HealthMonitoringDbContext(options);

Assert.NotEmpty(context.Database.GetMigrations());
}
}
2 changes: 1 addition & 1 deletion HealthMonitoring.Tests/Persistence/RepositoryTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ private SqlServerTestDatabase(HealthMonitoringDbContext context)
.UseSqlServer(connectionString)
.Options;
var context = new HealthMonitoringDbContext(options);
await context.Database.EnsureCreatedAsync();
await context.Database.MigrateAsync();
return new SqlServerTestDatabase(context);
}

Expand Down
320 changes: 320 additions & 0 deletions HealthMonitoring/Migrations/20260919092909_InitialCreate.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading