=== Summary: 675 files | 7 generated | 484 fresh | 4605 untracked | 4268 adopted | 355 marked | 466 validated-ok | 2+0 stale (sig+body) | 0 skipped | 0 failed | elapsed 11:08:11.442 (40091.44s) ===
This commit is contained in:
@@ -37,6 +37,7 @@ public class MongodbMigrationTest
|
||||
/// <summary>
|
||||
/// Performs one-time initialization for the test fixture by dropping and recreating the "patients" collection, instantiating the PatientRepository, and seeding it with three test Patient records (one of which has a discharge time set to the current time) to verify they are persisted.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=81c0015 body=4ef5cc4 -->
|
||||
[OneTimeSetUp]
|
||||
public async Task Init()
|
||||
{
|
||||
@@ -102,6 +103,7 @@ public class MongodbMigrationTest
|
||||
/// <summary>
|
||||
/// Performs one-time cleanup after integration tests by dropping the <c>patients</c> and <c>__migrations</c> collections from the integration database, ensuring a clean state for subsequent test runs.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=effc73b body=3589ba1 -->
|
||||
[OneTimeTearDown]
|
||||
public void Teardown()
|
||||
{
|
||||
@@ -112,6 +114,7 @@ public class MongodbMigrationTest
|
||||
/// <summary>
|
||||
/// Verifies that the database is detected as outdated by creating a runner and asserting that <c>IsDatabaseUpToDate</c> returns <c>false</c> when using the primary read preference.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=321f15b body=4973696 -->
|
||||
[Test]
|
||||
[Order(1)]
|
||||
public void IsDatabaseOutdated_ShouldReturnTrue()
|
||||
@@ -127,6 +130,7 @@ public class MongodbMigrationTest
|
||||
/// <summary>
|
||||
/// Verifies that after running the migration update to the latest version, the migration with ID 10 (version 0.1.0) is present among the applied migrations.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=561899c body=96dbaf9 -->
|
||||
[Test]
|
||||
[Order(2)]
|
||||
public void AfterUpdateToLatest_MigrationShouldBeApplied()
|
||||
@@ -159,6 +163,7 @@ public class MongodbMigrationTest
|
||||
/// Creates and configures a <see cref="MigrationRunner"/> for executing database migrations, using a locator that scans the assembly containing the patient data update migration.
|
||||
/// </summary>
|
||||
/// <returns>A configured <see cref="MigrationRunner"/> bound to the integration database and the migrations collection.</returns>
|
||||
/// <!-- aidoc:v1 sig=10bca02 body=74d6fef -->
|
||||
private MigrationRunner CreateRunner()
|
||||
{
|
||||
var locator = new MigrationLocator();
|
||||
@@ -174,6 +179,7 @@ public class MongodbMigrationTest
|
||||
/// Retrieves the identifiers of all applied migrations from the "__migrations" collection in the integration database.
|
||||
/// </summary>
|
||||
/// <returns>A list of migration identifiers extracted from the "_id" field of each migration document.</returns>
|
||||
/// <!-- aidoc:v1 sig=24bca53 body=dc0f87b -->
|
||||
private List<int> GetAppliedMigrationIds()
|
||||
{
|
||||
var collection = IntegrationDb.Database.GetCollection<BsonDocument>("__migrations");
|
||||
|
||||
Reference in New Issue
Block a user