Windows Phone development and Unit Testing

前端 未结 4 1550
攒了一身酷
攒了一身酷 2020-12-25 10:23

I\'m looking to start a project targeting Windows Phone, but I\'m slightly put off by the lack of unit testing support[1].

I\'m used to using NUnit/ XUnit for most o

4条回答
  •  自闭症患者
    2020-12-25 10:58

    I've done some fairly basic tests and found that a Portable Library Class project and a normal Class Library for the tests work well.

    The caveat to this is that I've yet to find an MVVM framework built for portable class libraries, making the View Models untestable...unless...you use file linking (and assuming the View Models inherit from an MVVM framework specific base class). P While its not ideal, it's the best way forward I've found.


    EDIT:

    It seems as though there's a Prism (v4.5) release that's built on Portable Class Libraries...

    It's not, at the time of writing at least, on NuGet in either stable or pre-release, but I'll do some investigation into its usage and update.

    I've also had word that the Windows Phone 8 SDK will be able to target Windows Phone 7.

提交回复
热议问题