I am new to unit testing in visual studio and I want to load a physical XML file. This file is in the unit test project as Content, and it is copied to the output directory.
So, when I compile the project, the xml file is in the output directory. But when I run the test, a new directory is created with all the dependent DLLs, but the xml file is not copied.
Xml content is required to run the test. I am executing this code to get the path to the Xml file in the runtime folder:
private static string GetXmlFullName() {
The exception is:
System.IO.DirectoryNotFoundException: 'd:\***\solutiondirectory\testresults\*** 2012-06-13 17_59_53\out\content.xml'.
How to add this file to the runtime folder?
Thanks in advance. (and sorry for my english ...)
c # unit-testing visual-studio
Hyralex
source share