E539 Enhancement/1328 skip nullable params by bestsoftever · Pull Request #1513 · AutoFixture/AutoFixture · GitHub
[go: up one dir, main page]

Skip to content

Enhancement/1328 skip nullable params#1513

Open
bestsoftever wants to merge 4 commits intoAutoFixture:release/5.0.0from
bestsoftever:enhancement/1328-skip-nullable-params
Open

Enhancement/1328 skip nullable params#1513
bestsoftever wants to merge 4 commits intoAutoFixture:release/5.0.0from
bestsoftever:enhancement/1328-skip-nullable-params

Conversation

@bestsoftever
Copy link

Description

This PR allows GuardClauseAssertion to skip validation for parameters of nullable reference types.

Closed issues

Closes #1328

Checklist

  • Reviewed the contribution guidelines
  • Linked the issue(s) the PR closes
  • Implemented automated tests and checked coverage
  • Provided inline documentation comments for new public API
  • Ran the full solution build and validation locally

private static bool IsNullableReferenceType(ParameterInfo parameter)
{
#if NET6_0
var nic = new NullabilityInfoContext();
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we reuse a single static instance instead of creating it for each parameter?

Copy link
Author

Choose a reason for hiding this comment

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

Thanks @Kralizek, changed.

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.

2 participants

0