We are using Rhino Mock in our project. I'm rather a newbie on
mocking.
Currently we have the following code that was written by a colleague
of mine.
He tested it and it works fine on his machine and the build server.

var message = mocks.StrictMock<Message>();
            var asynchResult = mocks.Stub<IAsyncResult>();
            var contx = new PollQueueContext("12346",
ConfigurationManager.AppSettings["geenidee"]);
            var timerFact = mocks.StrictMock<ITimerUtilFactory>();
            var timer = mocks.StrictMock<ITimerUtil>();
            var task = new PollQueueTask(dispatcher,
messageQueueProvider, timerFact, transactionScopeProvider);

The strange this is that when I run the unit tests on my machine I get
the following error when creating the stub of IASyncResult.: Can not
retrieve the StrongNameKeyPair.

bij System.Reflection.StrongNameKeyPair.nGetPublicKey(Boolean
exported, Byte[] array, String container)
bij System.Reflection.StrongNameKeyPair.get_PublicKey()
bij System.AppDomain.InternalDefineDynamicAssembly(AssemblyName name,
AssemblyBuilderAccess access, String dir, Evidence evidence,
PermissionSet requiredPermissions, PermissionSet optionalPermissions,
PermissionSet refusedPermissions, StackCrawlMark& stackMark,
IEnumerable`1 unsafeAssemblyAttributes)
bij System.AppDomain.DefineDynamicAssembly(AssemblyName name,
AssemblyBuilderAccess access)
bij Castle.DynamicProxy.ModuleScope.CreateModule(Boolean
signStrongName)
bij
Castle.DynamicProxy.ModuleScope.ObtainDynamicModuleWithStrongName()
bij Castle.DynamicProxy.ModuleScope.ObtainDynamicModule(Boolean
isStrongNamed)
bij
Castle.DynamicProxy.Generators.Emitters.ClassEmitter.CreateTypeBuilder(ModuleScope
modulescope, String name, Type baseType, Type[] interfaces,
TypeAttributes flags, Boolean forceUnsigned)
bij
Castle.DynamicProxy.Generators.Emitters.ClassEmitter..ctor(ModuleScope
modulescope, String name, Type baseType, Type[] interfaces,
TypeAttributes flags, Boolean forceUnsigned)
bij
Castle.DynamicProxy.Generators.Emitters.ClassEmitter..ctor(ModuleScope
modulescope, String name, Type baseType, Type[] interfaces,
TypeAttributes flags)
bij
Castle.DynamicProxy.Generators.Emitters.ClassEmitter..ctor(ModuleScope
modulescope, String name, Type baseType, Type[] interfaces)
bij
Castle.DynamicProxy.Generators.BaseProxyGenerator.BuildClassEmitter(String
typeName, Type parentType, Type[] interfaces)
bij
Castle.DynamicProxy.Generators.BaseProxyGenerator.BuildClassEmitter(String
typeName, Type parentType, IList interfaceList)
bij
Castle.DynamicProxy.Generators.InterfaceProxyWithTargetGenerator.GenerateCode(Type
proxyTargetType, Type[] interfaces, ProxyGenerationOptions options)
bij
Castle.DynamicProxy.DefaultProxyBuilder.CreateInterfaceProxyTypeWithoutTarget(Type
interfaceToProxy, Type[] additionalInterfacesToProxy,
ProxyGenerationOptions options)
bij
Castle.DynamicProxy.ProxyGenerator.CreateInterfaceProxyTypeWithoutTarget(Type
interfaceToProxy, Type[] additionalInterfacesToProxy,
ProxyGenerationOptions options)
bij
Castle.DynamicProxy.ProxyGenerator.CreateInterfaceProxyWithoutTarget(Type
interfaceToProxy, Type[] additionalInterfacesToProxy,
ProxyGenerationOptions options, IInterceptor[] interceptors)
bij Rhino.Mocks.MockRepository.MockInterface(CreateMockState
mockStateFactory, Type type, Type[] extras)
bij Rhino.Mocks.MockRepository.CreateMockObject(Type type,
CreateMockState factory, Type[] extras, Object[]
argumentsForConstructor)
bij Rhino.Mocks.MockRepository.Stub(Type type, Object[]
argumentsForConstructor)
bij Rhino.Mocks.MockRepository.Stub[T](Object[]
argumentsForConstructor)
bij
Pdc.Erp.Integration.Tests.Tasks.WhenWeUseThePollQueueTask.An_exception_is_caught_and_the_process_restarts()
in C:\Projects\PDC.ERP\trunk\src\Pdc.Erp.Integration.Tests\Tasks
\WhenWeUseThePollQueueTask.cs:regel 79

I already tried the 
http://ayende.com/Wiki/Default.aspx?Page=Rhino+Mocks+-+Internal+Methods&AspxAutoDetectCookieSupport=1.
I thought that this was the solution....
Can someone shed some light on this problem?
Thank you in advance,

-- 
You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rhinomocks?hl=en.

Reply via email to