in

TFS Advantage

Furthering Continuous Integration Efforts on Microsoft Visual Studio Team System Team Foundation Server

Coverage issue

Last post 06-27-2008 10:12 AM by tim. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 06-26-2008 9:32 AM

    • dann
    • Top 10 Contributor
    • Joined on 06-26-2008
    • Alexandria, MN
    • Posts 1

    Coverage issue

    Quick question:

    Usually I'm in the habit of putting a try-catch block around code "just for the heck of it", especially if that code contains a call to an external 3rd-party library.  This seems like a good practice to make sure all exceptions are handled gracefully.  However, when unit testing and trying for 100% coverage, it has presented a problem in that often I can't really come up with a test that will exercise the exception handler.  This leads to < 100% coverage, which is a pain and does not make for nice round numbers in coverage.

    Any suggestions?

    Filed under:
  • 06-27-2008 10:12 AM In reply to

    • tim
    • Top 10 Contributor
    • Joined on 05-08-2008
    • Posts 19

    Re: Coverage issue

    Check out the ExpectAndThrow method in Typemock.  It is documented in the help file and there should be examples in the Typemock example solutions.

    Tim Bassett
    Principle Partner - TFSAdvantage
Page 1 of 1 (2 items)
Hound Dog Enterprises, LLC
Powered by Community Server (Non-Commercial Edition), by Telligent Systems