Por que estou recebendo uma exceção FileNotFound ao fazer referência a outro projeto da mesma soluçã
Estou aprendendo a usar o NUnit. Eu tenho meu projeto principal em sua solução e criei um projeto separado nessa mesma solução que realizará meus testes de unidade, com seu próprio espaço para nome. A partir desse projeto, adiciono uma referência ao projeto principal e adiciono um
using MainProjectNamespace;
até o topo.
Quando vou ao NUnit, todos os testes que tenho que não fazem referência ao trabalho principal do projeto. Estes são os testes que eu configuro apenas para me acostumar com o NUnit e são praticamente inúteis. Quando o NUnit executa os testes reais, o teste lança esta exceção:
TestLibrary.Test.TestMainProject: System.IO.FileNotFoundException: Não foi possível carregar o arquivo ou assembly 'WpfApplication2, Versão = 1.0.0.0, Culture = neutral, PublicKeyToken = null' ou uma de suas dependências. O sistema não consegue encontrar o arquivo especificado.
Por que estou recebendo essa exceção?
EDITAR
gora, quando tento carregar o assembly no NUnit, ele nem carrega (por isso não posso nem ter a chance de executar os teste
Esta é a exceção que vem sup, e o rastreamento da pilha:
System.IO.DirectoryNotFoundException: não foi possível encontrar uma parte do caminho 'LONGO CAMINHO AQUI, NÃO QUERO TIPO'
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: O caminho acima está claramente no meu disco rígido
EDIT3: Acabei de mudar de Debug para Release, no NUnit, e carreguei a DLL da pasta de lançamento do TestingLibrary ... E carregou! Um dos três testes específicos de namespace funcionou. Estou chegando a algum luga
EDIT4: Welllllllll ... Eu posso realmente executar os testes agora, mas estou de volta ao erro original. A TI não está encontrando a montagem do projeto principal