Beispiel #1
0
        /// <exception cref="System.Exception"/>
        public virtual void TestToFile()
        {
            PathData item = new PathData(".", conf);

            Assert.Equal(new FilePath(testDir.ToString()), item.ToFile());
            item = new PathData("d1/f1", conf);
            Assert.Equal(new FilePath(testDir + "/d1/f1"), item.ToFile());
            item = new PathData(testDir + "/d1/f1", conf);
            Assert.Equal(new FilePath(testDir + "/d1/f1"), item.ToFile());
        }
Beispiel #2
0
        /// <exception cref="System.Exception"/>
        public virtual void TestToFileRawWindowsPaths()
        {
            if (!Path.Windows)
            {
                return;
            }
            // Can we handle raw Windows paths? The files need not exist for
            // these tests to succeed.
            string[] winPaths = new string[] { "n:\\", "N:\\", "N:\\foo", "N:\\foo\\bar", "N:/"
                                               , "N:/foo", "N:/foo/bar" };
            PathData item;

            foreach (string path in winPaths)
            {
                item = new PathData(path, conf);
                Assert.Equal(new FilePath(path), item.ToFile());
            }
            item = new PathData("foo\\bar", conf);
            Assert.Equal(new FilePath(testDir + "\\foo\\bar"), item.ToFile
                             ());
        }