Unit Testing in Lightswitch
-
26-10-2019 - |
Question
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?
Solution
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.
OTHER TIPS
You can test custom LightSwitch code by using the GoF bridge pattern, see https://github.com/legg/UnitTestingLightSwitch2011
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow