I am starting a new WPF / Silverlight user control project and wanted to do unit testing on this. However, I am a little confused about how to approach this.
This control will be based on the same code base for both WPF and Silverlight with a bit of forcing using #if and partial classes to tame the differences. I think I could write unit tests for the WPF part using NUnit, MSTest, xUnit, etc., And for the Silverlight part with the Silverlight Unit Test Framework, but this is not very elegant for me. I would either have to ignore testing identical code on one of the platforms, and test only different parts (which is not very reliable) or rewrite tests for 2 frameworks (which is annoying). Is this the right way?
I am wondering if there are any manuals, articles, tutorials on how to approach this task. Any pointers?
source
share