Skip to content

Substitute.For and Substitute.ForPartsOf no longer allow null parameters #978

Description

@sensslen

Describe the bug
When upgrading to NSubstitute version 6 I can no longer pass null parameters to Substitute.For and Substitute.ForPartsOf even though the abstract class constructor explicitely allows null values

To Reproduce

  • Create an abstract class with a constructor taking a nullable string.
  • Create a Substitute using Substitute.ForPartsOf(null);

Expected behaviour
I should be allowed to pass in null values when the receiving parameter allows null values

Environment:

  • NSubstitute version: 6.0.0

References
Relates to #973

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugReported problem with NSubstitute behaviour

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions