Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Bug? Test category isn't picked up when in Attribute but MSTest understands it
PaulMendoza
#1 Posted : Thursday, February 7, 2013 7:36:15 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 2/7/2013(UTC)
Posts: 1
Location: United States of America

I have NCrunch setup to only run unit tests that are marked with a test category of "Unit". I don't like having strings in my code so I made test attribute that exposes the category but NCrunch doesn't pick it up like all the other tools do.

I can write a TestCategory like this and it works.

[TestCategory("Unit")]

But if I use my custom attribute [UnitTest] it doesn't get run by NCrunch but tools like MSTest understand it.

public class UnitTestAttribute : TestCategoryBaseAttribute
{
public UnitTestAttribute()
{ }
public override IList<string> TestCategories
{
get { return new List<string> { "Unit" }; }
}
}

Please make this work.

Thanks,
Paul Mendoza
Remco
#2 Posted : Thursday, February 7, 2013 9:28:55 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,144

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
Hi Paul -

Thanks for posting!

As NCrunch uses metadata to identify categories for tests (instead of dynamic invoke), this approach to defining custom attributes currently isn't supported. I'll ensure its in the backlog for a future release.


Cheers,

Remco
Remco
#3 Posted : Saturday, March 30, 2013 9:52:21 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,144

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
For anyone interested, support for derived MSTest category attributes has been introduced with the newly released version of NCrunch (v1.45), although this will only work if you set the 'Framework utilisation type for MSTest' solution-level configuration setting to 'DynamicAnalysis'.
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAF | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.029 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download