문제

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.

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top