Thanks again for contacting us.
Ideally, mocking tools fake a part of your code so that you can test SUT (System Under Test) as expected. Here If you are mocking a method from class B then you can use IgnoreInstance or future mocking to skip / assert that call. Furthermore it’s a best practice to move your logical code to a different method which will be called from the constructor and then it will be right to mock/assert that method.
Having logical codes (other than variable initialization) inside constructor makes a class more fragile and hard to mock. In addition, mocking tools should have some restriction to make developer write better code.
Finally, we have included the scenario into our product plan so that it is also possible to assert a constructor called with expected arguments although this is not always the best practice.
the Telerik team
Share what you think about JustTrace & JustMock with us, so we can become even better! You can use the built-in feedback tool inside JustTrace, our forums
, or our JustTrace