The test method is not being shown in test explore

2019-08-10 11:48发布

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条回答
家丑人穷心不美
2楼-- · 2019-08-10 12:42

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.

查看更多
登录 后发表回答