chevron-thin-right chevron-thin-left brand cancel-circle search youtube-icon google-plus-icon linkedin-icon facebook-icon twitter-icon toolbox download check linkedin phone twitter-old google-plus facebook profile-male chat calendar profile-male
Welcome to Typemock Community! Here you can ask and receive answers from other community members. If you liked or disliked an answer or thread: react with an up- or downvote.
0 votes
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]
asked by alexdresko (1.7k points)

1 Answer

0 votes
Hi

Sorry :(
Currently TypeMock.NET does not support verifying that your
expectations are called in order.
I will add that to our feature list.
answered by ohad (35.4k points)
...