Build/Test Issues

xUnit category not used

Started by tkarlsen on 5,474 views

I'm using xUnit 2.2 and I have some test classes marked as [Trait("Category", "UsesNetworkFiles")]. This worked fine in NUnit (with [Category("UsesNetworkFiles"]) to skip expensive tests when I'm running tests at home, but after switching to xUnit, NCrunch doesn't seem to detect the test category the same way. Is there a reason for this that I'm missing?
Hi, thanks for posting.

To my knowledge, this should create the same effect. If you turn on the 'Categories' column in the Tests Window, do you see the category correctly assigned to your tests?
Yes it did show the correct category, and that lead me down the path to dig a little deeper. I tried running the tests 3 times on two different machines, tried resynchronize/rebuild/rerun without any luck. One thing I hadn't tried was deleting the NCrunch cache directory, so I shut down VS and deleted it. When I fired VS back up the tests were excluded as expected! Thanks so much for the quick reply, sorry about the false alarm. I guess things got out of sync from switching testing frameworks.

Post a reply

Log in to reply.