Isn't this the same question you asked a little while ago? I think
it's maybe to do with you creating a stub rather than a mock... as
stubs aren't meant for asserting behaviour... (although I do recall a
grey area where they can be used like this)

2009/10/30 Tarpan <[email protected]>:
>
> Guys, Here is a simple test:
> TestClass calls the TestMock twice and there is a
> Assert...Repeat.Once. The test runs just fine.
> I know I'm doing something wrong. But what?
>
> -------------
> Imports MbUnit.Framework
> Imports Rhino.Mocks
>
> <TestFixture()> _
> Public Class AAA_test
>    <Test()> _
>    Public Sub Test1()
>        Dim TestMock As ITestMock = MockRepository.GenerateStub(Of
> ITestMock)()
>        Dim TestClass As CTestClass = New CTestClass
>        TestClass.test(TestMock)
>        TestMock.AssertWasCalled(Function(x) x.TestFunc, Function
> (options) options.Repeat.Once)
>    End Sub
> End Class
>
>
> Public Class CTestClass
>    Public Sub test(ByVal TestMock As ITestMock)
>        TestMock.TestFunc()
>        TestMock.TestFunc()
>    End Sub
> End Class
>
>
> Public Interface ITestMock
>    Function TestFunc() As Object
> End Interface
> ----------------
> >
>

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