Skip to content

Add the ability to use params arguments properly when using a parametrised test fixture - #4478

Merged
OsirisTerje merged 9 commits into
nunit:masterfrom
Shiney:params-in-test-fixture
Oct 14, 2023
Merged

Add the ability to use params arguments properly when using a parametrised test fixture#4478
OsirisTerje merged 9 commits into
nunit:masterfrom
Shiney:params-in-test-fixture

Conversation

@Shiney

@Shiney Shiney commented Oct 2, 2023

Copy link
Copy Markdown
Contributor

Added some tests for this and made the methods that call the constructors on TestFixtures able to allow params arguments. This doesn't really address the duplication with similar code for calling test methods but that didn't seem particularly quick to also fix as part of this.

Fixes #1459

@manfred-brands manfred-brands left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Shiney for your contribution.
I only have a few small comments.

Comment thread src/NUnitFramework/framework/Internal/Reflect.cs Outdated
Comment thread src/NUnitFramework/testdata/TestFixtureSourceData.cs Outdated
Comment thread src/NUnitFramework/tests/Attributes/ParameterizedTestFixtureTests.cs Outdated
Comment thread src/NUnitFramework/framework/Internal/Reflect.cs
Comment thread src/NUnitFramework/framework/Internal/Reflect.cs
@Shiney

Shiney commented Oct 9, 2023

Copy link
Copy Markdown
Contributor Author

Hi @manfred-brands I tried to do your comments about swapping the order of the checks but it didn't seem to end up making the code much nicer in my opinion because it ended up having to do all sorts of extra special code to deal with the case where zero parameters provided were used for the params argument

Comment thread src/NUnitFramework/framework/Internal/Reflect.cs Outdated
@manfred-brands

Copy link
Copy Markdown
Member

@Shiney I tried to push my review changes, but you didn't allow maintainers to update the fork.
Could you please address the other outstanding issues.

@Shiney

Shiney commented Oct 12, 2023

Copy link
Copy Markdown
Contributor Author

Yes will do this soon

@Shiney

Shiney commented Oct 14, 2023

Copy link
Copy Markdown
Contributor Author

I believe I've fixed all the comments and have ticked the Allow edits by maintainers button just in case

@manfred-brands

Copy link
Copy Markdown
Member

Thanks @Shiney. I have fixed some spacing issues as earlier this week we enabled enforcing these rules.

@manfred-brands
manfred-brands self-requested a review October 14, 2023 09:22

@manfred-brands manfred-brands left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing further.

@OsirisTerje
OsirisTerje merged commit 18ddf7c into nunit:master Oct 14, 2023
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.

Support for params keyword in parameterized test fixtures

3 participants