diff --git a/GFramework.Core.Tests/Pool/ObjectPoolTests.cs b/GFramework.Core.Tests/Pool/ObjectPoolTests.cs
index bb7bd360..44ebc909 100644
--- a/GFramework.Core.Tests/Pool/ObjectPoolTests.cs
+++ b/GFramework.Core.Tests/Pool/ObjectPoolTests.cs
@@ -1,5 +1,3 @@
-using GFramework.Core.Abstractions.Pool;
-using GFramework.Core.Pool;
using NUnit.Framework;
namespace GFramework.Core.Tests.Pool;
@@ -285,81 +283,3 @@ public class ObjectPoolTests
Assert.That(_pool.GetActiveCount("key2"), Is.EqualTo(0));
}
}
-
-///
-/// 测试用对象池实现类,继承自AbstractObjectPoolSystem
-///
-public class TestObjectPool : AbstractObjectPoolSystem
-{
- ///
- /// 创建新的池化对象
- ///
- /// 用于标识对象的键
- /// 新创建的TestPoolableObject实例
- protected override TestPoolableObject Create(string key)
- {
- return new TestPoolableObject { PoolKey = key };
- }
-
- ///
- /// 初始化方法,用于对象池初始化时的操作
- ///
- protected override void OnInit()
- {
- }
-}
-
-///
-/// 测试用池化对象类,实现了IPoolableObject接口
-///
-public class TestPoolableObject : IPoolableObject
-{
- ///
- /// 获取或设置对象的池键
- ///
- public string PoolKey { get; set; } = string.Empty;
-
- ///
- /// 获取或设置测试用的整数值
- ///
- public int TestValue { get; set; }
-
- ///
- /// 获取或设置OnAcquire方法是否被调用的标志
- ///
- public bool OnAcquireCalled { get; set; }
-
- ///
- /// 获取或设置OnRelease方法是否被调用的标志
- ///
- public bool OnReleaseCalled { get; set; }
-
- ///
- /// 获取或设置OnPoolDestroy方法是否被调用的标志
- ///
- public bool OnPoolDestroyCalled { get; set; }
-
- ///
- /// 对象被获取时的回调方法
- ///
- public void OnAcquire()
- {
- OnAcquireCalled = true;
- }
-
- ///
- /// 对象被释放时的回调方法
- ///
- public void OnRelease()
- {
- OnReleaseCalled = true;
- }
-
- ///
- /// 对象被销毁时的回调方法
- ///
- public void OnPoolDestroy()
- {
- OnPoolDestroyCalled = true;
- }
-}
\ No newline at end of file
diff --git a/GFramework.Core.Tests/Pool/TestObjectPool.cs b/GFramework.Core.Tests/Pool/TestObjectPool.cs
new file mode 100644
index 00000000..303db8db
--- /dev/null
+++ b/GFramework.Core.Tests/Pool/TestObjectPool.cs
@@ -0,0 +1,27 @@
+using GFramework.Core.Pool;
+
+namespace GFramework.Core.Tests.Pool;
+
+///
+/// 测试用对象池实现类,继承自 ,
+/// 用于验证对象池的获取、释放和统计行为。
+///
+public class TestObjectPool : AbstractObjectPoolSystem
+{
+ ///
+ /// 根据池键创建新的测试对象。
+ ///
+ /// 用于标识对象所属池的键。
+ /// 带有对应 的测试对象实例。
+ protected override TestPoolableObject Create(string key)
+ {
+ return new TestPoolableObject { PoolKey = key };
+ }
+
+ ///
+ /// 执行对象池初始化。
+ ///
+ protected override void OnInit()
+ {
+ }
+}
diff --git a/GFramework.Core.Tests/Pool/TestPoolableObject.cs b/GFramework.Core.Tests/Pool/TestPoolableObject.cs
new file mode 100644
index 00000000..2b1f0750
--- /dev/null
+++ b/GFramework.Core.Tests/Pool/TestPoolableObject.cs
@@ -0,0 +1,58 @@
+using GFramework.Core.Abstractions.Pool;
+
+namespace GFramework.Core.Tests.Pool;
+
+///
+/// 供对象池测试使用的池化对象,记录生命周期回调是否被触发。
+///
+public class TestPoolableObject : IPoolableObject
+{
+ ///
+ /// 获取或设置对象所属的池键。
+ ///
+ public string PoolKey { get; set; } = string.Empty;
+
+ ///
+ /// 获取或设置测试中写入的整数值。
+ ///
+ public int TestValue { get; set; }
+
+ ///
+ /// 获取或设置对象获取回调是否已执行。
+ ///
+ public bool OnAcquireCalled { get; set; }
+
+ ///
+ /// 获取或设置对象释放回调是否已执行。
+ ///
+ public bool OnReleaseCalled { get; set; }
+
+ ///
+ /// 获取或设置对象销毁回调是否已执行。
+ ///
+ public bool OnPoolDestroyCalled { get; set; }
+
+ ///
+ /// 在对象被对象池取出时记录回调执行状态。
+ ///
+ public void OnAcquire()
+ {
+ OnAcquireCalled = true;
+ }
+
+ ///
+ /// 在对象被归还到对象池时记录回调执行状态。
+ ///
+ public void OnRelease()
+ {
+ OnReleaseCalled = true;
+ }
+
+ ///
+ /// 在对象因容量限制或清池而销毁时记录回调执行状态。
+ ///
+ public void OnPoolDestroy()
+ {
+ OnPoolDestroyCalled = true;
+ }
+}