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 there.

I was reading the latest TypeMock blog entry, when I spotted this code

public static void VerifyInstanceWasNotCalled<T>(T fakeObject)
{
  foreach (MethodInfo info in typeof (T).GetMethods())
  {
      string methodName = info.Name;
      Isolate.Verify.NonPublic.WasNotCalled(fakeObject, methodName);
  }
}


How can I rewrite this in VB? I don't know how to replicate the 'Isolate.Verfiy...' line.

Here's what I have so far:

Public Sub VerifyInstanceWasNotCalled(Of T)(ByVal fakeObject As T)
For Each info As MethodInfo In GetType(T).GetMethods()
            Dim methodName As String = info.Name

            Using AssertCalls.NeverHappened
                'Isolate.Verify.NonPublic.WasNotCalled(fakeObject, methodName) <- How?
            End Using
        Next
    End Sub


Cheers.
Jas.
asked by MrClyfar (5.2k points)

3 Answers

0 votes
Hi Jas,

What you are missing is a non public, string based verify in VB. This has not been released with version 5.2, but we are closing that gap in the upcoming version. In the meanwhile and as a workaround you can add a reference to Typemock.ArrangeActAssert.dll and use the c# syntax for non public verification.

Also, if you would like to receive a pre-release patch containing non-public support for the VB API I can send that over once it's ready - let me know if this is a better solution for you.

Thanks,
Doron
Typemock Support
answered by doron (17.2k points)
0 votes
Hi there.

Many thanks for the reply and for offering to send a patch.

As this isn't a serious issue for me, I'm in no hurry for an update. However, if the update is something you would like me to help test for you, then I'm more then happy to try it out and give you feedback.

Cheers.
Jas.
answered by MrClyfar (5.2k points)
0 votes
Thanks, we may take you up on that! :)
answered by doron (17.2k points)
...