NUnit vs. xUnit

At the time of writing this answer, the latest NUnit version is v3.5 and xUnit.net is v2.1. Both frameworks are awesome, and they both support parallel test running (in a different way though). NUnit has been around since 2002, it’s widely used, well documented and has a large community, whereas xUnit.net is more modern, more … Read more

Visual Studio 2015 or 2017 does not discover unit tests

To my surprise, clearing temp files located in the %TEMP% directory resolved the issue for me. Note: This path is generally at C:\Users\(yourusername)\AppData\Local\Temp As @Warren-P included, you can navigate to the temp folder by putting in %temp% in Start Menu, or launch “File Explorer” and enter %temp% in the address bar.

What is the JUnit XML format specification that Hudson supports?

I did a similar thing a few months ago, and it turned out this simple format was enough for Hudson to accept it as a test protocol: <testsuite tests=”3″> <testcase classname=”foo1″ name=”ASuccessfulTest”/> <testcase classname=”foo2″ name=”AnotherSuccessfulTest”/> <testcase classname=”foo3″ name=”AFailingTest”> <failure type=”NotEnoughFoo”> details about failure </failure> </testcase> </testsuite> This question has answers with more details: Spec. for … Read more

Assert an Exception using XUnit

The Assert.Throws expression will catch the exception and assert the type. You are however calling the method under test outside of the assert expression and thus failing the test case. [Fact] public void ProfileRepository_GetSettingsForUserIDWithInvalidArguments_ThrowsArgumentException() { //arrange ProfileRepository profiles = new ProfileRepository(); // act & assert Assert.Throws<ArgumentException>(() => profiles.GetSettingsForUserID(“”)); } If bent on following AAA you … Read more