richard richard - 1 year ago 131
C# Question

Why does visual studio 2012 not find my tests?

I have some tests that use the built in

, but can not get them to run.

I am using visual studio 2012 ultimate.

I have a solution of two projects; One has tests,
using Microsoft.VisualStudio.TestTools.UnitTesting
before the class,
before the test methods and reference
(version, runtime version v2.0.50727). I have tried dot-net framework 3.5, 4 and 4.5 others give a re-targeting error.

I have tried to build the solution and project. Test explorer has the message `Build your solution to discover all available tests. Click "run all" to build, discover, and run all tests in your solution.

So the question is: How to I get visual studio to find the tests?

Have also tried to follow this: but with no success: I get stuck in section getting started, when asked to right click and select
create tests
. There is no
create tests

I have this test(it compiles, but does not show up in test explorer):

using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace tests {
public class SimpleTest {
public void Test() {
Assert.AreEqual("a","a", "same");

I have now discovered (see deleted answer below) that it is because it is on a shared drive, but I don't as yet know how to get around it. (something about the security setting maybe).

Answer Source

The problem was that the test runner, is configured to not run tests from a remote drive. When I copied the project to a local drive it worked fine, but I needed it on a shared drive (can not remember why).

I read that it can be configured to work from a shared drive, but never got to do it as by the time I discovered the solution I had switched to MonoDevelop on Debian.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download