Visual Studio - Unit tests loading resources in the project
问题 The goal is to run some tests given some data in those Xml files. How would you easily load a given Xml file into an XmlDoc within the unit test methods? Current state is: XmlDocument doc = new XmlDocument(); string xmlFile = "4.xml"; string dir = System.IO.Directory.GetCurrentDirectory() + @"\Msgs\" //dir is then the value of the current exe's path, which is //d:\sourcecode\myproject\TestResults\myComputer 2009-10-08 16_07_45\Out //we actually need: //d:\sourcecode\myproject\Msgs\ doc.Load(