2

Closed

Resharper runner crashes when adding [Fact] at end of class (with fix)

description

Hi folks. I've got a bug where the resharper test runner crashes if you add the [Fact] attribute as the last thing in the body of a class. Easy to repro: Create a new class, and before adding a method signature, enter [Fact] - boom! the plugin crashes.

I've fixed the problem, but after noting a comment elsewhere on the site about IP agreements, it might be best if I just describe how I fixed it...

The problem is that in ProcessBeforeInterior in XunitFileExplorer, the name and document ranges are invalid when they're passed into UnitTestElementDisposition's constructor. The guard logic throws an exception. So I just pulled them out into variables and checked each's IsValid methods. Bob's your uncle.

Cheers
Matt
Closed Feb 21, 2009 at 10:22 PM by
Will be addressed in xunitcontrib at http://xunitcontrib.codeplex.com

comments