mirror of
https://github.com/GeWuYou/GFramework.git
synced 2026-03-22 10:34:30 +08:00
test(rule): 添加上下文感知测试的绑定和清理逻辑
- 在测试设置中添加 GameContext 绑定 - 添加 TearDown 方法用于解绑上下文 - 确保测试后正确清理上下文状态
This commit is contained in:
parent
ee3a087e35
commit
1783245d22
@ -1,5 +1,6 @@
|
||||
using GFramework.Core.Abstractions.architecture;
|
||||
using GFramework.Core.Abstractions.rule;
|
||||
using GFramework.Core.architecture;
|
||||
using GFramework.Core.rule;
|
||||
using GFramework.Core.Tests.architecture;
|
||||
using NUnit.Framework;
|
||||
@ -14,6 +15,13 @@ public class ContextAwareTests
|
||||
{
|
||||
_contextAware = new TestContextAware();
|
||||
_mockContext = new TestArchitectureContext();
|
||||
GameContext.Bind(typeof(TestArchitectureContext), _mockContext);
|
||||
}
|
||||
|
||||
[TearDown]
|
||||
public void TearDown()
|
||||
{
|
||||
GameContext.Unbind(typeof(TestArchitectureContext));
|
||||
}
|
||||
|
||||
private TestContextAware _contextAware = null!;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user