Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unsupported test framework error in NUnit

I am using NUnit testing with Visual Studio 2013. We are using NUnitTestAdapter for integration of test run of NUnit with Visual Studio.

Visual Studio 2013 NUnit is version="3.0.1" NUnitTestAdapter version="2.0.0" .Net Framework 4.5.2

All packages are latest & installed from Nuget. There is no build error. We are getting error in test result window:

Attempt to load assembly with unsupported test framework in  D:\JuniorAchievement\Git\jaums\JA.UMS.Tests\bin\Debug\JA.UMS.Tests.dll

while running or debugging test using Visual Studio Test Explorer.

enter image description here

Test is able to run on one machine with same code on Visual Studio 2013 ultimate. We all other have Visual Studio 2013 professional version, although I doubt it has nothing to do with the problem.

Please Help.

Update

__________

After update to NUnit3 Test Adapter no error but still no test are discovered.

enter image description here

Somehow both Adapter are available but with Nuget & VS extension I can find only NUnit3 Test Adapter.

Installed NUnit3 Test Adapter from https://visualstudiogallery.msdn.microsoft.com/0da0f6bd-9bb6-4ae3-87a8-537788622f2d

like image 648
Pranav Singh Avatar asked Jan 28 '16 08:01

Pranav Singh


People also ask

Does NUnit support .NET framework?

NUnit is an open-source unit testing framework for the . NET Framework and Mono. It serves the same purpose as JUnit does in the Java world, and is one of many programs in the xUnit family.

How do I install NUnit framework?

Navigate to Tools -> NuGet Package Manager -> Manager NuGet Packages for Solution. Search for NUnit & NUnit Test Adapter in the Browse tab. Click on Install and press OK to confirm the installation. With this installation, the NUnit framework can be used with C#.

Where is NUnit framework DLL?

dll and NUnit framework DLL files that reside in the "\Program Files\NUnit 2.6. 2\bin\framework\nunit.

Is NUnit testing framework?

NUnit is a unit-testing framework for all . Net languages. NUnit is Open Source software and NUnit 3.0 is released under the MIT license. This framework is very easy to work with and has user friendly attributes for working.


Video Answer


3 Answers

It looks like you are trying to run NUnit3 tests with the NUnit2 Test Adapter. This is not supported.

You need to install the NUnit3 Test Adapter through Tools > Extensions and Updates in Visual Studio.

like image 160
Chris Avatar answered Oct 08 '22 01:10

Chris


NUnit 3.x.y (NUnit 3.4.1) is compatible with NUnit3TestAdapter 3.x.y (NUnit3TestAdapter 3.4.0) NUnit 2.x.y (NUnit 2.6.4) is compatible with NUnitTestAdapter 2.x.y (NUnitTestAdapter 2.0.0)

If you use NUnit 3.x.y you have to install NUnit3TestAdapter 3.x.y instead of NUnitTestAdapter 2.x.y

I am using Microsoft Visual Studio Community 2015 and Microsoft .NET Framework 4.x

Steps to follow for installation:
1. Open Visual Studio and create a project
2. Right click on project -> Click on "Manage Nuget Packages..." from context menu
3. From pop up window: Install NUnit 3.x.y and NUnit3TestAdapter 3.x.y
4. Now run your tests

enter image description here

like image 34
Ripon Al Wasim Avatar answered Oct 08 '22 01:10

Ripon Al Wasim


NUnit 3 only runs with NUnit test adapter 3 or latest version since there is compatibility issue with the older version 2.0. so if you have an exception like this:NUnit VS Adapter 2.0.0.0 discovering tests is started Attempt to load assembly with unsupported test framework in c:....... NUnit VS Adapter 2.0.0.0 discovering test is finished then all you need to do is to install the latest version of NUnit and NUnit test adapter on to your project be right clicking referencence on your solution explorer and manage Nuget packages.

like image 29
FuzzyDud Avatar answered Oct 08 '22 00:10

FuzzyDud