News for hackers. Stuff that matters.
Re:Stop requiring only one assertion per unit test: Multiple... by torginus on Saturday November 05, 2022 @08:37AM (#33480833)
xUnit is terrible. It has a horrible culture, the author seems to have a god complex. It is overly complex and opinionated in the worst way possible.

Many times I searched for 'how do I do something with xUnit' and found a github issue with people struggling with the same thing, and the author flat out refusing to incorporate the feature as it was against his principles.

Other times I found that I needed to do was override some core xUnit class so it would do the thing I wanted it to do - sounds complex, all right lets see the docs. Oh there are none, 'just read the source' according to the author.

Another thing that bit us in the ass is they refused to support .NET Standard, a common subset of .NET Framework and Core, making migration hell.

Re:Stop requiring only one assertion per unit test: Multiple... by HereBeBeasties on Saturday November 05, 2022 @09:06AM (#33481036)
NUnit isn't much better. You'd think that they would have good test coverage and therefore high confidence to make changes, especially to fix actual bugs, but I gave up trying to get patches in because the core devs seem so afraid of breaking anything, even when it's an obviously-isolated private, hidden bug fix or performance improvement.

"We can't land this tiny fix because we have a release planned within three months" sort of thing.

Re:Stop requiring only one assertion per unit test: Multiple... by torginus on Saturday November 05, 2022 @09:34AM (#33481312)
Tbh, one of the differences between xUnit and nUnit, is the way generated test cases work, like specifying test cases in an xml file. nUnit has the TestCaseSource attribute for this, while xUnit has the Fact attribute.

One of the key differences, is there are no test cases generated, nUnit tests just wont run, while xUnit will throw.

Since it's completely legal and sensible for a certain kind of test to have no entries in an xml, we needed to hack around this quirk. When I (and countless others) have mentioned this on the xunit github, the author berated us that how dare we request this.

So nUnit might be buggy, but xUnit is fundamentally unfixable.

Re:Stop requiring only one assertion per unit test: Multiple... by zdragnar on Saturday November 05, 2022 @05:20PM (#33485909)
How ironic, a unit test framework is so fragile and poorly covered by tests they are not able to determine if a change would cause any regressions.
Re:Stop requiring only one assertion per unit test: Multiple... by codenesium on Saturday November 05, 2022 @09:38AM (#33481356)
I'm curious what things you're trying to do that requires you to overload xunit classes? We use xunit for everything and haven't found any gaps so far.