AAA gives me the following error: Cannot assert on an object that is
not in replay mode. Did you forget to call ReplayAll()
Here's my test attempting to do this outside of the test fixture (to
attempt to eliminate complexities:
var mocks = new MockRepository();
var entity = mocks.Stub<AttributeValueEntityBase>();
var attribute = mocks.Stub<Attribute>();
var value = Factory.AttributeValueFactory
(AttributeValueType.Text);
entity.Expect(x => x.RemoveAttributeValue
(value)).Repeat.Once();
value.Owner = entity;
attribute.Expect(x => x.RemoveAttributeValue
(value)).Repeat.Once();
value.Attribute = attribute;
value.Dereference(); //Should and does call both removes
for the Owner and Attribute properties on value
entity.AssertWasCalled(x => x.RemoveAttributeValue
(value)); //Fails here
attribute.AssertWasCalled(x => x.RemoveAttributeValue
(value));
I started off using AAA and was receiving this error, so assumed I
needed to be using a record/replay model.
Regarding the main error of the thread with debugging, I still get the
original ToString() error on the .Dereference() call with the above
code if I'm stepping through it in debug.
On Jul 15, 9:26 pm, Kenneth Xu <[email protected]> wrote:
> Could characteristic a type you actually mean mockAttribute instead?
> If that is not the case, would you be able to isolate the issue in a
> small reproducable sample?
>
>
>
> On Wed, Jul 15, 2009 at 6:07 PM, Hudson Akridge<[email protected]> wrote:
> > Expect.Call(() => mockAttribute.RemoveValue
> > (Value)).Repeat.AtLeastOnce();
> > characteristic.Replay();
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---