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

I was trying to mock this:

If (Not My.User.IsInRole(My.Settings.TrustedAccount)) Then
    Throw New System.Security.SecurityException("Some message.")
End If

I tried things like:

Using TheseCalls.WillReturn(true)
    My.User.IsInRole("")
End Using

And the test fails with messages simlar to this:

*** You are using TheseCalls.ReturnValue incorrectly - Method get_User in type AgFirst.APS.APSWebServiceTest.My.MyProject returns Microsoft.VisualBasic.ApplicationServices.User and not System.Boolean.
Please use TheseCalls.WillReturn(Microsoft.VisualBasic.ApplicationServices.User).
 
So I tried to create a test with the above suggestion and failed.
 
Do you have any suggestions or can you point me to any examples that might get me going in the right direction?  I am fairly new to using TypeMock.
 
I am using TypeMock 8.0.5.2.
 
Thanks.
 
asked by hodge (1.1k points)

1 Answer

0 votes
Taking it offline
answered by Bar (3.6k points)
...