Skip to content

MSTEST0017 (Assertion arguments should be passed in the correct order) shouldn't warn if both arguments are literals #4299

@Youssef1313

Description

@Youssef1313

Describe the bug

If both arguments are literals, e.g:

Assert.AreEqual(0, 1);

we currently issue a warning, but following the codefix will still keep the warning.

We shouldn't issue a diagnostic when "both" arguments look like they should be "expected".

Currently, the above snippet will already produce MSTEST0025 (Use 'Assert.Fail' instead of an always-failing 'Assert.AreEqual' assert).

Metadata

Metadata

Assignees

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions