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
May i know that whether there is an "ExpectAndReturnAlways" function?
asked by clteh9 (5.3k points)

3 Answers

0 votes
The method 'AlwaysReturn' in Mock class will do the work... 8)
See the documentation here
answered by ohad (35.4k points)
0 votes
The method 'AlwaysReturn' in Mock class will do the work... 8)
See the documentation here

Hi,

I think the AlwaysReturn is not consistent with the overall naming convention, don't you think so? ExpectAndReturnAlways would be better.

We have ExpectConstructor and ExpectConstructorAlways.

We have ExpectGet and ExpectGetAlways.

We have ExpectSet and ExpectSetAlways.

....

But we have ExpectAndReturn and AlwaysReturn?
________
Tribe Toyota Malaysia
answered by nsoonhui (59.1k points)
0 votes
Hi,

Thank you for the suggestion.

We do welcome suggestions for better consistency and readability. We do need however to take into account breaking existing code. So a process of changing APIs is not that simple.

So - we'll see what we can do.
answered by gilz (14.5k points)
...