示例#1
0
        public void DisposableDirectory()
        {
            string dirPath;

            using (DString dDir = FileUtils.GetTempDirPath())
            {
                Assert.IsTrue(FileUtils.AssertIsDirectory(dDir.Value));
                Assert.IsTrue(FileUtils.IsDirectory(dDir.Value));
                dirPath = dDir.Value;

                string subDirectory     = System.IO.Path.Combine(dDir.Value, @"test\test\test");
                string subDirectoryFile = System.IO.Path.Combine(subDirectory, @"text.txt");
                FileUtils.AssertIsDirectory(subDirectory);
                System.IO.File.WriteAllText(subDirectoryFile, "test");
            }

            Assert.IsNotEmpty(dirPath);
            Assert.IsFalse(FileUtils.IsDirectory(dirPath));
        }