Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MSTest v3 nullability on assertions should be more permissive #1451

Closed
Evangelink opened this issue Dec 12, 2022 · 3 comments · Fixed by #1467
Closed

MSTest v3 nullability on assertions should be more permissive #1451

Evangelink opened this issue Dec 12, 2022 · 3 comments · Fixed by #1467
Assignees
Milestone

Comments

@Evangelink
Copy link
Member

Describe the bug

Most of the assertions APIs in MSTest v2 were supporting null values and would fail in case of null without forcing Assert.IsNotNull before. In MSTest v3, most of the APIs are expecting non-nullable entries.

Steps To Reproduce

StringAssert.StartsWith(nullableString, "something"); // potential null warning
@Evangelink
Copy link
Member Author

Looking at the code this doesn't seem like a regression or bad design because the API would always fail in case of null values so it's better to warn the user that we don't expect null otherwise the API would fail.

@Evangelink
Copy link
Member Author

Reopening the issue. After more internal chat we decided that it would be easier to allow nullable and maybe revisit for a "stricter" mode in the future (either in a breaking change or through different APIs/package).

@Evangelink Evangelink reopened this Dec 14, 2022
@Evangelink Evangelink changed the title MSTest v3 nullability on assertions was more permissive MSTest v3 nullability on assertions should be more permissive Dec 16, 2022
@Evangelink
Copy link
Member Author

Fixed by #1467

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment