Skip to content

Improve IsExactInstanceOfType error message for NULL value #7417

@drieseng

Description

@drieseng

Summary

Currently the IsExactInstanceOfType overloads produce an AssertFailedException when the input value is NULL, but these messages are not very clear:

Example

string? input = null;
Assert.IsExactInstanceOfType<string>(input);

Actual result:

Assert.IsExactInstanceOfType failed. 'value' expression: 'input'.

Proposed result:

Assert.IsExactInstanceOfType failed. 'value' expression: 'input'. 'value' was NULL.

Metadata

Metadata

Labels

Area: AssertionArea: MSTestIssues with MSTest that are not specific to more refined area (e.g. analyzers or assertions)

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions