Completed
Last Updated: 16 Sep 2021 08:38 by ADMIN
Ivo
Created on: 28 May 2021 11:14
Type: Bug Report
0
InOrder arrangement clause cannot accept more than one call of the arranged method subsequently

The following test fails:

[TestMethod]
public void TestCallOrderWithInOrder()
{
	// Arrange
	var mockClass1 = Mock.Create<Class1>();
	var mockClass2 = Mock.Create<Class2>();

	Mock.Arrange(() => mockClass1.Method1())
		.InOrder();
	Mock.Arrange(() => mockClass2.Method1())
		.InOrder()
		.Occurs(2);
	Mock.Arrange(() => mockClass1.Method2())
		.InOrder();

	// Act
	mockClass1.Method1();

	mockClass2.Method1();
	mockClass2.Method1(); // <--- this call is not allowed by
						  //      InOrder clause currently 
						  //      and throws AssertFailedException

	mockClass1.Method2();

	// Assert
	Mock.Assert(mockClass1);
	Mock.Assert(mockClass2);
}

1 comment
ADMIN
Mihail
Posted on: 17 Aug 2021 07:21

The issue is fixed and it is available with the R2 SP1 2021 version 2021.2.615.4.

Regards,
Mihail
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.