docs
docs copied to clipboard
In sprint test
Is there a way to categorize tests based on sprints dynamically without change the category of test in each sprint?
@santhosh-James I'm not sure exactly what you want to do. Can you provide an example and/or some code to make the question more concrete?
You can do something dynamic, if you use parametric tests and pass in TestCaseData
(which has a SetCategory
method). This will require you to change all your tests to be parametric. Another solution could be to decorate your tests with a custom attribute so you can have the "sprint" logic in one place.
Can you please an example of custom attribute ?
On Jul 6, 2020, at 3:42 PM, Mikkel Nylander Bundgaard [email protected] wrote:
@santhosh-James I'm not sure exactly what you want to do. Can you provide an example and/or some code to make the question more concrete?
You can do something dynamic, if you use parametric tests and pass in TestCaseData (which has a SetCategory method). This will require you to change all your tests to be parametric. Another solution could be to decorate your tests with a custom attribute so you can have the "sprint" logic in one place.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.
I'm still not sure exactly what you want to do, but you could make an attribute that implementes IApplyToTest
- https://github.com/nunit/docs/wiki/IApplyToTest-Interface - like the existing CategoryAttribute
- https://github.com/nunit/nunit/blob/master/src/NUnitFramework/framework/Attributes/CategoryAttribute.cs
Closed as answered