Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
aleksei-saharov opened this issue Apr 14, 2020 · 2 comments

Comments

@aleksei-saharov
Copy link

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

TraitsCollectionAdd.Invoke(traitsCollection, new object[] { propertyName, propertyValue.ToString() });

@OsirisTerje
Copy link
Member

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 OsirisTerje added this to the 2.3 milestone May 6, 2020
@OsirisTerje OsirisTerje self-assigned this May 6, 2020
OsirisTerje added a commit that referenced this issue May 6, 2020
OsirisTerje added a commit that referenced this issue May 9, 2020
@OsirisTerje
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants