测试资源管理器 VS2013 中未显示测试方法



我正在测试计算方法的开始。我对项目进行了清理、重建、x64 调整,我有 nunit 测试适配器和其他相关的 dll,但我仍然无法在测试资源管理器窗格中看到测试方法。有人可以帮忙,代码是否缺少某些内容还是什么?

namespace Ninja.Tests
{
    [TestFixture]
    public class SinglePricingTests
    {
        [Test]
        public void ShouldCalculate()
        {
            var pricingModelTest = new PricingModel();
            var Sut = new PriceCalculationService(); // Sut: System under test
            var Result = Sut.Calculate(pricingModelTest);
            var TestParameters = new PricingCostParameters();

            Assert.That(Result, Is.EqualTo(TestParameters));
        }
    }
}

我几乎可以肯定你的 NUnit 框架有错误的适配器。

如果您使用的是 NUnit 3.0

或更高版本,则需要使用"NUnit 3.0 测试适配器",您可以在 https://www.nuget.org/packages/NUnit3TestAdapter/3.0.8-ctp-8 在此处下载。

卸下不需要的所有其他适配器。

相关内容

最新更新