Google Groups Home
Help | Sign in
Message from discussion CreateMock fails with an exception on Mono+Linux
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
Ayende Rahien  
View profile
 More options Mar 12 2007, 2:13 am
From: "Ayende Rahien" <aye...@ayende.com>
Date: Mon, 12 Mar 2007 08:13:29 +0200
Local: Mon, Mar 12 2007 2:13 am
Subject: Re: CreateMock fails with an exception on Mono+Linux

Sorry for the long time it took.
Just run the tests on Mono Win32, and it certainly failed.
I pinged the mono group, we will see what they have to say about it.

On 2/27/07, Ayende Rahien <aye...@ayende.com> wrote:

> You shouldn't have to do anything special to run v3.0, so that is okay,
> I'll give it a test today and see what the problem is.

> On 2/27/07, ryt...@gmail.com <ryt...@gmail.com> wrote:

> > On Feb 16, 9:25 pm, "Ayende Rahien" <aye...@ayende.com> wrote:
> > > Okay, I am going to release Rhino Mocks 3.0 beta tomorrow, could you
> > please
> > > give it a test on Mono and see whatever the issue is resolved?

> > Ok, I wrote the simplest test case I could think of:

> > using System;
> > using Rhino.Mocks;

> > public interface IFoo {
> >     bool IsFoo { get; }
> > }

> > public class RhinoTest {
> >     public static void Main(string[] args) {
> >         MockRepository r = new MockRepository();
> >         IFoo foo = r.CreateMock<IFoo>();
> >     }
> > }

> > I compiled that with "gmcs -r:Rhino.Mocks.dll -target:winexe Test.cs"
> > and ran it. The result:

> > Unhandled Exception: System.ArgumentNullException: Argument cannot be
> > null.
> > Parameter name: method
> >   at System.Reflection.Emit.ILGenerator.Emit (OpCode opcode,
> > System.Reflection.MethodInfo method) [0x00000]
> >   at

> > Castle.DynamicProxy.Generators.Emitters.SimpleAST.MethodTokenExpression.Emi t
> > (IMemberEmitter member, System.Reflection.Emit.ILGenerator gen)
> > [0x00000]
> >   at
> > Castle.DynamicProxy.Generators.Emitters.SimpleAST.AssignStatement.Emit
> > (IMemberEmitter member, System.Reflection.Emit.ILGenerator gen)
> > [0x00000]
> >   at

> > Castle.DynamicProxy.Generators.Emitters.CodeBuilders.AbstractCodeBuilder.Ge nerate
> > (IMemberEmitter member, System.Reflection.Emit.ILGenerator il)
> > [0x00000]
> >   at
> > Castle.DynamicProxy.Generators.Emitters.ConstructorEmitter.Generate ()
> > [0x00000]
> >   at

> > Castle.DynamicProxy.Generators.Emitters.AbstractTypeEmitter.EnsureBuildersA reInAValidState
> > () [0x00000]
> >   at
> > Castle.DynamicProxy.Generators.Emitters.AbstractTypeEmitter.BuildType
> > () [0x00000]
> >   at

> > Castle.DynamicProxy.Generators.InterfaceProxyWithTargetGenerator.GenerateCo de
> > (System.Type proxyTargetType, System.Type [] interfaces,
> > Castle.DynamicProxy.ProxyGenerationOptions options) [0x00000]
> >   at

> > Castle.DynamicProxy.DefaultProxyBuilder.CreateInterfaceProxyTypeWithoutTarg et
> > (System.Type theInterface, System.Type[] interfaces,
> > Castle.DynamicProxy.ProxyGenerationOptions options) [0x00000]
> >   at
> > Castle.DynamicProxy.ProxyGenerator.CreateInterfaceProxyTypeWithoutTarget
> > (System.Type theInterface, System.Type[] interfaces,
> > Castle.DynamicProxy.ProxyGenerationOptions options) [0x00000]
> >   at
> > Castle.DynamicProxy.ProxyGenerator.CreateInterfaceProxyWithoutTarget
> > (System.Type theInterface, System.Type[] interfaces,
> > Castle.DynamicProxy.ProxyGenerationOptions options,
> > Castle.Core.Interceptor.IInterceptor [] interceptors) [0x00000]
> >   at
> > Castle.DynamicProxy.ProxyGenerator.CreateInterfaceProxyWithoutTarget
> > (System.Type theInterface, System.Type[] interfaces,
> > Castle.Core.Interceptor.IInterceptor[] interceptors) [0x00000]
> >   at Rhino.Mocks.MockRepository.MockInterface
> > (Rhino.Mocks.CreateMockState mockStateFactory, System.Type type,
> > System.Type[] extras) [0x00000]
> >   at Rhino.Mocks.MockRepository.CreateMockObject (System.Type type,
> > Rhino.Mocks.CreateMockState factory, System.Type[] extras,
> > System.Object[] argumentsForConstructor) [0x00000]
> >   at Rhino.Mocks.MockRepository.CreateMock[IFoo] (System.Object[]
> > argumentsForConstructor) [0x00000]
> >   at RhinoTest.Main (System.String[] args) [0x00000]

> > I guess this really is a Mono bug then.

> > Please note that I didn't read any docs on 3.0, just tried to use it
> > like I've done so far. :)

> > Cheers!

> > -Lauri


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google