I think I've narrowed it down to the following behavior:
Test class with one xUnit Fact -- NCrunch does not ignore the fact and runs it
Test class with one xUnit Theory -- NCrunch ignores the theory and states there are no tests to run
Tesr class with a dummy xUnit Fact (e.g. true = true) and a Theory -- NCrunch no longer ignores the theory and runs it as I expect.
Is this a bug, or is it a setting somewhere? Sometimes when testing something, you need a theory and only a theory. Interested to know if others have had this same issue.
In order for NCrunch to detect that Xunit is being used by a test project, there must be a reference to at least one Xunit attribute. If you are using attributes that descend from the Xunit attributes and are not declared inside xunit.dll, this means you'll need to have somewhere a dummy '[Fact]' test to ensure the reference to Xunit can be identified.
Remco wrote:If you are using attributes that descend from the Xunit attributes and are not declared inside xunit.dll, this means you'll need to have somewhere a dummy '[Fact]' test to ensure the reference to Xunit can be identified.
This makes sense, because [Theory] is declared in xunit.extensions which I presume is a separate DLL because it's a separate Nuget package.
Could I please suggest that NCrunch consider expanding their search for attributes to within xunit and xunit.extensions? This would solve the problem, and broaden support for xunit since I belive xunit.extensions is an official xunit project.
SeanKilleen wrote:e [Theory] is declared in xunit.extensions which I presume is a separate DLL because it's a separate Nuget package.
Could I please suggest that NCrunch consider expanding their search for attributes to within xunit and xunit.extensions? This would solve the problem, and broaden support for xunit since I belive xunit.extensions is an official xunit project.
Sadly this is outside of NCrunch's control at the moment, as all interaction with Xunit goes via Gallio. This is something that is being fixed with the launch of Xunit V2, which will introduce NCrunch integration directly into Xunit.