测试资源管理器VS2013中未显示该测试方法 [英] The test method is not being shown in test explorer VS2013

查看:61
本文介绍了测试资源管理器VS2013中未显示该测试方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在测试一种计算方法.我对项目进行了清理,重建,x64调整,并且具有nunit测试适配器和其他相关的dll,但仍然无法在测试资源管理器"窗格中看到该测试方法.有人可以帮忙吗,代码有什么遗漏吗?

I'm at the beginning of testing a calculation method. I did clean, rebuild, x64 adjustments to the project and I have nunit test adapter and other related dlls yet I still cannot see the test method in test explorer pane. Could someone help, is there something missing about the code or what?

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测试适配器",您可以在此处下载

If you use NUnit 3.0 or later you need to use "NUnit 3.0 Test Adapter" which you can download here https://www.nuget.org/packages/NUnit3TestAdapter/3.0.8-ctp-8.

删除所有不需要的其他适配器.

Remove all other adapters that you don't need.

这篇关于测试资源管理器VS2013中未显示该测试方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆