gewuyou 3843e5c1dd test(pool): 拆分 ObjectPoolTests 池化辅助类型
- 拆分 TestObjectPool 与 TestPoolableObject 到 Pool 同目录独立文件

- 保留并补充对象池测试辅助类型的 XML 文档与命名空间一致性

- 验证 GFramework.Core.Tests Release 构建通过且当前切片无新增 warning
2026-04-27 19:07:30 +08:00

28 lines
860 B
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using GFramework.Core.Pool;
namespace GFramework.Core.Tests.Pool;
/// <summary>
/// 测试用对象池实现类,继承自 <see cref="AbstractObjectPoolSystem{TKey,TValue}" />
/// 用于验证对象池的获取、释放和统计行为。
/// </summary>
public class TestObjectPool : AbstractObjectPoolSystem<string, TestPoolableObject>
{
/// <summary>
/// 根据池键创建新的测试对象。
/// </summary>
/// <param name="key">用于标识对象所属池的键。</param>
/// <returns>带有对应 <paramref name="key" /> 的测试对象实例。</returns>
protected override TestPoolableObject Create(string key)
{
return new TestPoolableObject { PoolKey = key };
}
/// <summary>
/// 执行对象池初始化。
/// </summary>
protected override void OnInit()
{
}
}