MvvmLight in Portable Class Library - How to do Unit Testing

守給你的承諾、 提交于 2019-12-11 00:44:35

问题


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?

Thank you.


回答1:


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.



来源:https://stackoverflow.com/questions/24123999/mvvmlight-in-portable-class-library-how-to-do-unit-testing

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!