background

Telerik JustMock

Assert Call Order

  • JustMock provides you the functionality to verify the required call order.
  • Part of the fastest, most flexible and complete mocking tool for crafting unit tests.
  • Our award-winning support team is available to assist you with any issues.
Mocking and Assert Functionality
  • Assert Call Order Overview

    When the execution order of methods  is of extreme importance, JustMock provides you the functionality to verify the required call order by simply using the InOrder expectation when writing an arrangement.

    [TestMethod] 
    public void ShouldVerifyCallsOrder() 
    { 
        // Arrange 
        var foo = Mock.Create<IFoo>(); 
      
        Mock.Arrange(() => foo.Submit()).InOrder(); 
        Mock.Arrange(() => foo.Echo(Arg.AnyInt)).InOrder(); 
      
        // Act 
        foo.Submit(); 
        foo.Echo(5); 
      
        // Assert 
        Mock.Assert(foo); 
    }
    

    Verifying Calls Order

All JustMock Components

Next Steps