mirror of
https://github.com/GeWuYou/GFramework.git
synced 2026-05-07 00:39:00 +08:00
test(extensions): 拆分 UnRegisterListExtensionTests 注销列表辅助类型
- 拆分 TestUnRegisterList 到独立文件以消除 MA0048 - 保留测试行为并补充测试替身的 XML 文档说明
This commit is contained in:
parent
843b024718
commit
26ba3d62f6
15
GFramework.Core.Tests/Extensions/TestUnRegisterList.cs
Normal file
15
GFramework.Core.Tests/Extensions/TestUnRegisterList.cs
Normal 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>();
|
||||
}
|
||||
@ -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>();
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user