NSubstitute.Analyzers icon indicating copy to clipboard operation
NSubstitute.Analyzers copied to clipboard

NS2002 falsely triggered by optional ctor args

Open lonix1 opened this issue 2 years ago • 5 comments

NS2002 / Constructor parameters count mismatch

Here's a type:

public class Something {
  public Something(string? foo = "foo", int? bar = 10) {
    // etc.
  }
}

This triggers the analyzer:

Substitute.ForPartsOf<Foo>()

Those ctor args are optional.

lonix1 avatar Nov 17 '21 15:11 lonix1