Test maintainance: add missed tests and removing xUnit1013 warning#462
Test maintainance: add missed tests and removing xUnit1013 warning#462moh-hassan merged 4 commits intocommandlineparser:developfrom moh-hassan:fix/missed-tests
Conversation
|
I notice you have fixed the test by changing the copyright check to ... This is probably correctly for the build server but unfortunately still fails on my local machine because I use Ncrunch (continuous test runner) and so the assumption about the name of the test-runner is incorrect. I would suggest simply not testing the copyright lines OR raising a feature request to ensure that the lines are consistent with the .net framework build. |
|
NCrunch is a good testing suit but it's commercial (not free). I can modify the PR and set these copyright values as a constant in a separate class so you can replace your constant values during local test. All I did in my local machine is run the command: Is there any constraint in your development Environment of using dotnet test with Xunit? |
|
My point is more that you really don't want to discourage contributors from running local unit tests and hard-coding an assumption on the test-runner is bad practice for plenty of reasons - not least of which you might one day change your build system and some future maintainer will then by mystified by the fact that half the unit-tests break ;-) A unit test should really not be relying on an 'external' variable such as the name of the calling process. |
|
I agree with you that unit test should really not be relying on an 'external' variable. You can exclude these copyright tests from the test case and continue using NCrunch . |
|
Here is a better fix (also better than my local changes)… Bearing in mind the intention of the test is to establish that the help-text contains the copyright info you can use
which works for all platforms and test runners! |
|
Ok- here are the two lines you want to use. These are platform independent so you can get rid of the #if check.... Establishing that the ReflectionHelper (which is used by HeadingInfo and CopyrightInfo) does correctly pull attributes from the assembly is a separate concern and should be tested separately. |
|
Good solution. |
|
@NeilMacMullen |
|
hooray! :-) Are you planning to merge this back to develop? If so I will integrate it with my PR. |
|
Yes, I plan to merge it with other PRs including your PR in develop. |
…endent and testsuit independent
…ing across tests
Add missed tests in v2.4.3 which were reported by @ericnewton76 (18 test case)
Remove the xunit test warning
xUnit1013:Fix Xunit warning: Skipping test case with duplicate ID
Fix Xunit warning: xUnit1014- MemberData should use nameof operator to reference member