Reputation: 1483
I'm thinking of running unit tests for the business logic in the Lightswitch application. I've added a Silverlight unit test project (from the Silverlight Toolkit), however I couldn't retrieve the code from Lightswitch to write tests on.
Or is there really no way and the best way is to move the code out to another Silverlight class library?
Upvotes: 4
Views: 389
Reputation: 1
You can test custom LightSwitch code by using the GoF bridge pattern, see https://github.com/legg/UnitTestingLightSwitch2011
Upvotes: 0
Reputation: 1483
Ended up creating a separate test project, then adding the code to be tested through the "Add as Link" option. This way I was able to unit test the code even if the logic is inside the Lightswitch project.
Upvotes: 3