0
  • VS2013 Update 5
  • Created C# MVC Web Application project including a Test Project.
  • Updated all packages...

I moved my Models namespace, all model classes and the ApplicationDbContext into a new class library, separate from the MVC Web App project. I added a reference to the Test Project for this.

The Test Project shows a 'Controllers' folder and in that folder is HomeControllerTest.cs

I wanted to add tests for my Model classes, so I added a 'Models' folder and a very similar cs file for testing my models. The class and methods are public, and the appropriate attributes for the class [TestClass] and methods [TestMethod] are assigned

I added Tests for Insert, Get, Update and Delete for one of my models.

Everything compiles fine.

The Unit Test Sessions show no tests from this newly added class; see image... I've restarted VS2013, cleaned solution, rebuilt...everything...except that which will make it work.

How do I get the newly added tests to be run-able via, or visible to, the Unit Test Sessions window??

enter image description here

Robert Achmann
  • 1,986
  • 3
  • 40
  • 66

2 Answers2

0

Have you tried clearing Resharper's cache? (Resharper > Options > Environment > General > Clear Cache).

I had a similar issue before and that was what worked for me. May be worth a try!

Joseph Woodward
  • 9,191
  • 5
  • 44
  • 63
  • Thanks - I'll certainly give it a try – Robert Achmann Sep 30 '15 at 08:54
  • 1
    Well, that didn't work. I finally did get it to work though. I don't know if one thing affected the other, but I right clicked on the test project, and added a unit test - that didn't show. Then I deleted all tests in the Unit Test Sessions window (shown near the bottom) and then rebuilt the project. It now shows all test classes and test methods. – Robert Achmann Sep 30 '15 at 16:43
0

If you have a look in the Resharper Unit Tests section of the options menu there should be a tick box labelled "Enable Shadow Copies".

Unticking this option appeared to solve the issue for me.

ScottishTapWater
  • 3,656
  • 4
  • 38
  • 81