Question

I want to Unit Test the view model and for that I am Inheriting Mefbootstraper class so Please suggest the method to override the CreateShell method inside Bootstrapper which returns dummy dependency object.

Was it helpful?

Solution

Based on your last comment, you could avoid creating a Shell and the entire Bootstrapper. So, instead of calling Bootstrapper's run() method, you can create mocks for RegionManager, Comnposition Container and ResourceManager in order to pass them through ViewModel's constructor.

This would not be an issue as you would load these mock instances with the minimum information needed for the test.

Furthermore, real Bootstrapper would not be needed because its functionalities would not be targeted for testing.

I hope this helps, Regards.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top