Unit testing "hybrid" WPF/Silverlight controls

Posted by Alan Mendelevich on Stack Overflow See other posts from Stack Overflow or by Alan Mendelevich
Published on 2010-06-10T12:55:28Z Indexed on 2010/06/11 8:03 UTC
Read the original article Hit count: 323

Filed under:
|
|

I'm starting a new WPF/Silverlight custom control project and wanted to do unit testing on this one. However I'm a little confused about how to approach this.

This control would be based on the same codebase for both WPF and Silverlight with minor forking using #ifs and partial classes to tame the differences. I guess I could write unit tests for WPF part with NUnit, MSTest, xUnit, etc. and for the Silverlight part with Silverlight Unit Test Framework but this doesn't sound very elegant to me. I'd have to either ignore testing identical code on one of the platforms and test only differing parts (which is not very trustworthy) or rewrite tests for 2 frameworks (which is annoying). Is this the right way to go?

I'm wondering if there's some guidance, articles, tutorials out there on how to approach this task. Any pointers?

© Stack Overflow or respective owner

Related posts about wpf

Related posts about Silverlight