In this tutorial, we will create an NUnit Test class with multiple Test Cases, implemented in C#.
The test case validates a Calculator class and exploits some NUnit features such as the ability of validating the same Test against multiple input values, and also the possibility of linking Tests with requirements in Jira using NUnit's Test attributes.
After successfully running the Test Case and generating the NUnit XML report (e.g., TestResult.xml), it can be imported to Xray (either by the REST API or through the Import Execution Results action within the Test Execution).
NUnit's Test Case is mapped to a Generic Test in Jira, and the Generic Test Definition field contains the namespace, the name of the class, and the method name that implements the Test case.
The Execution Details of the Generic Test contains information about the context, which in this case corresponds to the Test case method, along with the different input values that were validated.
It can also be seen that the Test "CanAddNumbers" was automatically linked to the sum requirement (i.e., the user story "CALC-1").