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.
0 votes
Hi,

I really could need a method in MockManager that returns all active mocks, not just that of a certain type (like GetInstanceMocks or GetMockAll).
Method should look like this:
public static Mock[] GetAllMocks();


For example if you want to assure that any mock is strict a foreach is safer than coding this.xxxmock.Strict=true for every mock used, sometimes I forget one or two which leads to unpredictable test case results.

Can't be difficult to implement, am I right?

Would be nice 8) to have it in one of the next releases. Thanks!

Michael
asked by mknaup (8.5k points)

2 Answers

0 votes
Hi Mickael,
I really could need a method in MockManager that returns all active mocks, not just that of a certain type (like GetInstanceMocks or GetMockAll).
Method should look like this:
public static Mock[] GetAllMocks();



:idea: This is a sound idea, we will implement this in future versions.
answered by richard (3.9k points)
0 votes
This is supported in version 3.1
use GetMocks()
answered by scott (32k points)
...