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
0 votes
As the topic title states, can I used AAA and determine the number of times a method was called/ a property was accessed?

I'm going to have a mocked property on the class I'm testing, and I want to ensure that it's accessed twice.

If not what's the best way, Reflective Mocks? And how would I go about it?
asked by slace (2.4k points)

1 Answer

0 votes
Although we can add this feature to AAA we've decided against it as it is an anti pattern - it requires knowledge of internal behavior of the faked object.
If you must you can use reflective:
MockManager.GetMockOf(fake).GetCallCount("MethodName");
answered by dhelper (11.9k points)
...