On Mon, Mar 15, 2010 at 11:48 AM, BaRuSa <[email protected]> wrote: > The one detail I am still stuck on is that the manager only seems to > shift the testing location and therefore shift the problem. The new > class would make it easier to test the functionality of AddItems. I > don't see how to test that PreAdd is calling SuspendLayout or the > various other offending methods. It there a different method for > testing this step works as expected?
The sample code I showed only amounted to two lines of executable code (one call to SuspendLayout and one to ResumeLayout). To be honest, I wouldn't bother writing a unit test for that. There just isn't much that can go wrong in that code. I don't see a need to write a test. > At one point code coverage was the main metric to determine whether > the unit testing process was complete. I could imagine that reducing > the number of calls to the SuspendLayout to one location in PreAdd > would potentially increase code coverage by changing the ratios of > testable to untestable code. Of course, I do wonder does the moderen > unit test developer concern themselves with code coverage? (aka am I > stuck on a detail that reall isn't THAT important anymore???) I used to think 100% code coverage was a good benchmark. I still think code coverage is an important metric to know that your tests are hitting everything, but I also value testability and separation of concerns too. --- Patrick Steele http://weblogs.asp.net/psteele -- You received this message because you are subscribed to the Google Groups "Rhino.Mocks" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rhinomocks?hl=en.
