Skip to content

Nunit Attributes Problems#8

Open
Pupka-Lipinski wants to merge 3 commits intogmarokov:masterfrom
Walter-Nagel-GmbH-Co-KG:master
Open

Nunit Attributes Problems#8
Pupka-Lipinski wants to merge 3 commits intogmarokov:masterfrom
Walter-Nagel-GmbH-Co-KG:master

Conversation

@Pupka-Lipinski
Copy link

Solves issues with Nunit Attributes like:

[TestCaseSource(typeof(WhereSelectLoadingTests), nameof(WhereSelectLoadingTests.TestCasesShowAll))] public void ShowAllData(List<Data> data, Int32 count) { ... }

Or

[Test] public void RandomManyLoad([Random(0, 3000, 50)] Int32 count) { ... }

The issue produce empty paths in the file tag "". Reason is that nunit writes parameter in method, like TestMethod.Name is "RandomManyLoad(1234)".
So we have to check if there is a parameter in unitTest.TestMethod.Name and remove that Parameter. So that methodRegex find the method. In Addition the methodRegex should accept methods with parameters.

Fix the file path in case the namespace path is not corresponding the file path.
Use the pdb (In case is generated) determine the real file path.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant