It is currently Sat Aug 02, 2014 12:22 am

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Sun Jan 25, 2009 8:34 pm 
Offline
Advanced
Advanced

Joined: Wed Apr 02, 2008 4:11 pm
Posts: 26
Hi there.

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

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:

Code:
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.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 26, 2009 8:59 am 
Offline
Site Admin
Site Admin

Joined: Sat Mar 15, 2008 9:36 am
Posts: 405
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


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 26, 2009 11:45 am 
Offline
Advanced
Advanced

Joined: Wed Apr 02, 2008 4:11 pm
Posts: 26
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.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 26, 2009 12:17 pm 
Offline
Site Admin
Site Admin

Joined: Sat Mar 15, 2008 9:36 am
Posts: 405
Thanks, we may take you up on that! :)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group