public void The_File_Should_Be_In_The_SubFolder()
        {
            string baseFile = "folder\\file.txt";
            string relativePath = "folder2\\file2.txt";

            IFileController controller = new FileController();
            Assert.That(controller.ToAbsolutePath(relativePath, baseFile), Is.EqualTo("folder\\folder2\\file2.txt"));
        }
Example #2
0
        private NHConfigFile GetNhConfigFileFromCsprojFile(string filepath)
        {
            nhConfigFile = null;

            if (!File.Exists(filepath))
                return null;

            try
            {
                // Check whether we can find a config file
                XmlDocument doc = new XmlDocument();
                doc.LoadXml(File.ReadAllText(filepath));
                CSProjFile csProjFile = new CSProjFile(doc, tbProjectLocation.Text);
                Slyce.Common.FileController fileController = new FileController();
                nhConfigFile = ProjectLoader.GetNhConfigFile(csProjFile, fileController);
            }
            catch
            {
                // Do nothing. We are probably trying to process a non-XML file.
            }
            return nhConfigFile;
        }