Silverlight Testing framework bug – FrameworkElements are not visible on the TestSurface

Working with the Silverlight testing framework the last three weeks has been interesting.  I ran into a crazy intermittent bug which drove me made for about 2 hours.  The usercontrol that I was adding to the TestSurface would be visible about 50% of the time when running my tests. The test would still run and I could hear the audio portion of the videos that were playing as part of an integration test, but the Controls were not visible on the test surface. All I could see was the blank test surface and the testing framework status on the right side of the test runner.

 
After resorting to reflector on the test framework I found that the TestSurface is a Grid control.  That got me to think that since my controls parent control is also a Grid control that maybe the nested grids are just having some sort of issue.  I ended up solving the problem by Adding my controls to a Canvas control and adding the Canvas instance to the TestSurface.  Code as follows……

Subscribe to this feed: http://feeds.feedburner.com/erichexter 

si-testing-testsurfacebug

 

This solved my problem… The issue is not with the test framework as much as the silverlight runtime.  It is still beta so what do you expect?

More posts on the test framework, both unit testing and integration testing, to come soon.

 

Additional Info: 

For more information about the silverlight testing framework see: http://www.jeff.wilcox.name/2008/03/31/silverlight2-unit-testing/

Related Articles:

Post Footer automatically generated by Add Post Footer Plugin for wordpress.

About Eric Hexter

I am the CTO for QuarterSpot. I (co)Founded MvcContrib, Should, Solution Factory, and Pstrami open source projects. I have co-authored MVC 2 in Action, MVC3 in Action, and MVC 4 in Action. I co-founded online events like mvcConf, aspConf, and Community for MVC. I am also a Microsoft MVP in ASP.Net.
This entry was posted in silverlight, testing. Bookmark the permalink. Follow any comments here with the RSS feed for this post.