I have a method that looks like this in a Presenter class.

        Public Sub DoSomething()

            ' navigate to the nested view
            ' use the data entered so far (if needed)
            Controller.Navigate("NestedView", Controller.DataDocument)

        End Sub

The Controller object in the code is a mocked object in my test.

Looking at this, it seemed simple to set the expectations for the
test.

     Dim dataDoc as new DataDocument()
     ' Mock the property Get accessor
     Rhino.Mocks.Expect.Call(mockController.DataDocument).Return
(dataDoc)
     LastCall.Repeat.Once()
     ' Mock the Controller void method call
     mockController.Navigate("NestedView", dataDoc)
     LastCall.Repeat.Once()

However, I was surprised to see that the test fails when the
expectation for the Navigate method is included.

Test method DoSomething_Test threw exception:
Rhino.Mocks.Exceptions.ExpectationViolationException:
IControllerBase.Navigate("TabWizard_NestedView", DataDocument);
Expected #1, Actual #0..

Take the Navigate void method call expectation out, and the test
passes.

Does anyone know why?



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