Skip to content

Commit f7fd64e

Browse files
committed
Remove .Wait() calls from tests
Remove unnecessary async keywords Postfix methods returning a Task with "Async" Fixes #5308
1 parent 66d135f commit f7fd64e

File tree

47 files changed

+7869
-7658
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+7869
-7658
lines changed

src/EFCore.Relational.Specification.Tests/MigrationsTestBase.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ public virtual async Task Can_execute_operations()
286286
}
287287
}
288288

289-
protected virtual async Task ExecuteAsync(IServiceProvider services, Action<MigrationBuilder> buildMigration)
289+
protected virtual Task ExecuteAsync(IServiceProvider services, Action<MigrationBuilder> buildMigration)
290290
{
291291
var generator = services.GetRequiredService<IMigrationsSqlGenerator>();
292292
var executor = services.GetRequiredService<IMigrationCommandExecutor>();
@@ -299,7 +299,7 @@ protected virtual async Task ExecuteAsync(IServiceProvider services, Action<Migr
299299

300300
var commandList = generator.Generate(operations);
301301

302-
await executor.ExecuteNonQueryAsync(commandList, connection);
302+
return executor.ExecuteNonQueryAsync(commandList, connection);
303303
}
304304

305305
protected virtual void BuildFirstMigration(MigrationBuilder migrationBuilder)

src/EFCore.Specification.Tests/PropertyValuesTestBase.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1960,15 +1960,15 @@ private async Task NonGeneric_GetDatabaseValues_for_entity_not_in_the_store_retu
19601960
}
19611961

19621962
[Fact]
1963-
public virtual async Task GetDatabaseValues_for_derived_entity_not_in_the_store_returns_null()
1963+
public virtual Task GetDatabaseValues_for_derived_entity_not_in_the_store_returns_null()
19641964
{
1965-
await GetDatabaseValues_for_derived_entity_not_in_the_store_returns_null_implementation(e => Task.FromResult(e.GetDatabaseValues()));
1965+
return GetDatabaseValues_for_derived_entity_not_in_the_store_returns_null_implementation(e => Task.FromResult(e.GetDatabaseValues()));
19661966
}
19671967

19681968
[Fact]
1969-
public virtual async Task GetDatabaseValuesAsync_for_derived_entity_not_in_the_store_returns_null()
1969+
public virtual Task GetDatabaseValuesAsync_for_derived_entity_not_in_the_store_returns_null()
19701970
{
1971-
await GetDatabaseValues_for_derived_entity_not_in_the_store_returns_null_implementation(e => e.GetDatabaseValuesAsync());
1971+
return GetDatabaseValues_for_derived_entity_not_in_the_store_returns_null_implementation(e => e.GetDatabaseValuesAsync());
19721972
}
19731973

19741974
private async Task GetDatabaseValues_for_derived_entity_not_in_the_store_returns_null_implementation(

0 commit comments

Comments
 (0)