How can I tell TypeMock to require that my expectations are called in order? For example, the following test passes as expected.
Public Sub OrderMethod(ByVal view As GP2.Views.IBaseView, ByVal control As GP2.Controls.IControl)
If Not view.IsPostBack Then
control.Visible = False
End If
End Sub
<TestMethod()> Public Sub TestOrdering()
Dim view As GP2.Views.IBaseView = CType(RecorderManager.CreateMockedObject(GetType(GP2.Views.IBaseView)), GP2.Views.IBaseView)
Dim control As GP2.Controls.IControl = CType(RecorderManager.CreateMockedObject(GetType(GP2.Controls.IControl)), GP2.Controls.IControl)
Using recorder As New RecordExpectations
recorder.ExpectAndReturn(view.IsPostBack, False)
control.Visible = False
End Using
OrderMethod(view, control)
End Sub
But the test still passes (unexpectedly) if I change the OrderMethod as follows
[/code
Public Sub OrderMethod(ByVal view As GP2.Views.IBaseView, ByVal control As GP2.Controls.IControl)
control.Visible = False
If Not view.IsPostBack Then
End If
End Sub]