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.
+1 vote
With dependency injection, we get the benefit that we can never "forget" to inject a (mock) dependency. Does TypeMock provide a way to get a similar asssurance?

For example, if a service is modified to use some new dependency, say a FileSystem object, and we forget to have tests mock it out, the test may still function, but it will become slow, and it can have undesirable side-effects such as creating files and folders. This is unlikely to be detected, whilst highly undesirable, particularly in the long run. It seems essential to prevent this scenario.
asked by Timovzl (3.1k points)

1 Answer

0 votes

You mean some Intelli-suggest on tests? This is not something we have at the moment but it is in our future plans.

We will add this scenario to our list.

 For now, we have the Isolate.Fake.Dependencies API

answered by Raphy (4k points)
I mean more than Intelli-suggest. I mean a setting so that if a class is changed to have new dependencies/components, tests should no longer build (or at least throw at runtime, which seems more doable). Otherwise, the test will unintentionally run with unmocked components, with all the possible side-effects.
Hi Timovzl,
I\'m sorry, but we don\'t provide this kind of service at the moment.

It\'s on our roadmap.