unit-testing - Windows Store 应用程序的单元测试库中选择的模拟框架是什么?

标签 unit-testing mocking windows-8

关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。












想改进这个问题?将问题更新为 on-topic对于堆栈溢出。

6年前关闭。




Improve this question




当我编写单元测试时,我喜欢使用 Rhino Mocks。

因此,当我开始我的第一个 Windows 应用商店应用程序时,我自然而然地首先开始了我的单元测试。当我尝试添加 RhinoMocks通过NuGet我收到以下错误

Could not install package 'RhinoMocks 3.6.1'. You are trying to install this package into a project that targets '.NETCore,Version=v4.5', but the package does not contain any assembly references that are compatible with that framework. For more information, contact the package author.



我对起订量有同样的问题。

.NETCor,Version=v4.5 是否有模拟框架?

最佳答案

大多数模拟框架都基于 Reflection.Emit .不幸的是 Reflection.Emit不在 WinRT 中。这意味着你不能做动态代理。 (即运行时模拟)。这留下了在编译时引用的模拟的预生成。我知道的唯一框架是 Moq 的一个实验分支:https://github.com/mbrit/moqrt

关于unit-testing - Windows Store 应用程序的单元测试库中选择的模拟框架是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12083462/

相关文章:

unit-testing - 测试 Angular 服务给出错误 : No module: ngResource

android - 如何使用 Mockito 在 android 中正确测试 ORM?

xaml - 人们在 Windows 8 中使用什么来代替 IMultiValueConverters?

reactjs - 用 Jest 模拟 React 自定义钩子(Hook)

c# - Rhino 模拟单元测试(父类不包含带 0 个参数的构造函数)

.net - ClickOnce 应用程序和 Windows 8 认证

c# - 为什么 json 序列化器不符合多态性?

c# - Moq 无法在构造函数中创建具有可为空参数的类的模拟对象

php - 连接到 MySQL 数据库的 PHP API 单元测试

c++ - 在 Boost Test 框架中测试 assert