LuisFelipe
LuisFelipe

Reputation: 335

nUnit 3 on Visual Studio Community 2019

can anyone help me on running unit tests with nUnit on Visual Studio 2019? I've referenced nUnit3 and nUnit3TestAdapter on my project, so far so good, but when I try to run the tests, the output returns the following message:

========== Build: 0 succeeded, 0 failed, 2 up-to-date, 0 skipped ==========

It looks like has something outdated, but all references here are both NuGet packages above, someone knows how to fix it? It's a simples calculator to study TDD.

Upvotes: 1

Views: 1633

Answers (3)

Volodymyr Vedmedera
Volodymyr Vedmedera

Reputation: 114

You could try installing the Visual Studio Test Adapter extension on your VS. Simply download it from the marketplace and install, and try running your tests once more.

https://docs.nunit.org/articles/vs-test-adapter/Index.html

If it doesn't work - do provide more info regarding the output from Tests (there is a drop-down where you can select from where you want to read the output). Also, provide versions of NUnit and NUnit adapter packages you're using as well as what's the project type - .net core OR .net framework.

Upvotes: 1

Michał Cichoń
Michał Cichoń

Reputation: 90

You should paste your Output after build Tests because there should be information, why it doesn't work.

If you use .NET Core project you should get library - Microsoft.NET.Test.Sdk. If this doesn't help check the dependencies between your TestAdapter and NUnit3.

Upvotes: 1

I had the same issue. I did a few things at once, but I think what solved the issue for me was restarting Visual Studio, and deleting the Main function.

Upvotes: 1

Related Questions