Unit Test Session doesn't show tests from new test class

976 Views Asked by At
  • 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

3

There are 3 best solutions below

2
Joseph Woodward On

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!

0
ScottishTapWater On

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.

0
Masoud On

In my case selecting Append all tests from [MyTestProhect] context menu solve the issue:

enter image description here