There are no mocking frameworks that support WP7, and I suspect there will never be one until WP7 supports Reflection.Emit.
There are many parameters in the .net framework that exist to create a mocking structure (Profiler API, CodeDem, Refleciton.Emit, and others). Most of these methods will not work on Silverlight itself, as it skips quite a lot of BCL / CLRs. All existing Silverlight frameworks using the form use Reflection.Emit. WP7 does not support Reflection.Emit, and thus the Silverlight mocking framework will not work on WP7.
For this reason, I personally test WP7 builds in the Silverlight runtime. This is far from optimal (this sucks), but it is the best that can be done in the circumstances.
Theoretically, you can build a Mocking environment that uses Post-Build MSIL, which should run on WP7, but that's not all.
If you want WP7 to support Reflection.Emit, then consider this maintenance question: WP7 must support Reflection.Emit for Mocking frameworks
EDIT 12/12/2011: Refleciton.Emit supported by Mango. Hooray! Reflection.Emit based on Mocking should work.
Justinangel
source share