I've got a C# desktop application (CompositUI/WinForms). This application connects to a webservice using SmartClient. My task is to introduce (retrofit) tests to this application, using SpecFlow and White frameworks. In order to just test the GUI, I need to mock the webservice calls. The class that connects to it is being inject via Spring.net. My task is to test the application being able to mock the webservice call during tests, that means, my test code needs to be in control of what my mock will do. The problem: method that starts the GUI is simply not returning control to the thread that has invoked it. In result, we cannot control the GUI and mocks.
So questions I have at this point are:
is it doable (and if so - how to do it) to start GUI in separate thread and have control back to the test thread?
what would be other possibilities of running GUI tests, that would allow me to have control over injected?