You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The 2nd line, and only the 2nd line is getting flagged with a CS8602. With a .Net Core 8 build this warning did not appear, it seemed to pick up the Is.Not.Null assertion and was satisfied with that. What is quite unusual is that if I add a null forgiveness "!" to the second line, the warning does not migrate to the 3rd or 4th lines, they do not produce the CS8602 warning.
CurrentPage, PageSize, and TotalRecords are all int properties of the view model. I don't like the idea of slapping null forgiveness bangs in my unit tests, and I do not like having builds littered with warnings to ignore. Adding bangs to the unit tests is a lesser evil but I wanted to raise this just to determine if this is a unexpected issue that can be fixed, or is there a better way to test scenarios like this. (Assert.Multiple had no impact on the warning)
The text was updated successfully, but these errors were encountered:
For example the following code:
where "given" is a BDD-style wrapper for the test:
The 2nd line, and only the 2nd line is getting flagged with a CS8602. With a .Net Core 8 build this warning did not appear, it seemed to pick up the
Is.Not.Null
assertion and was satisfied with that. What is quite unusual is that if I add a null forgiveness "!" to the second line, the warning does not migrate to the 3rd or 4th lines, they do not produce the CS8602 warning.CurrentPage, PageSize, and TotalRecords are all
int
properties of the view model. I don't like the idea of slapping null forgiveness bangs in my unit tests, and I do not like having builds littered with warnings to ignore. Adding bangs to the unit tests is a lesser evil but I wanted to raise this just to determine if this is a unexpected issue that can be fixed, or is there a better way to test scenarios like this. (Assert.Multiple
had no impact on the warning)The text was updated successfully, but these errors were encountered: