locked
Why does the duration of a unit test result not equal the difference between start and end time? RRS feed

  • Question

  • I've written a test for a long running process. when it completes, I get the following displayed in the test results:

    Test Run: [blah]

    Test Name: PopulateDataTest

    Result: Passed

    Duration: 00:03:17.0017261

    Computer Name: [name here]

    Start Time: 3/8/2011 12:54:18 PM

    End Time: 3/8/2011 1:02:31 PM

     

    doing some math on the start and end dates, I get about 8 minutes, not 3. What am I missing?

    • Moved by eryang Wednesday, March 9, 2011 1:59 AM (From:Visual Studio Code Analysis and Code Metrics)
    Tuesday, March 8, 2011 9:19 PM

Answers

  • ClassInitialize and ClassCleanup time isn't included in the test duration.  Have you got any code in either of those methods?

    I'm not sure if the time needed to set up the TestContext for data driven tests is included (I haven't checked).


    blog: http://www.richard-banks.org podcast: http://www.talkingshopdownunder.com
    Wednesday, March 9, 2011 2:31 AM

All replies

  • I move this thread to Visual Studio Unit Testing forum for better support.
    Eric Yang [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Wednesday, March 9, 2011 1:57 AM
  • ClassInitialize and ClassCleanup time isn't included in the test duration.  Have you got any code in either of those methods?

    I'm not sure if the time needed to set up the TestContext for data driven tests is included (I haven't checked).


    blog: http://www.richard-banks.org podcast: http://www.talkingshopdownunder.com
    Wednesday, March 9, 2011 2:31 AM