Skip to content
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

Merged
merged 7 commits into from
Dec 4, 2023

Conversation

Shiney
Copy link
Contributor

@Shiney Shiney commented Oct 15, 2023

see nunit/nunit#1459 for when this was fixed

@SeanKilleen
Copy link
Member

It appears this is failing. @OsirisTerje do I need to bump the NUnit version to fix this or am I missing something?

@SeanKilleen
Copy link
Member

Also, thank you @Shiney for the contribution! Looking forward to getting it worked out and merged.

@OsirisTerje
Copy link
Member

@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.

@Shiney
Copy link
Contributor Author

Shiney commented Oct 16, 2023

@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 ?

@Shiney
Copy link
Contributor Author

Shiney commented Oct 16, 2023

And there isn't a more recent beta nuget package

@OsirisTerje
Copy link
Member

OsirisTerje commented Oct 16, 2023

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.

@Shiney
Copy link
Contributor Author

Shiney commented Oct 16, 2023

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.

@OsirisTerje
Copy link
Member

@Shiney Did you put the Ignore attribute on the class(Fixture) ? If you do that, the ctor will NOT be called.

@Shiney
Copy link
Contributor Author

Shiney commented Oct 16, 2023

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.

@OsirisTerje
Copy link
Member

@Shiney 4.0.0 and 4.0.1 is out now. Can you check this PR again ?

Copy link
Member

@SeanKilleen SeanKilleen left a 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!

@SeanKilleen SeanKilleen merged commit b010bb3 into nunit:master Dec 4, 2023
6 of 7 checks passed
github-actions bot pushed a commit that referenced this pull request Dec 4, 2023
…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
@Shiney
Copy link
Contributor Author

Shiney commented Dec 4, 2023

Thank you

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.

4 participants