mirror of
https://github.com/GeWuYou/GFramework.git
synced 2026-03-22 10:34:30 +08:00
test(state): 更新状态机上下文获取测试验证逻辑
- 将断言修改为验证 GetContext 方法抛出 InvalidOperationException 异常 - 在状态机初始化前验证状态上下文为空的预期行为 - 保持初始化后状态上下文正确设置的验证逻辑
This commit is contained in:
parent
703328deb2
commit
7e2a1ff66d
@ -111,8 +111,8 @@ public class StateMachineSystemTests
|
||||
_stateMachine!.Register(state1);
|
||||
_stateMachine.Register(state2);
|
||||
|
||||
Assert.That(state1.GetContext(), Is.Null);
|
||||
Assert.That(state2.GetContext(), Is.Null);
|
||||
Assert.Throws<InvalidOperationException>(() => state1.GetContext());
|
||||
Assert.Throws<InvalidOperationException>(() => state2.GetContext());
|
||||
|
||||
_stateMachine.Init();
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user