便携式类库中的MvvmLight-如何进行单元测试 [英] MvvmLight in Portable Class Library - How to do Unit Testing

查看:70
本文介绍了便携式类库中的MvvmLight-如何进行单元测试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Windows Store应用程序,但遇到了一个大问题.我前一段时间在这个问题中描述了我的解决方案体系结构.我将MvvmLight添加到包含表示逻辑的可移植类库中,然后尝试将单元测试写入从ViewModelBase(从MvvmLight继承)的ViewModel之一中.问题是,可移植类库引用了另一个版本的MvvmLight包,例如经典的UnitTest .NET 4.5类库中的,这意味着我不能为任何ViewModel编写UnitTests.我理解这一点,但是用MvvmLight对可移植类库进行UnitTest的方法是什么?

I'm working on the windows store application and I met one big problem. I described my solution architecture some time ago in this question. I added MvvmLight to my portable class library containing the presentation logic and afterwards I tried to write unit tests to one of my ViewModel inherited from ViewModelBase (from MvvmLight). Problem is, that portable class library has referenced MvvmLight package of another version like in the classical UnitTest .NET 4.5 class library and that means I can't write UnitTests for any ViewModel. I understand this, but what is the way to do UnitTests for portable class library with MvvmLight?

谢谢.

推荐答案

您可以引用MVVM Light PCL版本(

You can reference MVVM Light PCL version (mvvm light pcl nuget link) in project and unit tests. That's the way I've done in WindowsRT, Windows Phone, Shared project and shared unit test project.

这篇关于便携式类库中的MvvmLight-如何进行单元测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆