Build/Test Issues

2.11.0.12 and xUnit 2 beta 5 inherited tests

Started by Mpdreamz on 4,856 views

After upgrading to beta 5 of xUnit my inherited test cases were no longer found in NCrunch (but still are in the visual studio test explorer)


public abstract class TestsBase
{
    [Fact]
    public void FindMe() {
    }
} 

public class TestsChild : TestBase {
     [Fact]
     public void FoundMe() {
     }
}


FindMe() is not listed by NCrunch in this case but is by the default xunit visual studio runner.

NCrunch only finds FoundMe()

Hi, thanks for sharing this issue. I've immediately managed to reproduce it as you've described.

It looks as though this is specific to NCrunch's static analysis method. I'm not sure yet where the issue lies but will do my best to have it fixed for the release build of 2.11.

Meanwhile, you should be able to work around the problem by changing your 'Framework utilisation type for XUnit V2+' to 'DynamicAnalysis'. This is an NCrunch solution-level configuration setting.


Cheers,

Remco

Post a reply

Log in to reply.