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
when trying to mock a call : Isolate.WhenCalled(() => content.ContentId).WillReturn(5);
i get System.UnauthorizedAccessException and stacktrace leads to typemock code : b2.a(String A_0)
Oren
asked by isasson1 (3.2k points)

5 Answers

0 votes
Hi Oren,

Can you send us the test code and the code of the class under test.
Also the full stacktrace would help.

Which version of Isolator do you use?
Are you using an appdomain with explicit permissions.
answered by alex (18k points)
0 votes
Hi
Stack trace :
System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
System.Threading.Mutex.MutexTryCodeHelper.MutexTryCode(Object userData)
System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
System.Threading.Mutex..ctor(Boolean initiallyOwned, String name, Boolean& createdNew, MutexSecurity mutexSecurity)
System.Threading.Mutex..ctor(Boolean initiallyOwned, String name, Boolean& createdNew)
System.Threading.Mutex..ctor(Boolean initiallyOwned, String name)
b2.a(String A_0)
b2..ctor()
b2.b()
ao.c(TraceData A_0)
ao.d()
ao.b()
TypeMock.MockManager.Init(Boolean collectAllCalls)
TypeMock.MockManager.Init()
TypeMock.MockManager.a(String A_0, String A_1, Object A_2, Object A_3, Boolean A_4, Boolean A_5)
TypeMock.InternalMockManager.isMocked(Object that, String typeName, String methodName, Object methodParameters, Boolean isInjected, Boolean isIntercepted)
...StartFlow_MockTest() in C:\Users\......cs: line 0

Error: Test method ....StartFlow_MockTest threw exception:
System.UnauthorizedAccessException: Access to the path 'e37081e8-009f-4a43-854f-3c4223ce5181' is denied.

Version 6.0.4

Sample:
for any code , both project specific or not
StackTrace fm = Isolate.Fake.Instance<StackTrace>();
Isolate.WhenCalled(() => fm.FrameCount).WillReturn(10);
answered by isasson1 (3.2k points)
0 votes
Hi,

I've got some questions.

1) Which version of visual studio do you use?
2) What addins do you have in your visual studio?
3) Which runner do you use?
answered by alex (18k points)
0 votes
Hi Oren

This Patch should solve this issue:
https://www.typemock.com/files/patches/T ... _mutex.msi

Please let us know if it helps.
answered by alex (18k points)
0 votes
Oren,

Thanks for the feedback in the mail.
It's good to know that the patch solves the problem.

FYI, the patch is now included in version 7.0.9.
answered by NofarC (4k points)
...