Doxense / foundationdb-dotnet-client

C#/.NET Binding for FoundationDB Client API
BSD 3-Clause "New" or "Revised" License
149 stars 33 forks source link

Update to NUnit 4.0 #130

Closed KrzysFR closed 11 months ago

KrzysFR commented 11 months ago

NUnit 4.0 is now released, we should update to it.

I think the only potential issue would be the end of support for the legacy assertions, like "Assert.AreEqual(...)". I already tracked and converted a lot of old assertions into the Assert.That(...) form a long time ago, but maybe a few remain here and there?

There is also a few "hacks" to make logging work properly with NUnit test runners, especially to have real time logs in Visual Studio, when running them using a runner like Resharper. Hopefully these still work, or are not needed anymore!

KrzysFR commented 11 months ago

It seems most of the issue are about converting assertions with a String.Format-like shape into string interpolations (FormattableString), so

From:

Assert.That(bits, Is.EqualTo(kv.Count), "{0} has invalid count", kv.Value);

to:

Assert.That(bits, Is.EqualTo(kv.Count), $"{kv.Value} has invalid count");
KrzysFR commented 11 months ago

Completed by #131