|
From: Steve F. <st...@m3...> - 2004-02-11 23:06:01
|
An interesting idea, but could you do more to make the current case more
readable, like having a more explanatory test name:
SetsCategoryInViewFromCategoryProviderForGivenName
Also, you can set the name of the Mock if the class isn't explanatory
enough.
S.
Nick Robinson wrote:
> I am wondering what peoples thoughts are on commentable Verify calls to the
> mock object? It seems I sometimes feel a little more information would be
> extremely beneficial, especially if more than one mock object is involved in
> a set of object messages:
>
> [Test]
> public void SelectCategory()
> {
> _view.Expect("SetCategories", _computers.SubCategories);
> _categoryProviderMock.ExpectAndReturn("Find", _computers.SubCategories,
> "Computers");
> _controller.SelectCategory("Computers");
>
> _view.Verify("The controller has not called back into the view");
> _categoryProviderMock.Verify();
> }
>
> In this instance, albeit simple, the message goes a long way in explaining
> the failure better to the reader (at least I think so).
|