moq
moq copied to clipboard
Constructor arguments should be nullable
The constructor arguments that are passed to a mocked class' constructor are now typed as object[], this causes a lot of unwarranted warnings when passing null, because the mocked class in question might actually allow null for its arguments. The type should be changed to object?[].
I'm running into this problem when constructing Mock<T>:
public Mock(params object[] args)
public Mock(MockBehavior behavior, params object[] args)
These should be changed to:
public Mock(params object?[] args)
public Mock(MockBehavior behavior, params object?[] args)