In the following code, the tests are not being found in the runner, and I don't know why. Please could some one explain why?
[TestFixture]
public class RepositoryTest
{
[SetUp]
public void Init()
{
}
[Test]
public void whenIAskForAllTheLocationsAllTheLocationsAreReturned()
{
var repo = new LocationRepository();
var locations = repo.GetLocationsByName("%");
Assert.AreEqual(locations.Count(), 8);
Assert.AreEqual(locations.First().LocationName, "Kipling Road");
}
}
Visual studio won't run nunit tests by default, only MSTests. In order to run nunit tests natively from visual studio, install the NUnit Test Adapter . Not sure if it is valid for the express edition though.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.