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

Should allow null references as constructor parameters. #1416

Open
WalkerCodeRanger opened this issue Sep 3, 2023 · 1 comment
Open

Should allow null references as constructor parameters. #1416

WalkerCodeRanger opened this issue Sep 3, 2023 · 1 comment

Comments

@WalkerCodeRanger
Copy link

The overloads of new Mock<T>() that take params object[] args to pass on to the constructor of the class ought to allow null arguments (e.g. object?[] args).

@stakx
Copy link
Contributor

stakx commented Sep 4, 2023

null is definitely allowed, see e.g. here:

https://github.com/moq/moq/blob/06d88ec526b2d879fa3520e4daed3abcd451953e/src/Moq/Mock%601.cs#L305-L308

What is missing, however, are nullable reference type annotations in all of Moq's public API. It would be nice to add those sometime.

P.S.: regarding these annotations, I've opened a separate issue for them; see #1418.

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

No branches or pull requests

2 participants