question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

NUnit3TestAdapter 3.15 OneTimeSetUp not working anymore

See original GitHub issue

Visual Studio 2017 v15.9.14 <package id="NUnit" version="3.12.0" targetFramework="net471" /> <package id="NUnit3TestAdapter" version="3.15.0" targetFramework="net471" />

The first time I run a test, OneTimeSetUp is called, then every other runs fails. I had no problems with 3.14. I made a new project to reproduced it with minimal code and I can run multiple time my test and it always succeed with 3.14, but as soon as I upgrade to 3.15, it is never called anymore… If I restart VS, it work only once and all following try fails. Can be reproduced with nuget package or VS extension.

using NUnit.Framework;

namespace NunitAdapter315Bug
{
    [SetUpFixture]
    public class ProjectSetup
    {
        public static bool oneTimePassed = false;

        [OneTimeSetUp]
        public void OneSetup()
        {
            oneTimePassed = true;
        }
    }
}
using NUnit.Framework;

namespace NunitAdapter315Bug
{
    [TestFixture]
    public class TestNunitAdpaterTest
    {
        bool setupPassed = false;
       
        [SetUp]
        public void Setup()
        {
            setupPassed = true;
        }

        [Test]
        public void TestIt()
        {
            Assert.IsTrue(ProjectSetup.oneTimePassed);
            Assert.IsTrue(setupPassed);
        }
    }
}

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:3
  • Comments:12 (5 by maintainers)

github_iconTop GitHub Comments

6reactions
jhbellcommented, Aug 28, 2019

If anyone else is having trouble downgrading to version 3.14 to avoid this bug, here are the steps I took:

  1. Uninstall NUnit3TestAdapter from Visual Studio and make sure auto-update for your extensions are turned off.
  2. Download the NUnit3TestAdapter-3.14.0.vsix file from the releases page here. (Under Assets)
  3. Double click the .vsix file which will launch the VSIX Installer and install 3.14 on your desired version of visual studio.
2reactions
SmartLibertyFBOcommented, Aug 30, 2019

It seems to work with my test solution, thanks

Read more comments on GitHub >

github_iconTop Results From Across the Web

Adapter V3 Release Notes
NUnit3 Test Adapter for Visual Studio - Version 3.15.1 - August 30, ... 649 NUnit3TestAdapter 3.15 OneTimeSetUp not working anymore (When a ...
Read more >
Nunit3 OneTimeSetUp and OneTimeTeardown not working
My guess is that it's using the wrong version. Try renaming the attribute "OneTimeSetUp" to be "TestFixtureSetUp" and see if that makes it...
Read more >
Visual Studio Test Explorer not running [OneTimeSetUp ...
I am trying to run my nUnit 3.x tests in Test Explorer using the NUnit3 VS Adapter - but the OneTimeSetup and Setup...
Read more >
Recent Threads - Xamarin Community Forums - RSSing.com
I am encountering an error when assigning a new page to a class parameter. It appears that it has not been initialized and...
Read more >
https://rep.erst.dk/git/openebusiness/library/dotn...
serviceModel> -</configuration> \ No newline at end of file ... packages\NUnit3TestAdapter.3.15.1\build\net35\NUnit3TestAdapter.props')" Text="$([System.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found