-
Notifications
You must be signed in to change notification settings - Fork 157
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update TestFixtureAttributeExamples.cs To give an example of using params in a constructor #807
Conversation
…rams in a constructor
Fix issues with example code
docs/snippets/Snippets.NUnit/Attributes/TestFixtureAttributeExamples.cs
Outdated
Show resolved
Hide resolved
It appears this is failing. @OsirisTerje do I need to bump the NUnit version to fix this or am I missing something? |
Also, thank you @Shiney for the contribution! Looking forward to getting it worked out and merged. |
@Shiney Can you fix the tests please? @SeanKilleen Don't believe this is the 4.0, but it should refer to 4.0.0-beta.1 for other examples. |
@OsirisTerje How is this done? The problem seems to be that the two extra uses of TestFixtureData only work with a very recently merged change on the main NUnit repository but the snippets are built against 4.0.0-beta.1 ? |
And there isn't a more recent beta nuget package |
Then add an Ignore attribute to it, with a text saying that it waits for the next version, or a version > beta.1 :-) It will just be a few days anyway, but then it will build. |
Hmm seems like it still fails to run the constructor regardless of any ignore attributes etc. on this, let's just wait until the next nuget package is used to progress this. |
@Shiney Did you put the Ignore attribute on the class(Fixture) ? If you do that, the ctor will NOT be called. |
Yes. I still had the error. The code for checking if a constructor exists that we can call and actually calling it are in different places, so presumably I'm getting that error instead. |
@Shiney 4.0.0 and 4.0.1 is out now. Can you check this PR again ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Shiney thanks for this contribution!
With the latest of main merged in, the snippets build now works as expected.
There's one failure on the build but that's unrelated; it's because of a docs build change that doesn't get picked up in this PR.
Going to go ahead and merge this now. Thank you again!
…rams in a constructor (#807) * Update TestFixtureAttributeExamples.cs To give an example of using params in a constructor * Update TestFixtureAttributeExamples.cs Fix issues with example code * Update testfixture.md * Fix: trailing markdown space * Fix code snippet * use nullable string for nullable field --------- Co-authored-by: Sean Killeen <[email protected]> b010bb3
Thank you |
see nunit/nunit#1459 for when this was fixed