Skip to content

Improve handling of incorrect calls to Assert.AreSame #4352

@bjornhellander

Description

@bjornhellander

It is currently possible to call Assert.AreSame with value reference types. The assertion will fail when the test is run, but it would be better if

  1. this was not possible at all (by constraining the generic type parameter), or
  2. an analyzer could warn immediately about calls that will fail

Not a big problem since the test will fail, but would be nice since it would shorten the time before the mistake was discovered.

Metadata

Metadata

Assignees

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions