nunit / nunit-vs-adapter

Runs NUnit V2 tests inside the Visual Studio 2012 or later Test Explorer window.
MIT License
50 stars 43 forks source link

NUnit adapter is failing when PropertyAttribute is used with NULL value #189

Closed aleksei-saharov closed 4 years ago

aleksei-saharov commented 4 years ago

VS2019 nunit-vs-adapter NUnit 2.6.4

I have faced with a NullReferenceException in this adapter. If at least one test in a selected group has the following structure, then adapter is failing and no tests will be run:

[Property("SomeKey", null)]
public void Test()
{

}

I guess it is related to this ToString() call https://github.com/nunit/nunit-vs-adapter/blob/be6d50a55446df9ca1ebaa27203e87ce319e03d4/src/NUnitTestAdapter/TraitsFeature.cs#L94

OsirisTerje commented 4 years ago

Good spotting ! I am not sure how the test explorer will work if we add a null value there, but we can try that first. If not, it can be converted to an empty string.

OsirisTerje commented 4 years ago

@aleksei-saharov Released a beta version, see https://www.nuget.org/packages/NUnitTestAdapter/2.3.0-beta01