简体   繁体   中英

Nunit running all tests on TestFixture even when selecting single test

I'm running Nunit 3.5 on VS2015, Resharper Ultimate 10,

created this TestFixture

[TestFixture]
public class TestInfluxDbConnector
{
    [Test]
    public void TestPong()
    {
        // Arrange
        InfluxDbProxy influxDb = new InfluxDbProxy();

        // Act
        Task<bool> res = influxDb.PingAsync();

        // Assert
        Assert.IsTrue(res.Result);
    }

    [Test]
    public void CreateDatabaseAsync()
    {
        // Arrange
        InfluxDbProxy influxDb = new InfluxDbProxy();

        // Act
        var databseAsync = influxDb.CreateDatabseAsync("Test");

        // Assert
        Assert.IsTrue(databseAsync.Result);
    }
}

Why when I'm debugging a single Test all tests are running? (I want to debug / run only a single test)

在此处输入图片说明

I had the same issue when I had updated nunit 2.6.4 to nunit 3.5.0. Try do this:

  1. Disable Nunit Test Adapter in "extensions and updates".
  2. Install Nunit3TestAdapter. Link: https://visualstudiogallery.msdn.microsoft.com/0da0f6bd-9bb6-4ae3-87a8-537788622f2d
  3. In Visual Studio use "Tests"->"Windows"->"Test Explorer" and run tests only from this window.

Only this way is working for me at the moment. Probably nunit 3.5 is new for Resharper and they cannot work fine at the moment.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM