#1 Error when mock's method returns enum type

open
nobody
None
5
2005-04-06
2004-11-04
Anonymous
No

The following exception is thrown when some mock's
method returns enum type while recording state:

System.Runtime.Remoting.RemotingException : Byref
value type parameter cannot be null.

at
System.Runtime.Remoting.Proxies.RealProxy.ValidateRetur
nArg(Object arg, Type paramType)
at
System.Runtime.Remoting.Proxies.RealProxy.PropagateOu
tParameters(IMessage msg, Object[] outArgs, Object
returnValue)
at
System.Runtime.Remoting.Proxies.RealProxy.HandleReturn
Message(IMessage reqMsg, IMessage retMsg)
at
System.Runtime.Remoting.Proxies.RealProxy.PrivateInvok
e(MessageData& msgData, Int32 type)
at
Weg.Applications.ENS.Model.IQualquer.RetornarEnum()
at
Weg.Applications.ENS.Model.TestListaParametros.Create
Enrolamento(EnumEnrolamento valor) in
C:\Projetos\ENS\Model\test\Entities\TestListaParametros
.vb:line 37
at
Weg.Applications.ENS.Model.TestListaParametros.SetUp
() in
C:\Projetos\ENS\Model\test\Entities\TestListaParametros
.vb:line 20

Thanks!

Celio C. Jr.
ccidral@expresso.com.br

Discussion

  • Jon Skeet

    Jon Skeet - 2005-03-30

    Logged In: YES
    user_id=215483

    This is effectively a duplicate of bug 795039, and is fixed
    with the same code.

     
  • Marco Struck

    Marco Struck - 2005-04-06
    • status: open --> wont-fix
     
  • Marco Struck

    Marco Struck - 2005-04-06
    • status: wont-fix --> open
     
  • Jon Skeet

    Jon Skeet - 2005-04-14

    Logged In: YES
    user_id=215483

    Fixed in CVS. Ready to close.

     
  • Jakoby

    Jakoby - 2005-10-27

    Logged In: YES
    user_id=1368752

    The same exception occurs when working with structures as
    return types (e.g. System.TimeSpan) in RC1 of EasyMock.

    mockControl.ExpectedReturn(mockObj.Method, new
    TimeSpan(1000)).

    System.Runtime.Remoting.RemotingException : Byref value
    type parameter cannot be null.
    at
    System.Runtime.Remoting.Proxies.RealProxy.ValidateReturn
    Arg(Object arg, Type paramType)
    at
    System.Runtime.Remoting.Proxies.RealProxy.PropagateOut
    Parameters(IMessage msg, Object[] outArgs, Object
    returnValue)
    at
    System.Runtime.Remoting.Proxies.RealProxy.HandleReturn
    Message(IMessage reqMsg, IMessage retMsg)
    at
    System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke
    (MessageData& msgData, Int32 type)

    Regards / Jakob

     
  • Nobody/Anonymous

    Logged In: NO

    Yes, it would occur in RC1 too. There hasn't been a release
    since I fixed the code.

    Jon

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks