Skip to content

Commit

Permalink
Add missing awaits in MigrationsInfrastructureTestBase (#35106)
Browse files Browse the repository at this point in the history
  • Loading branch information
roji authored Nov 14, 2024
1 parent dc812a2 commit a3c5677
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -286,21 +286,21 @@ await history.GetAppliedMigrationsAsync(),
}

[ConditionalFact]
public virtual void Can_generate_no_migration_script()
public virtual async Task Can_generate_no_migration_script()
{
using var db = Fixture.CreateEmptyContext();
var migrator = db.GetService<IMigrator>();

SetAndExecuteSqlAsync(migrator.GenerateScript());
await SetAndExecuteSqlAsync(migrator.GenerateScript());
}

[ConditionalFact]
public virtual void Can_generate_migration_from_initial_database_to_initial()
public virtual async Task Can_generate_migration_from_initial_database_to_initial()
{
using var db = Fixture.CreateContext();
var migrator = db.GetService<IMigrator>();

SetAndExecuteSqlAsync(migrator.GenerateScript(fromMigration: Migration.InitialDatabase, toMigration: Migration.InitialDatabase));
await SetAndExecuteSqlAsync(migrator.GenerateScript(fromMigration: Migration.InitialDatabase, toMigration: Migration.InitialDatabase));
}

[ConditionalFact]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ public override void Can_apply_range_of_migrations()
Fixture.TestSqlLoggerFactory.Log.Single(l => l.Id == RelationalEventId.NonTransactionalMigrationOperationWarning).Message);
}

public override void Can_generate_migration_from_initial_database_to_initial()
public override async Task Can_generate_migration_from_initial_database_to_initial()
{
base.Can_generate_migration_from_initial_database_to_initial();
await base.Can_generate_migration_from_initial_database_to_initial();

Assert.Equal(
"""
Expand All @@ -51,9 +51,9 @@ CONSTRAINT [PK___EFMigrationsHistory] PRIMARY KEY ([MigrationId])
ignoreLineEndingDifferences: true);
}

public override void Can_generate_no_migration_script()
public override async Task Can_generate_no_migration_script()
{
base.Can_generate_no_migration_script();
await base.Can_generate_no_migration_script();

Assert.Equal(
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ namespace Microsoft.EntityFrameworkCore.Migrations
public class MigrationsInfrastructureSqliteTest(MigrationsInfrastructureSqliteTest.MigrationsInfrastructureSqliteFixture fixture)
: MigrationsInfrastructureTestBase<MigrationsInfrastructureSqliteTest.MigrationsInfrastructureSqliteFixture>(fixture)
{
public override void Can_generate_migration_from_initial_database_to_initial()
public override async Task Can_generate_migration_from_initial_database_to_initial()
{
base.Can_generate_migration_from_initial_database_to_initial();
await base.Can_generate_migration_from_initial_database_to_initial();

Assert.Equal(
"""
Expand All @@ -29,9 +29,9 @@ public override void Can_generate_migration_from_initial_database_to_initial()
ignoreLineEndingDifferences: true);
}

public override void Can_generate_no_migration_script()
public override async Task Can_generate_no_migration_script()
{
base.Can_generate_no_migration_script();
await base.Can_generate_no_migration_script();

Assert.Equal(
"""
Expand Down

0 comments on commit a3c5677

Please sign in to comment.