Unit testing - Unity Test tools v1.0 - namespace NUnit not found

Has anyone gotten the Unity Test Tools framework to work? I’ve imported it into my project and found that the included sample tests function, but trying to create my own do not. If I add

using NUnit.Framework;

To any script in my project, I get:

The type or namespace 'NUnit' could not be found.

I tried adding the contents (and various permutations) of MonoDevelop/Addins/NUnit folder into the assets folder of my project, but it essentially gives a System.Reflection.ReflectionTypeLoadException if I try that.

This is using the latest version of Unity (free) 4.3.1f1

After copying the contents of NUnit into my assets folder then removing it, it looks like it gets a missing NUnit error on the NUnitTestEngine.cs file

Assets/UnityTestTools/UnitTesting/Editor/TestRunner/NUnitTestEngine.cs(5,7): error CS0246: The type or namespace name NUnit’ could not be found. Are you missing a using directive or an assembly reference?`

Restarting Unity fixes that.

Additionally, there was an unknown error, but that seemed to go away if I restart Unity.

Actually, the unknown error does make its way back.

Unknown Error,An unknown error occurred.

Your tests need to be executed only in Editor mode. So you need to make sure that they are inside a “Editor” folder. This solved the problem for me.

For example, any tests added to the following folders will work: