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
Hi,
I am currently evaluating typemock so maybe this is a stupid mistake from my side.

But with the following code:

<TestMethod> _
Public Sub OnProcessChangedTester()
Dim fakeViewer As IMainViewer = FakeInstance(Of IMainViewer)()
Dim controller As New MainController(fakeViewer)

Using TheseCalls.WillBeIgnored
controller.UpdateMenu()
End Using

controller.OnProcessChanged(Me, EventArgs.Empty)

Using AssertCalls.HappenedWithExactArguments
controller.UpdateMenu()
End Using
End Sub

I get a typemock exception:

Test method PvUnitTest.MainControllerSequenceTest.OnProcessChangedTester threw exception: TypeMock.TypeMockException:
*** No method calls found inside using block.

The line number returned is the End Using line in the first using block

The above code is a shorter version of the intended test which contains several calls to the faked MainViewer. The asserts for calls to the methods in the faked object works OK.

It only this call to a method in the actual controller object that is causing problems.

I have tried it on both:
- VS2008 Pro with MS Test
- VS2008 Pro with Nunit and Testdriven.Net

The results are the same.

Thanks in advance for your help

Mats
asked by ramnefors (3.9k points)

1 Answer

0 votes
Hi Mats, and welcome to Isolator!

The error message you received means the recording block (inside the using statement) could not record any calls - this may happen when the calls inside the block are from mscorlib.dll (which Isolator cannot control), which does not seem to be the case here.

I suggest we take this case offline - I will send you an email from our support account and ask for more details so we can recreate the issue locally.

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