I am learning how to use NUnit. I have my main project in this solution, and created a separate project in the same solution, which will conduct my unit tests with my own namespace. From this project, I add a link to the main project and add
using MainProjectNamespace;
to the top.
When I go to NUnit, any tests that I have do not refer to the main work on the project. These are tests that I set up to get used to NUnit, and they are practically useless. When NUnit runs real tests, the test throws this exception:
TestLibrary.Test.TestMainProject: System.IO.FileNotFoundException: Failed to 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 in NUnit, it does not even load (so I can’t even get the opportunity to run tests)
This is the Exception that sup comes in and the stack trace:
System.IO.DirectoryNotFoundException: Could not find part of path "LONG PATH HERE I NOT HANT 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 is explicitly IS on my hard drive
EDIT3: I just switched from Debug to Release, to NUnit and downloaded the dll from the TestingLibrary release folder ... And it booted! 1 out of 3 tests related to namespace. Somehow I am.
EDIT4:
Welllllllll... , . IT