1

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");
    }
}
  • Besides install NUnit's Test Adapter you can use [Resharper](http://www.jetbrains.com/resharper/features/unit_testing.html) which will automatically detect and run MSTest and NUnit tests. – Neil Smith Jul 14 '14 at 15:18
  • @Smith.h.Neil: you should clarify that is not a free component... – Claudio Redi Jul 14 '14 at 15:32

1 Answers1

1

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.

Claudio Redi
  • 67,454
  • 15
  • 130
  • 155