Test method is inconclusive: Test wasn't run. Error?
Solution 1
It was a Resharper issue. In Resharper options->Tools->MSTEST, I unchecked the Use Legacy Runner and now it works.
Solution 2
Just in case none of the above options worked for anyone I fixed my instance of this error by noticing a corrupt entry in my App.Config due to a missing nuget package in the test project.
Solution 3
For me it was rather frustrating, but I've found solution for my case at least:
If your TestMethod is async, it cannot be void. It MUST return Task.
Hope it helps someone :)
Solution 4
I had the same issue with resharper and I corrected this error by changing an option:
Resharper => Options => Tools => Unit Testing
I just had to uncheck the option "Shadow-copy assemblies being tested"
Solution 5
I faced this problem in vs 2017 update 3 with Resharper Ultimate 2017.2
Restart vs or restart machine can't help.
I resolved the problem by clearing the Cache as follows:
Resharper ->options-> Environment ->click the button 'Clear caches'
Update:
There is a button "error" (I find in Resharper 2018) in the upper right corner of the test window.
If you click the error button, it shows an error message that may help in resolving the problem.
To track the root of the problem, run Visual Studio in log mode. In vs 2017, Run the command:
devenv /ReSharper.LogFile C:\temp\log\test_log.txt /ReSharper.LogLevel Verbose
Run the test.
Review the log file test_log.txt and search for 'error' in the file.
The log file is a great help to find the error that you can resolve or you can send the issue with the log file to the technical support team of Resharper.
Related videos on Youtube
Cybercop
Master student of Web Science. Block chain and Machine Learning enthusiast
Updated on December 04, 2021Comments
-
Cybercop over 2 years
I have a test class and below I have posted a sample test from the test class
namespace AdminPortal.Tests.Controller_Test.Customer { [TestClass] public class BusinessUnitControllerTests { private IBusinessUnitRepository _mockBusinessUnitRepository; private BusinessUnitController _controller; [TestInitialize] public void TestInitialize() { _mockBusinessUnitRepository = MockRepository.GenerateMock<IBusinessUnitRepository>(); _controller = new BusinessUnitController(_mockBusinessUnitRepository); } [TestCleanup] public void TestCleanup() { _mockBusinessUnitRepository = null; _controller.Dispose(); _controller = null; } #region Index Action Tests [TestMethod] public void Index_Action_Calls_GetAllBusinessUnit() { _mockBusinessUnitRepository.Stub(x => x.GetAllBusinessUnit()); _controller.Index(); _mockBusinessUnitRepository.AssertWasCalled(x=>x.GetAllBusinessUnit()); } } }
When I run the project I get following screen
I checked the references and the test project has the reference to main project. Any idea why the test are not running or saying that they were inconclusive?
Edit 1:
I saw a post here and changed my test's setting's default processor architecture to X64 but it still doesn't work.
-
Chris Mantle almost 11 yearsIt's a known issue in ReSharper. There are some potential solutions here: stackoverflow.com/questions/12191352/….
-
Mark Walsh almost 11 yearsHave you done a clean and rebuild? I remember there's some weirdness in VS2010 with losing references to assemblies after you've updated and rebuilt them.
-
Cybercop almost 11 years@ChrisMantle I checked it out and changed my default processor architecture, but it still doesn't work
-
Cybercop almost 11 years@MarkWalsh I'm using VS2012. I still cleaned and rebuilt the solution as you said, but still doesn't work
-
Mark Walsh over 10 yearsHave you tried restarting the OS (Last shot)
-
Cybercop over 10 yearsYea. What actually happened is I before had a other project's(domain model) in application. Now those project are provided as NuGet package. But I have installed the Nuget package. The application runs fine, its just the Test that is not running or says inconclusive
-
Jaider over 8 yearsSince ReSharper is giving me a hard time. I decided to quickly test it with NUnit3 Test Adapter visualstudiogallery.msdn.microsoft.com/…
-
gnat about 5 yearsthis question is discussed at meta
-
-
Spikeh over 10 yearsThis sorted it for me, after looking at a load of other fixes. I'm using VS 2013 and R# v8.1
-
Geoffrey Hudik about 10 yearsSame issue here. It would be nice if R# would bubble the error up (error initializing configuration system) so it'd be obvious why the tests were not run.
-
anIBMer almost 10 yearsThanks, for me, I put the appsettings on top of configurations by mistake, move it down to a proper position and it works.
-
evgenyl almost 10 yearsin my case, it was result of invalid change in config file
-
Vinee over 9 yearsI added specflow through nuget and it inserted an entry into App.config. That created the whole trouble. I created a new App.config and added the reference again and it got fixed. Thanks for info.
-
cederlof over 8 yearsI don't have that option under Tools->Unit Testing->MsTest. (Resharper 9.2.)
-
Steven D. over 8 yearsI can corroborate that nearly two years after this post was initially made, this still seems to be a viable fix (I'm using VS 2015 and ReSharper 9.2).
-
mortb over 8 yearsI had (accidentally) reverted the changes to the project file when changing branch in Git. When I tried to run the test by right clicking in the class (code window was still open) it did not run as it was not part of the solution.
-
Chaquotay over 8 yearsThe platform target mismatch can also happen with references to other projects inside the same solution.
-
Nemeas over 8 yearsDid not work for me, I'm using VS2015 w/Reshaper 10.
-
atconway over 8 yearsYeah I had the identical issue. The idea might be to make the tests project and the target project identical for ease of access, but it screws with the test runner and produces this issue from the OP.
-
Kevin B Burns almost 8 yearsWeird, ReSharper just complained to me that my [Test] methods where private. Must be a new feature.
-
KiwiSunGoddess almost 8 yearsMy issue was caused by a bad Git conflict resolution leaving Head change info in my resolved config file
-
Valentine Zakharenko over 7 yearsI changed culture of assembly and R# stopped run the tests.
-
datps over 7 yearsBingo! Thanks Chris. In my case it was log4net section without a maching section name in
<configSections>
. -
Tom almost 7 yearsI had a Test assembly compiled against 3.6.1, and my main Test assembly was compiled against 3.7.1. Downgraded to 3.6.1 and now its all good.
-
realsonic over 6 yearsI also haven't such option in R# 2017.2.
-
kiprainey over 6 yearsI had a similar issue when using test case directly rather than test case source. The end result is the same -- a mismatch between the number of arguments in the test signature and values in the TestCase attribute results in an inconclusive result.
-
Ben Power over 6 yearsYeah, I was missing <appSettings> from the <configuration> section... what did we do before StackOverflow!
-
Tasker over 6 yearsThis got it for me working with VS2017 and Resharper Ultimate 2017.2.2 on a NETCore test project.
-
Sirar Salih over 6 yearsAlmost the same happened to me, I had added a connection string to a redundant appSettings section, when I removed the redundant appSettings section and moved the connection string to the original appSettings it worked.
-
MichaelMilom about 6 yearsIn my case, I had a silly typo in app.config <AppConfig> instead of <AppSettings>. I love ReSharper, but they REALLY need to work on their error messages!
-
atamata about 6 yearsSame here, an entry in the config section has been commented out
-
Michael Freidgeim about 6 yearsThe answer about corrupted app.config is the same as first one stackoverflow.com/a/21386881/52277
-
Lars Holdgaard about 6 yearsWorked for me. VS2017 with ReSharper 2017.1.3 :-)
-
Jony Feldman about 6 yearsthank you! checking the output window reveled my problem, the class was not public!
-
ThomasG almost 6 yearsDidn't help in my case
-
Marcel over 5 yearsFor me, the option was unter Tools->Unit Testing->MsTest and unchecking helped.
-
andersh over 5 yearsThe <appSettings> node must not be placed above the <configSections> node
-
andersh over 5 yearsThe <appSettings> node must not be placed above the <configSections> node
-
Vladimir Melekh over 5 yearsDmitry, thank you, it helped me. Can you explain what is this service?
-
Dmitry Pavlov over 5 years@VladimirMelekh check this github.com/Microsoft/vstest/issues/472
-
PhoenixPan about 5 yearsWorked for me and I don't have to clear build for the tests now. Thanks Elias.
-
Achilles P. about 5 yearsfor me also, section name mismatch sendgrid.development vs sendgrid.test. Shady...
-
Puterdo Borato about 5 yearsIt was the case for ReSharper 2017.3.2 and NUnit 3.11. See comment for nunit github.com/nunit/nunit/issues/3086#issuecomment-466988760
-
Ben Power about 4 yearsThis is one of those frustrating issues that gives you little clue as to the actual problem!
-
Kirsten about 4 yearsTotal mess up in app.config caused it for me
-
SharpC about 2 years"error" button in the top right corner of the window, useful! :-)