dotnet web sql business etc

19 квітня, 2011

Rhino Mocks: how to clear/reset expectations when using same test method several times

Today I faced a seemingly simple problem of running one unit test method with different parameters stored in arrays. When looping through the arrays of data, I was setting expectations for different set of arguments. Well, in the third loop, I have set the different expection results for the set of arguments equvalent to the one in loop number two. Althrough I have "overriden" the expectation, the test method was still using the first expectation set. The solution was to add Repeat.Once() call to the end of the expectation set line to make sure it is used only once.

Мітки: ,

0 коментарі(в):

Дописати коментар

Підписка на Дописати коментарі [Atom]

<< Головна сторінка