chevron-thin-right chevron-thin-left brand cancel-circle search youtube-icon google-plus-icon linkedin-icon facebook-icon twitter-icon toolbox download check linkedin phone twitter-old google-plus facebook profile-male chat calendar profile-male
Welcome to Typemock Community! Here you can ask and receive answers from other community members. If you liked or disliked an answer or thread: react with an up- or downvote.
0 votes
I have an ASP.NET web application that follows the Model-View-Presenter pattern. I am trying to mock some calls in the Presenter. Under normal conditions the presenter makes calls to a web service to source some data for the view, but I want to provide a known set of data without the web service call for testing purposes.

If I unit test the Presenter itself, I can mock the call to the web service successfully.

I am also trying to unit test the View as it is dynamically constructed depending on the data provided by the Presenter. To do this properly the page needs to be requested from a web server, and so I instantiate the MS development server within NUnit, and then request the page. My understanding is that this server launches itself in a new AppDomain. The test then requests the page, which the web server processes and returns.

Before requesting the page, I set up the same mocking on the Presenter to mock the call to the web service, however all mocking appears to be completely ignored in this scenario.

Is it possible to mock objects that are created in a separate AppDomain? Is there any way to achieve this type of mocking.
asked by timberston (1.3k points)

3 Answers

0 votes
Hi
Sorry it is not possible to mock objects that are created in a separate AppDomain yet. :(
However this is in our features list so don't loose your hope ... 8)
answered by ohad (35.4k points)
0 votes
Any ideas when on the time frame for this to be implemented?
answered by timberston (1.3k points)
0 votes
Hi,
We don't currently have a time frame for this feature.
Of course if many customers will need this we will bump up this feature.
answered by scott (32k points)
...