I got a test that passes (which it shouldn't, as far as I can see)
except when I run it in debug mode and step through the code. When I
step through the code the test fails.
This is what the test looks like:
Protected Overrides Sub Context()
mockedView = MockRepository.GenerateMock(Of
IObjectSelectionView)()
stubbedDomain = MockRepository.GenerateStub(Of
ObjectSelectionDomain)()
End Sub
<Test()> _
Public Sub It_should_return_a_valid_validationresult()
' Arrange
stubbedDomain.Stub(Function(e As ObjectSelectionDomain)
e.GetObjects(Nothing, Nothing)).IgnoreArguments().Return(New List(Of
ObjectDto)).OutRef(New ValidationResult("Error!"))
mockedView.Expect(Function(x) x.ErrorMessages).Repeat.Never()
' Act
Dim presenter As ObjectSelectionPresenter = New
ObjectSelectionPresenter(mockedView, stubbedDomain)
presenter.GetObjects()
' Assert
mockedView.AssertWasNotCalled(Function(x) x.ErrorMessages)
End Sub
The stub seems to work OK, when I step throught the code. The
ValidationResult is correctly outref:ing the "Error!" message. And
when the ValidationResult is returning an error message the
mockedView.ErrorMessages is called.
The thing is that since I am expecting mockedView.ErrorMessages never
to be called, I want the test to fail. However the test only fails in
debug mode + when I step through the code. Not when running the tests
as "normal" or via command line using NUnit.
Am I doing something awkward with RhinoMocks?
Thanks!
--
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.