Visual Studio 2017, .Net CoreApp 1.1 (target structure)
I need to write NUnit tests for my ASP.NET Core MVC web application. I often used NUnit for my desktop projects, which were built on the basis of the .NET Framework 3.5-4.6.1.
I have no problem with xunit, but I would like to use nunit.
Here I saw that in the current case I should include such NuGet packages:
But Test Explorer does not 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 ... Good. I tried to add the NUnit3TestAdapter NuGet package (I use alwais it), but this problem does not disappear.
How can i fix this?