diff --git a/GFramework.Game.Tests/Config/GameConfigBootstrapTests.cs b/GFramework.Game.Tests/Config/GameConfigBootstrapTests.cs index f9875933..1670c9b2 100644 --- a/GFramework.Game.Tests/Config/GameConfigBootstrapTests.cs +++ b/GFramework.Game.Tests/Config/GameConfigBootstrapTests.cs @@ -163,11 +163,11 @@ public class GameConfigBootstrapTests Is.True, "The first initialization attempt did not reach the guarded lifecycle section."); - var secondCallerException = Assert.ThrowsAsync(async () => await bootstrap.InitializeAsync().ConfigureAwait(false)); + var secondCallerException = Assert.ThrowsAsync(() => bootstrap.InitializeAsync()); continueInitialization.Set(); - Assert.DoesNotThrowAsync(async () => await firstInitializeTask.ConfigureAwait(false)); + Assert.DoesNotThrowAsync(() => firstInitializeTask); Assert.Multiple(() => { @@ -202,7 +202,7 @@ public class GameConfigBootstrapTests }) }); - var exception = Assert.ThrowsAsync(async () => await bootstrap.InitializeAsync().ConfigureAwait(false)); + var exception = Assert.ThrowsAsync(() => bootstrap.InitializeAsync()); Assert.Multiple(() => { diff --git a/GFramework.Game.Tests/Config/YamlConfigLoaderDependentRequiredTests.cs b/GFramework.Game.Tests/Config/YamlConfigLoaderDependentRequiredTests.cs index 9c5501a1..3f0ff4c6 100644 --- a/GFramework.Game.Tests/Config/YamlConfigLoaderDependentRequiredTests.cs +++ b/GFramework.Game.Tests/Config/YamlConfigLoaderDependentRequiredTests.cs @@ -75,7 +75,7 @@ public sealed class YamlConfigLoaderDependentRequiredTests var loader = CreateMonsterRewardLoader(); var registry = CreateRegistry(); - var exception = Assert.ThrowsAsync(async () => await loader.LoadAsync(registry).ConfigureAwait(false)); + var exception = Assert.ThrowsAsync(() => loader.LoadAsync(registry)); Assert.Multiple(() => { @@ -217,7 +217,7 @@ public sealed class YamlConfigLoaderDependentRequiredTests var loader = CreateMonsterRewardLoader(); var registry = CreateRegistry(); - var exception = Assert.ThrowsAsync(async () => await loader.LoadAsync(registry).ConfigureAwait(false)); + var exception = Assert.ThrowsAsync(() => loader.LoadAsync(registry)); Assert.Multiple(() => { @@ -267,7 +267,7 @@ public sealed class YamlConfigLoaderDependentRequiredTests var loader = CreateCaseSensitiveRewardLoader(); var registry = CreateRegistry(); - var exception = Assert.ThrowsAsync(async () => await loader.LoadAsync(registry).ConfigureAwait(false)); + var exception = Assert.ThrowsAsync(() => loader.LoadAsync(registry)); Assert.Multiple(() => { @@ -317,7 +317,7 @@ public sealed class YamlConfigLoaderDependentRequiredTests var loader = CreateMonsterRewardLoader(); var registry = CreateRegistry(); - var exception = Assert.ThrowsAsync(async () => await loader.LoadAsync(registry).ConfigureAwait(false)); + var exception = Assert.ThrowsAsync(() => loader.LoadAsync(registry)); Assert.Multiple(() => { diff --git a/GFramework.Game.Tests/Config/YamlConfigTextValidatorTests.cs b/GFramework.Game.Tests/Config/YamlConfigTextValidatorTests.cs index 483617c6..5e9350c6 100644 --- a/GFramework.Game.Tests/Config/YamlConfigTextValidatorTests.cs +++ b/GFramework.Game.Tests/Config/YamlConfigTextValidatorTests.cs @@ -110,7 +110,7 @@ public sealed class YamlConfigTextValidatorTests /// 验证异步入口与同步入口共享相同校验语义。 /// [Test] - public async Task ValidateAsync_Should_Throw_ConfigLoadException_When_Required_Field_Is_Missing() + public void ValidateAsync_Should_Throw_ConfigLoadException_When_Required_Field_Is_Missing() { var schemaPath = CreateSchemaFile( "schemas/monster.schema.json", @@ -125,14 +125,14 @@ public sealed class YamlConfigTextValidatorTests } """); - var exception = Assert.ThrowsAsync(async () => - await YamlConfigTextValidator.ValidateAsync( + var exception = Assert.ThrowsAsync(() => + YamlConfigTextValidator.ValidateAsync( "monster", schemaPath, "monster/generated.yaml", """ id: 1 - """).ConfigureAwait(false)); + """)); Assert.Multiple(() => {