Skip to content

Result Message: OneTimeSetUp: Category name must not contain ',', '!', '+' or '-'  #1678

@CharliePoole

Description

@CharliePoole

@andrey-bushman commented on Fri Jul 15 2016

I want to group my tests on the base of tested method signature (one test checks return values, and also exist the individual tests for each out parameter checking). For getting this result I use the Category attribute:

[Category("LocalizedProduct.TryParse(String, out ILocalizedProduct)")]

But tests which was marked by such attribute value are failed with the message:

Result Message: OneTimeSetUp: Category name must not contain ',', '!', '+' or '-'

Why this restriction exists?

I could be use this variant:

[Category("LocalizedProduct.TryParse(String | out ILocalizedProduct)")]

But the comma using would be more legible for me at this case.


@CharliePoole commented on Fri Jul 15 2016

We don't allow characters that have a special meaning in NUnit TSL (Test Selection Language). See https://github.com/nunit/docs/wiki/Test-Selection-Language

It may be that the exclusion of the comma is obsolete - I'll have to check further.


@CharliePoole commented on Fri Jul 15 2016

An earlier version supported

--where "cat == A,B,C"

in place of the longer

--where "cat==A||cat==B||cat==C"

We have an outstanding issue asking us to restore the shorter syntax. We would have to decide about that issue before it could be possible to change this.

I'm going to go ahead and move this issue to the nunit project where it belongs.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions