A nifty Typemock extension

Using AAA with Typemock there’s a bit of a problem if you want to repeat the returned value a number of times before then doing something different. It’s very useful if you are accessing a mocked object within a loop and want to know the number of loop…

Using AAA with Typemock there's a bit of a problem if you want to repeat the returned value a number of times before then doing something different. It's very useful if you are accessing a mocked object within a loop and want to know the number of loop execution. So I've put together a simple little Typemock extension (but I'm sure it'd adaptable for any mock framework supporting AAA): public static void WillReturnRepeat<TReturn>(this IPublicNonVoidMethodHandler ret, TReturn value, int numberOfReturns) { for (var i = 0; i < numberOfReturns; i++) ret.
Print Share Comment Cite Upload Translate
CITATION GOES HERE CITATION GOES HERE
Select a language: