using vs2010 sp1 on win7 pro x64 with resharper 7.1
i have a unit test project, in it a directory named "TestData" and in the dir a file ''ShipmentDocs.txt" that i intend to use to read in some test. the file is set with build action: none and copy if newer in the vs
project.
in ncrunch settings i set Additional files to include to the TestData dir so all files in the dir are included.
in the begining of a test i attempt to read the file:
Quote:var rows = File.ReadAllLines(@"TestData\ShipmentDocs.txt").
ncrunch test fails with
Quote:
System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Users\Cosmin.EDI-SOFT\AppData\Local\NCrunch\220\62\TestResults\75dd90c8-7ebe-4594-9ace-aa5cb9de06be\Out\TestData\ShipmentDocs.txt'.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
at System.IO.StreamReader..ctor(String path, Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize)
at System.IO.StreamReader..ctor(String path, Encoding encoding)
at System.IO.File.InternalReadAllLines(String path, Encoding encoding)
at System.IO.File.ReadAllLines(String path)
at DALTest.PortalDALTestSuiteSQL.TestUpdate() in D:\!Trunk\Portal2\TestSuites\PortalDALUnitTest\PortalDALTestSuiteSQL.cs:line 164#0
the path [C:\Users\Cosmin.EDI-SOFT\AppData\Local\NCrunch\220\62\TestResults\75dd90c8-7ebe-4594-9ace-aa5cb9de06be\Out\TestData\ShipmentDocs.txt] does not exist. the path is valid until [C:\Users\Cosmin.EDI-SOFT\AppData\Local\NCrunch\220].
when searching using total commander for occurences on the disk i find the file here
c:\Users\Cosmin.EDI-SOFT\AppData\Local\NCrunch\3684\23\TestSuites\PortalDALUnitTest\bin\Debug\TestData\
and here
c:\Users\Cosmin.EDI-SOFT\AppData\Local\NCrunch\3684\23\TestSuites\PortalDALUnitTest\TestData\
it seems that the copying is done in the ncrunch folder but when the test runs the current folder is a nonexistant one.
what should i do so that a file in the test projects (not the tested proj) is available for reading by the unit tests?