drunkcod / Cone

8 stars 1 forks source link

Give all instances of an interceptor the same category #34

Open mattyas opened 6 years ago

mattyas commented 6 years ago

I have a few times wanted to include/exclude all tests using a specific interceptor. The possibility to add a category to all fixtures using it would solve the need.

Suggestion:

public interface ICategoryName
{
     string Category { get; }
}
public class UnicornInterceptor : ITestContext, ICategoryName
{
    public string Category => "Unicorns";

    public void After(ITestResult result)
    {
        //Clean unicorns
    }

    public void Before()
    {
        //Prepare unicorns
    }
}
drunkcod commented 6 years ago

Interesting suggestion. Will need to mull over the implications for a bit but I can see how this would be useful.