We are excited to bring you the latest service pack release for Telerik JustMock. In this blog post I will elaborate on the important improvements and bug fixes we have introduced.
We have received reports that in some cases when a DoNothing or Throw methods are used, an InvalidCastException is thrown for cast to “System.AppDomainSetup” when the tests are executed for a .NET Core 3.0 project. This issue is now fixed.
We have encountered a problem where a conditionally created mock created in a test setup method has leaked for other tests as well. Additional requirements for the bug to occur were the lack of defined corresponding test cleanup method and the project to target .NET Core. We have fixed the issue by improving the implicit generation of a test cleanup method when missing and calling Mock.Reset from the newly-generated method.
This is a bit of a complex scenario. To solve the problem, you would have to create a mock with loose behavior of specific class. Let’s call it Foo. Then you will need to create a future mocking of Foo with returning the already created foo mock. Then in a static class, let’s call it Bar, a static field must be initialized with value from a newly-created instance of Foo. Later in the test when an arrangement is made for some of the static methods of Bar, the behavior of the foo mock is not taken into account and this results in unwanted recursive loose behavior instead of just loose behavior. Like I said it’s a bit of a complex scenario. Fortunately, it's fixed now.
The R3 2019 Service Pack is already available for download in customers’ accounts. If you explore JustMock, you can learn more. It comes with a 30-day free trial, giving you some time to test its capabilities.
We would love to hear what you think, so should you have any questions and/or comments, please share them in our Feedback Portal.
You can also check our Release History page for a complete list of the included improvements.
Mihail Vladov is a Software Engineering Manager at Progress. He has more than a decade of experience with software and product development and is passionate about good software design and quality code. Mihail helped develop the WPF controls suite and Document Processing libraries which are used by thousands of developers. Currently, he is leading the JustMock team. In his free time, he loves to travel and taste different foods. You can find Mihail on LinkedIn.