Skip to content

NUnit integration #2

@mijay

Description

@mijay

I personally very like BenchmarkDotNet. But when you compare it with other micro-benchmarking tools for .NET you can note that it misses one quite useful feature - declarative definitions of benchmarks, like in pUnit.

To address this issue I wrote a small class CompetitionBase which now allows me to define benchmark competitions as follows:

public class FirstCompetition: CompetitionBase
{
    [Benchmark]
    public Action MethodA()
    {
        // smth
    }

    [Benchmark]
    public Action MethodB()
    {
        // smth
    }
}

This benchmark competition will be recognized by ReSharper as one NUnit test and can be executed directly from VisualStudio with one keystroke.

So my question is, whether you are interested to merge such "NUnit integration" feature to your library? If yes, I can create an appropriate pull-request with this code.

One problem that I can foresee for my implementation is that it will add an additional dependency to NUnit + it cannot be ported to MSTest due to its internal bug/limitations.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions