My sample code:
Assert.IsTrue(Mock.IsProfilerEnabled);
Mock.SetupStatic<RoleEnvironment>();
Mock.Arrange(() => RoleEnvironment.CurrentRoleInstance.Id).Returns("TEST");
Error Msg:
Method 'set_Id' in type 'RoleInstanceProxy+79c0aa98ec994a37a2e00052dd3aa3bd' from assembly 'Telerik.JustMock.DynamicStrong, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8b221631f7271365' does not have an implementation.
StackTrace:
at System.Reflection.Emit.TypeBuilder.TermCreateClass(RuntimeModule module, Int32 tk, ObjectHandleOnStack type)
at System.Reflection.Emit.TypeBuilder.CreateTypeNoLock()
at System.Reflection.Emit.TypeBuilder.CreateType()
at Telerik.JustMock.DynamicProxy.TypeEmitter.CreateType()
at Telerik.JustMock.DynamicProxy.Proxy.CreateType()
at Telerik.JustMock.DynamicProxy.ProxyFactory.Create()
at Telerik.JustMock.DynamicProxy.Fluent.FluentProxy.NewInstance()
at Telerik.JustMock.DynamicProxy.Proxy.Create(Type type, Action`1 action)
at Telerik.JustMock.MockManager.CreateProxy(Type targetType, Container container)
at Telerik.JustMock.MockManager.CreateProxy()
at Telerik.JustMock.Utility.CreateMockWithEmptyArgs(Type target, Behavior behavior)
at Telerik.JustMock.Interceptors.MethodInterceptor.OnMethodExecuting(MethodInvocation invocation)
at Telerik.JustMock.Interceptors.MockInterceptor.OnExecution(MethodInvocation invocation)
at Telerik.JustMock.Interceptors.MockInterceptor.Execute(MethodInvocation invocation)
at Telerik.JustMock.Interceptors.MockInterceptor.Intercept(MockInvocation invocation)
at Telerik.JustMock.Weaver.Interceptors.WeaverInterceptor.Telerik.JustMock.Weaver.Interceptors.Abstraction.IWeaverInterceptor.Intercept(IInvocation invocation)
at Telerik.JustMock.Handlers.WeaverInterceptorHandler.Invoke(Object[] args)
at Telerik.JustMock.MockContext`1.SetupMock(MockExpression`1 expression)
at Telerik.JustMock.MockContext`1.SetupMock(Expression`1 expression)
at Telerik.JustMock.Mock.<>c__DisplayClass1`1.<Arrange>b__0(MockContext`1 x)
at Telerik.JustMock.MockContext.Setup[TDelgate,TReturn](Instruction instruction, Func`2 function)
at Telerik.JustMock.Mock.Arrange[TResult](Expression`1 expression)
Assert.IsTrue(Mock.IsProfilerEnabled);
Mock.SetupStatic<RoleEnvironment>();
Mock.Arrange(() => RoleEnvironment.CurrentRoleInstance.Id).Returns("TEST");
Error Msg:
Method 'set_Id' in type 'RoleInstanceProxy+79c0aa98ec994a37a2e00052dd3aa3bd' from assembly 'Telerik.JustMock.DynamicStrong, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8b221631f7271365' does not have an implementation.
StackTrace:
at System.Reflection.Emit.TypeBuilder.TermCreateClass(RuntimeModule module, Int32 tk, ObjectHandleOnStack type)
at System.Reflection.Emit.TypeBuilder.CreateTypeNoLock()
at System.Reflection.Emit.TypeBuilder.CreateType()
at Telerik.JustMock.DynamicProxy.TypeEmitter.CreateType()
at Telerik.JustMock.DynamicProxy.Proxy.CreateType()
at Telerik.JustMock.DynamicProxy.ProxyFactory.Create()
at Telerik.JustMock.DynamicProxy.Fluent.FluentProxy.NewInstance()
at Telerik.JustMock.DynamicProxy.Proxy.Create(Type type, Action`1 action)
at Telerik.JustMock.MockManager.CreateProxy(Type targetType, Container container)
at Telerik.JustMock.MockManager.CreateProxy()
at Telerik.JustMock.Utility.CreateMockWithEmptyArgs(Type target, Behavior behavior)
at Telerik.JustMock.Interceptors.MethodInterceptor.OnMethodExecuting(MethodInvocation invocation)
at Telerik.JustMock.Interceptors.MockInterceptor.OnExecution(MethodInvocation invocation)
at Telerik.JustMock.Interceptors.MockInterceptor.Execute(MethodInvocation invocation)
at Telerik.JustMock.Interceptors.MockInterceptor.Intercept(MockInvocation invocation)
at Telerik.JustMock.Weaver.Interceptors.WeaverInterceptor.Telerik.JustMock.Weaver.Interceptors.Abstraction.IWeaverInterceptor.Intercept(IInvocation invocation)
at Telerik.JustMock.Handlers.WeaverInterceptorHandler.Invoke(Object[] args)
at Telerik.JustMock.MockContext`1.SetupMock(MockExpression`1 expression)
at Telerik.JustMock.MockContext`1.SetupMock(Expression`1 expression)
at Telerik.JustMock.Mock.<>c__DisplayClass1`1.<Arrange>b__0(MockContext`1 x)
at Telerik.JustMock.MockContext.Setup[TDelgate,TReturn](Instruction instruction, Func`2 function)
at Telerik.JustMock.Mock.Arrange[TResult](Expression`1 expression)