GwWuYou 8130cf7fb0 refactor(ioc): 重构依赖注入容器和模型上下文管理
- 将IocContainer的Init方法重命名为OnContextReady并设为protected override
- 重构AbstractModel中的Architecture字段为_context属性并实现IContextAware接口
- 移除GetArchitecture和SetArchitecture方法,添加GetContext和SetContext方法
- 为IModel接口添加IContextAware继承
- 添加TestArchitecture、TestModel和TestSystem测试类
- 创建ArchitectureInitializationTests测试用例验证组件初始化
- 更新项目文件添加NUnit包引用和测试项目配置
- 在解决方案文件中添加测试项目引用
2025-12-29 21:14:23 +08:00

18 lines
420 B
C#

using GFramework.Core.architecture;
using GFramework.Core.Tests.model;
using GFramework.Core.Tests.system;
namespace GFramework.Core.Tests.architecture;
public sealed class TestArchitecture : Architecture
{
public bool InitCalled { get; private set; }
protected override void Init()
{
InitCalled = true;
RegisterModel(new TestModel());
RegisterSystem(new TestSystem());
}
}