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
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.3k points)

1 Answer

+1 vote
 
Best answer
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 (17.2k points)
selected by jdivis
...