I was able to get nice message using MbUnit.
Old version:
_mockAccountSrv.Expect(x => x.Update(dawidAccoutAfterDeposit));
The new version using arguments inspection:
_mockAccountSrv.Expect(x => x.Update(null))
.IgnoreArguments()
.WhenCalled(invocation => Assert.AreEqual(dawidAccoutAfterDeposit,
invocation.Arguments[0]));
Message:
*** Failures ***
Expected values to be equal.
Expected Value : {UnitTests.Common.Models.Account: AccountNo = 345,
Balance = 837465.2}
Actual Value : {UnitTests.Common.Models.Account: AccountNo = 345,
Balance = 837519.4}
Is that the only way :-(?
Regards
Dawid
On 5 Sty, 15:32, Dawid Rutyna <[email protected]> wrote:
> Is it possible for Rhino-Mocks to display objects differences when a
> method is executed with an object (as a parameter) that slightly
> differs from the actual one?
>
> What I get is:
>
> *** Failures ***
> Execute
> Rhino.Mocks.Exceptions.ExpectationViolationException:
> AccountSrv.Update(UnitTests.Common.Models.Account); Expected #1,
> Actual #0.
> at Rhino.Mocks.Impl.ReplayMockState.Verify()
> at Rhino.Mocks.MockRepository.Verify(Object obj)
> at
> UnitTests.PlayingWithRhinoMocks.DepositSrvTest.DepositingProperAmountOfMone
> yIntoAnAccountWillLeadToCallingUpdateOnAccountServiceForAccountWithIncrease
> dBalance(Double
> positiveAmount) in C:\Users\Dawid\Desktop\TestingFrameworks
> \TestingFrameworks\UnitTests\UnitTests.PlayingWithRhinoMocks
> \DepositSrvTest.cs:line 71
> ### Step
> DepositingProperAmountOfMoneyIntoAnAccountWillLeadToCallingUpdateOnAccountS
> erviceForAccountWithIncreasedBalance(54.2):
> failed ###
>
> And it would be nice to be informed which the Account object field was
> different.
>
> If not, then maybe you have some other ideas how to check it without
> debugging.
>
> Regards
> Dawid
--
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.