GFramework/GFramework.Core.Tests/Query/TestAsyncQueryWithException.cs
gewuyou f0a36de07c test(core-tests): 批量拆分测试辅助类型以消减警告
- 拆分 GFramework.Core.Tests 中多组测试辅助类型到独立文件以消减 MA0048 warning

- 更新 analyzer-warning-reduction 的 tracking 与 trace 以记录批处理基线和下一恢复点

- 验证 GFramework.Core.Tests Release 构建清零并将仓库根权威 warning 基线压降到 288
2026-04-27 19:44:07 +08:00

29 lines
1.0 KiB
C#

using GFramework.Core.Query;
namespace GFramework.Core.Tests.Query;
/// <summary>
/// 为 <see cref="AsyncQueryExecutorTests" /> 提供固定抛出异常的测试异步查询。
/// </summary>
public sealed class TestAsyncQueryWithException : AbstractAsyncQuery<TestAsyncQueryInput, int>
{
/// <summary>
/// 初始化 <see cref="TestAsyncQueryWithException" /> 的新实例。
/// </summary>
/// <param name="input">查询输入参数。</param>
public TestAsyncQueryWithException(TestAsyncQueryInput input) : base(input)
{
}
/// <summary>
/// 执行异步查询并始终抛出测试异常。
/// </summary>
/// <param name="input">查询输入参数。</param>
/// <returns>此方法不会返回结果。</returns>
/// <exception cref="InvalidOperationException">始终抛出,模拟查询执行失败。</exception>
protected override Task<int> OnDoAsync(TestAsyncQueryInput input)
{
throw new InvalidOperationException("Test exception");
}
}