简体   繁体   中英

MvvmLight in Portable Class Library - How to do Unit Testing

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM