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
What would be the syntax for doing something like the following, with IsolatorVB?

Isolate.WhenCalled(() => factory.CreateInstance<HndDebtorsService>(null).WillReturn(fakeService);


The question isn't a C#->VB question, because WhenCalled doesn't seem to exist for Isolate.VB

I'm having the same issue as the original poster in this post:

https://www.typemock.com/community/viewtopic.php?p=5360&sid=a847108abcfde022cbab40c776ca24cc


because I'm trying to swap an instance of an interface (which in hindsight sort of makes sense, even though an object is created that implements, the interface...).

Thanks in advance for your help.
asked by jdivis (1.2k points)

1 Answer

0 votes
First off, the VB syntax equivalent to WhenCalled() would be:
Using TheseCalls.WillReturn(fakeService)
   factory.CreateInstance(Of HndDebtorsService)(null)
End Using


Can you post the code (or a simplified version) of the HndDebtorsService? I'd like to get a local recreation going.

Thanks,
Doron
Typemock Support
answered by doron (16.5k points)
...