The test method is not being shown in test explorer VS2013

我是研究僧i 提交于 2019-12-11 12:31:27

问题


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));
        }
    }
}

回答1:


I am almost sure you have the wrong adapter for your NUnit framework.

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.



来源:https://stackoverflow.com/questions/35059335/the-test-method-is-not-being-shown-in-test-explorer-vs2013

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!