The warnings may very well be a quirk of VS 2022 Text Explorer.
I replicated a similar setup and didn't encounter a warning in JetBrains Rider, VS Code, or from the terminal with dotnet test
.
Maybe try either of the above options as well and see if you run into similar warnings?