Ejemplo n.º 1
0
        public void DirectoryPath_Test()
        {
            var fs   = new PhysicalFileSystem();
            var temp = Path.GetTempPath();
            var pfs  = fs.GetOrCreateSubFileSystem(fs.ConvertPathFromInternal(temp));
            var dir  = new FS.Directory("test", pfs, pfs.GetDirectoryEntry("/"));

            Assert.Equal(NormalizePath(dir.GetPath().FullName),
                         NormalizePath(Path.Combine(temp, "test")));

            Assert.Equal(NormalizePath(dir.OpenDirectory("dir1").GetPath().FullName),
                         NormalizePath(Path.Combine(temp, "test", "dir1")));

            Assert.Equal(NormalizePath(dir.OpenDirectory("test").OpenDirectory("test").GetPath().FullName),
                         NormalizePath(Path.Combine(temp, "test", "test", "test")));
        }
Ejemplo n.º 2
0
        public void DirectoryPath_Test()
        {
            var fs   = new PhysicalFileSystem();
            var temp = Path.GetTempPath();
            var pfs  = fs.GetOrCreateSubFileSystem(fs.ConvertPathFromInternal(temp));
            var dir  = new FS.Directory("test", pfs, pfs.GetDirectoryEntry("/"));

            Assert.Equal(NormalizePath(dir.GetPath().FullName),
                         NormalizePath(Path.Combine(temp, "test")));

#pragma warning disable CS0618 // Type or member is obsolete
            Assert.Equal(NormalizePath(dir.OpenDirectory("dir1").GetPath().FullName),
                         NormalizePath(Path.Combine(temp, "test", "dir1")));

            Assert.Equal(NormalizePath(dir.OpenDirectory("test").OpenDirectory("test").GetPath().FullName),
                         NormalizePath(Path.Combine(temp, "test", "test", "test")));
#pragma warning restore CS0618 // Type or member is obsolete
        }