【发布时间】:2015-01-29 20:51:09
【问题描述】:
我正在使用 MvvmCross 的 IoC 属性注入,在我各自的 Setup.cs-classes 中初始化:
protected override IMvxIocOptions CreateIocOptions()
{
return new MvxIocOptions {
PropertyInjectorOptions = MvxPropertyInjectorOptions.All
};
}
在我的视图模型中,我有几个公共接口属性,如下所示:
public void IDataService DataService { get; set; }
当我运行应用程序时一切正常,但单元测试失败,因为 DataService 是 null。
使用MvxIoCSupportingTest时如何正确设置属性注入?
【问题讨论】:
标签: c# xamarin inversion-of-control mvvmcross