5 Replies Last post: Nov 5, 2013 2:56 PM by Asia Rudenko  
Anders Bech Mellson Newbie 14 posts since
Oct 24, 2011
Currently Being Moderated

Oct 31, 2013 2:29 PM

Profile Unit Test but not setup for that test

How do I get dotTrace to profile my unit test with a setup method without measuring the work that the setup method for that test does?

 

I am running Visual Studio 2013 with Resharper 8.0.2 and dotTrace 5.5.2

 

I am doing Line-by-line measurement with Wall Time CPU consumption.

 

Is there a measurement method or preference I can use to only profile the actual test method?

Or maybe I am doing it wrong

Asia Rudenko JetBrains 124 posts since
Nov 11, 2010
Currently Being Moderated
Oct 31, 2013 4:28 PM in response to: Anders Bech Mellson
Re: Profile Unit Test but not setup for that test

Hi Anders,

What unit testing framework do you use? I guess it's NUnit according to "setup", but please confirm

Asia Rudenko JetBrains 124 posts since
Nov 11, 2010
Currently Being Moderated
Nov 1, 2013 7:07 PM in response to: Anders Bech Mellson
Re: Profile Unit Test but not setup for that test

Hi Robert,

I've just checked this case, and dotTrace seems to distinguish Setup and Teardown from Test method. I've tried an elementary code:

 

namespace Support

{

    [TestFixture]

    public class NUnitTest

    {

        [SetUp]

        public static void SetUpMethod()

        {

            Thread.Sleep(2000);

        }

 

        [TearDown]

        public static void TearDownMethod()

        {

            Thread.Sleep(4000);

        }

 

        [Test]

        public static void NUnitTestMethod()

        {

            Assert.IsTrue(true);

            Thread.Sleep(3000);

        }

    }

}

 

And it produced the following result in the snapshot:

Setup.png

 

As you can see, both timing and method list look like these three methods are profiled separately. What is the difference in your case? Maybe you can send me an example of your code? My email is alexandar.rudenko@jetbrains.com.

Asia Rudenko JetBrains 124 posts since
Nov 11, 2010
Currently Being Moderated
Nov 5, 2013 2:56 PM in response to: Anders Bech Mellson
Re: Profile Unit Test but not setup for that test

No, it's impossible - dotTrace profiles everything that happens in the application

More Like This

  • Retrieving data ...