Search code examples
silverlightunit-testingtestingsilverlight-toolkitcaliburn.micro

Get View + ViewModel from Caliburn.Micro in unit tests


We're using Caliburn.Micro to do all the magic of kickstarting our Silverlight app.

I'd like to have a play with testing an initialised view being hosted by the Silverlight Unit Testing Framework's TestPanel, but (without a deep dive) I don't know how to get at the view.

Does anyone know the magic to pull an initialised View + ViewModel out of Caliburn?


Solution

  • Check out white for doing automated UI testing :)

    Just as an aside, you can get an instance of your view that Caliburn.Micro attaches, by overriding the OnViewLoaded or AttachView method in your view model, which is part of the Screen type.