I am learning how to use NUnit. I have my main project in it's solution, and created a separate project in that same solution which will hold my unit tests, with it's own namespace. From that project I add a reference to the main project and add a
using MainProjectNamespace;
to the top of it.
When I go to NUnit, any tests I have that don't reference the main project work. These are tests I setup just to get used to NUnit, and are pretty much useless. When NUnit runs the real tests the test throws this exception:
TestLibrary.Test.TestMainProject: System.IO.FileNotFoundException : Could not load file or assembly 'WpfApplication2, Version = 1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the specified file.
Why am I getting this exception?
EDIT:
Now when I try to load the assembly into NUnit, it won't even load (so I can't even get a chance to run the tests)
This is the Exception that come sup, and the stack trace:
System.IO.DirectoryNotFoundException: Could not find a part of the path 'LONG PATH HERE I DON'T WANT TO TYPE'
System.IO.DirectoryNotFoundException...
Server stack trace: at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.Directory.SetCurrentDirectory(String path) at NUnit.Core.DirectorySwapper..ctor(String directoryName) at NUnit.Core.Builders.TestAssemblyBuilder.Load(String path) at NUnit.Core.Builders.TestAssemblyBuilder.Build(String assemblyName, Boolean autoSuites) at NUnit.Core.Builders.TestAssemblyBuilder.Build(String assemblyName, String testName, Boolean autoSuites) at NUnit.Core.TestSuiteBuilder.Build(TestPackage package) at NUnit.Core.SimpleTestRunner.Load(TestPackage package) at NUnit.Core.ProxyTestRunner.Load(TestPackage package) at NUnit.Core.ProxyTestRunner.Load(TestPackage package) at NUnit.Core.RemoteTestRunner.Load(TestPackage package) at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs) at System.Runtime.Remoting.Messaging.StackBuilderSink.PrivateProcessMessage(RuntimeMethodHandle md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs) at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg, Int32 methodPtr, Boolean fExecuteInContext)
Exception rethrown at [0]: at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) at NUnit.Core.TestRunner.Load(TestPackage package) at NUnit.Util.TestDomain.Load(TestPackage package) at NUnit.Util.TestLoader.LoadTest(String testName)
EDIT2: The above path clearly IS in my hard drive
EDIT3: I just switched from Debug to Release, on NUnit, and loaded the dll from the release folder of TestingLibrary... And it loaded! 1 of the 3 namespace-specific tests worked. Getting somewhere, I am.
EDIT4: Welllllllll... I can actually run the tests now, but I am back to the original error. IT is not finding the assembly for the main project