Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Performance Testing using xUnit framework

I wonder if it is possible to run performance testing based on xUnit?

like image 736
Pavlo Neiman Avatar asked Jun 18 '10 07:06

Pavlo Neiman


1 Answers

Not sure what exactly you asking, but you can easily write your own custom attribute to do that. For an example..

[AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]
public class TraceAttribute : BeforeAfterTestAttribute
{

    public override void Before(MethodInfo methodUnderTest)
    {
        //Start timer
    }


    public override void After(MethodInfo methodUnderTest)
    {
        //End timer
    }
}

Then decorate your Unit Test with the this attribute. Also make sure you write to an output ;)

like image 139
Spock Avatar answered Sep 26 '22 02:09

Spock