Unit testing custom controls in Silverlight

Posted by Hrvoje on Stack Overflow See other posts from Stack Overflow or by Hrvoje
Published on 2010-06-02T09:41:54Z Indexed on 2010/06/02 9:43 UTC
Read the original article Hit count: 268

Filed under:
|

I have several custom controls (some kind of frames for content and layout management, like wrap panel), and would like to write unit tests for them. It's hard to find any good examples except Silverlight control toolkit, which has some helper classes to do unit tests and it's quite complicated. For MVVM classes it's easy to write tests because they don't use SL dependency system and infrastructure.
Questions:

  • how to unit test DepedenyProperty, what do I need to test
  • how to test attached property
  • do I test bindings with theme or UserControl, like simple textblock content binding, or command/event binding in MVVM with UserControl
  • what else do I test in my custom controls, beside my business logic
  • any good tutorial to achieve tests like those in control toolkit

How do I start? Is SL controls toolkit only option for learning?

For testing framework i'm using one from control toolkit, and for continuus integration on TFS build server I planned to use Statlight (from codeplex). Any advice on that?

© Stack Overflow or respective owner

Related posts about Silverlight

Related posts about unit-testing