Visual Studio 2017, .Net CoreApp 1.1 (the target framework)
I need to write NUnit tests for my ASP.NET Core MVC web-application. I often used NUnit for my desktop-projects which were build on the base of .NET Framework 3.5-4.6.1.
I haven't the problem with xunit
but I would like to use nunit
.
Here I saw that at the current case I am to include such NuGet-packages:
- dotnet-test-nunit
- NUnit
But Test Explorer doesn't see my tests:
[TestFixture]
public class ProductTests {
[Test]
public void Name_Gets_ValidValue() {
var name = "Bob";
decimal price = 45.5M;
Product p = new Product() { Name = name, Price = price };
Assert.AreEqual(name, p.Name);
}
[Test]
public void Name_Gets_ValidPrice() {
var name = "Bob";
decimal price = 45.5M;
Product p = new Product() { Name = name, Price = price };
Assert.AreEqual(price, p.Price);
}
}
Hm... Ok. I tried to add NUnit3TestAdapter NuGet-package (I use it alwais), but this problem doesn't disappear.
How can I fix it?