【发布时间】:2014-07-14 15:08:36
【问题描述】:
在下面的代码中,在运行程序中没有找到测试,我不知道为什么。请问有人可以解释为什么吗?
[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");
}
}
【问题讨论】:
-
除了安装 NUnit 的测试适配器,您还可以使用 Resharper,它会自动检测并运行 MSTest 和 NUnit 测试。
-
@Smith.h.Neil:您应该澄清这不是免费组件...