I upgraded a project that used an older version of rhino mocks to the
latest rhino trunk, and now tests that were previously passing are
getting NullReferenceExceptions from within interface proxies.  The
tests aren't complicated and they are using pretty standard features.
Here is a simple, reduced example of just the record phase, where the
errors are happening.  I can provide a complete example if needed:

var mocked = Mock<ISomeInterface>();
using (Mocks.Record())
{
        SetupResult.For(mocked.PropertyThatDoesntError).Return(app); //fine
        SetupResult.For(mocked.SomeProperty).PropertyBehavior(); //ERROR
        //The previous line throws a NullReferenceException from within
        //ISomeInterfaceProxy9db4f29c8a074e52bcea67279477da43.get_SomeProperty
()
        mocked.LoanAmount = lnamt;
}

---
Is this a known issue?  Expectations for properties aren't the only
thing throwing this error; some tests are throwing null refs when
setting up results for methods as well.  The REALLY weird thing is
that if I move the line that causes the error to the top of the record
block, everything works.

The full error is this:

System.NullReferenceException: Object reference not set to an instance
of an object.
at ISomeInterfaceProxy9db4f29c8a074e52bcea67279477da43.get_SomeProperty
()
at RhinoBugTest.cs: line 36


Thanks,
-tyler

--~--~---------~--~----~------------~-------~--~----~
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