Skip to content

Commit 7e89778

Browse files
committed
The static constructor of a type disrespects previously created arrangements when triggered by the Telerik.JustMock.PrivateAccessor class
o fixed potable and lite build configurations
1 parent c779ae2 commit 7e89778

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Telerik.JustMock/PrivateAccessor.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,9 @@ private PrivateAccessor(object instance, Type type)
105105
type = type.BaseType;
106106
}
107107

108+
#if (!PORTABLE && !LITE_EDITION)
108109
Mock.Intercept(type);
110+
#endif
109111
});
110112

111113
this.instance = instance;
@@ -522,8 +524,8 @@ private static bool CheckReflectionPermission()
522524
#if (COREFX)
523525
return false;
524526
#else
525-
try
526-
{
527+
try
528+
{
527529
new ReflectionPermission(ReflectionPermissionFlag.MemberAccess).Demand();
528530
return true;
529531
}

0 commit comments

Comments
 (0)