Resharper 7: MSTest not working - "Test wasn't run"
Solution 1
As odd as it is, using VS2012, using Resharper 8.0, using NUnit, I was receiving this error because of an entry in my app.config file. I added an EntityFramework connection string and this behavior started. Removing the entire connection strings section shows the test runner starts/works again. Viewing output shows the app.config is not valid - this was causing this specific behavior in the test runner - "Test wasn't run".
Solution 2
I had the testproject set to AnyCPU and the project set explicitly to x86 when this happened. Setting the testproject to x86 solved it for me.
I'm using VS2012 R#8 and nUnit
Solution 3
Try running the Unit Tests using the MSTest Test Explorer. You might find more details in the output window of the root cause.
For me, it was a referenced assembly that was using a more recent version of NUnit than the one that was referenced in the test project. Using the same up-to-date version fixed the problem.
System.IO.FileLoadException: Could not load file or assembly 'nunit.framework, Version=2.6.3.13283, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference.
Solution 4
In my case it was the NUnitTestAdapter nuget that needed to be removed.
Solution 5
I'd same problem I just..
- Changed methods access modifier from private to public.
- Removed static keyword from methods.
That's it. It worked for me. But that is for C#.
Related videos on Youtube
magnattic
Working mostly on the web. Passionate about technology and innovation.
Updated on September 15, 2021Comments
-
magnattic over 2 years
Since I upgraded to VS2012 and Resharper 7, my previously working MS Tests are not running anymore.
The tests are run in an ASP.NET environment. I use the following Attributes:
[TestMethod] [HostType("ASP.NET")] [AspNetDevelopmentServerHost("C:\\Projekte\\****\\Website", "/")] [UrlToTest("http://localhost:7924/")]
Any idea how to fix this?
-
ldsenow over 11 yearsI have the same issue. It was due to my website and test project are x64. I don't have solution for it. I currently use nunit as a workaround.
-
ldsenow over 11 yearsI found out it might be Resharper's problem. I ran the tests from "Test -> Run" of VS and those tests were picked up. BTW, I changed the "Test -> Test Settings -> Default Processor Architecture" to x64. I think if you run them in the build server, it should be fine.
-
ldsenow over 11 yearsThis may help youtrack.jetbrains.com/issue/RSRP-326760
-
Johan Larsson over 10 yearsI get this with nUnit and R#8
-
Cirem almost 10 yearsI am experiencing this same problem with VS2013, ReSharper 8.2, and DotCover 2.7 trying to run on against a x64 solution. None of the below worked for me. Any other solutions?
-
Michael Freidgeim about 6 yearsPossible duplicate of Test method is inconclusive: Test wasn't run. Error?
-
-
BClaydon over 10 yearsThis was exactly it for me. I jacked up my database connection string (had changed the name). I fixed that and my tests run again. Thanks!
-
Aaron about 10 yearsSame here, Good Call.
-
Sam Plus Plus almost 10 yearsThat was it for me. Basically any error in the app config seems to cause this.
-
magnattic over 9 yearsThe question is specifically about MSTest. This still might be useful information for visitors having the problem with NUnit tests, but it should probably be a comment instead of an answer.
-
Andreas Vendel over 9 yearsI also had this issue with an error in machine.config.
-
Rohit Sachan over 9 yearsSame with me, changed to x86 and it worked. but its disappointing that resharper is not giving correct error.
-
Gluip about 9 yearssame here...removing app.config fixed it
-
ilter about 9 yearsWould you like to share with us what you did exactly? You finding what you were missing, not helping anyone...
-
Klaus Nji almost 6 yearsWho would have thought. That's exactly the same problem here.