test(extensions): 拆分 UnRegisterListExtensionTests 注销列表辅助类型

- 拆分 TestUnRegisterList 到独立文件以消除 MA0048

- 保留测试行为并补充测试替身的 XML 文档说明
This commit is contained in:
gewuyou 2026-04-27 19:12:27 +08:00
parent 843b024718
commit 26ba3d62f6
2 changed files with 15 additions and 12 deletions

View File

@ -0,0 +1,15 @@
using System.Collections.Generic;
using GFramework.Core.Abstractions.Events;
namespace GFramework.Core.Tests.Extensions;
/// <summary>
/// 为 <see cref="UnRegisterListExtensionTests" /> 提供可观察的 <see cref="IUnRegisterList" /> 测试替身。
/// </summary>
public class TestUnRegisterList : IUnRegisterList
{
/// <summary>
/// 获取当前测试收集到的注销项列表,供断言扩展方法是否正确追加和清空元素。
/// </summary>
public IList<IUnRegister> UnregisterList { get; } = new List<IUnRegister>();
}

View File

@ -1,4 +1,3 @@
using GFramework.Core.Abstractions.Events;
using GFramework.Core.Events;
using GFramework.Core.Extensions;
using NUnit.Framework;
@ -119,14 +118,3 @@ public class UnRegisterListExtensionTests
Assert.That(callCount, Is.EqualTo(1));
}
}
/// <summary>
/// 测试用的UnRegisterList实现类用于验证扩展方法功能
/// </summary>
public class TestUnRegisterList : IUnRegisterList
{
/// <summary>
/// 获取或设置注销列表
/// </summary>
public IList<IUnRegister> UnregisterList { get; } = new List<IUnRegister>();
}