.NET 9 Tests RC 1 seems to handle empty collections differently in my project
Closed this issue · 2 comments
Describe the bug
While adding net9.0
tfm to a project a couple of my tests started to fail where snapshot
{
Item1: Accepted,
Item2: []
}
Became:
{
Item1: Accepted
}
Changing code from
// Then
await Verify(result);
to
// Then
await Verify(result)
.DontIgnoreEmptyCollections();
Sorted the issue with the tests that started failing,
Minimal Repro
Haven't created a minimal repro yet, but at least locally on my machine if I remove this line, the test will start to consistently assert differently on net9.0
than net8.0
.DontIgnoreEmptyCollections();
so omitting the empty collection is the correct behavior.
it was a bug that in earlier versions of .net it was included. that will be fixed in the next release of verify
i submitted a PR to Blobify to include empty collections by default devlead/Blobify#4
Thanks for the PRs, for be it would've been fine if they were omitting by default, what threw me was that it behaved differently in same test project based on TFM.