I've found that .NET Core 2.1 class libraries that call Newtonsoft's JSON.NET library to parse a JSON document fail in NCrunch.
Minimal example of a failing case:
Code:
public class Class1
{
[Test]
public void Test()
{
var doc = JObject.Parse("{}");
}
}
I get no coverage at all, and no error message as to why the test failed.
If I expand the test to separate the test from the method under test:
Code:
public class Class1
{
public void Example()
{
var doc = JObject.Parse("{}");
}
[Test]
public void Test()
{
Example();
}
}
I get an error on the calling Example() line, but no error or coverage in the Example() method. The error on the calling line is:
System.TypeLoadExceptionCould not load type 'System.Component.IBindingList' from assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'.
This is using NUnit, but MSTest seemed to display the same behavior.
If I create a separate .NET Core 2.1 Console Application that creates Class1 and calls Example(), that works fine when I run it.
Cheers,
Edouard.