コード例 #1
0
        public void CanEmptyADirectory()
        {
            TemporaryDirectoryHandler directory = new TemporaryDirectoryHandler().Create();

            string fileName = directory.GetPath("test.txt");

            File.WriteAllText(fileName, String.Empty);

            directory.Empty();

            string[] fileEntries = Directory.GetFiles(directory.GetPath());
            Console.WriteLine(fileEntries);
            Assert.True(fileEntries.Length == 0);
        }
コード例 #2
0
        public void CanForceCreateTemporaryDirectoryWithName()
        {
            TemporaryDirectoryHandler directory = new TemporaryDirectoryHandler().SetName("testing_folder_1").Create();

            directory = new TemporaryDirectoryHandler().SetForce(true).SetName("testing_folder_1").Create();
            Assert.True(Directory.Exists(directory.GetPath()));
        }
コード例 #3
0
        public void CanDeleteDirectoryWithContent()
        {
            TemporaryDirectoryHandler directory = new TemporaryDirectoryHandler().Create();

            string fileName = directory.GetPath("test.txt");

            File.WriteAllText(fileName, String.Empty);

            Assert.True(directory.Delete());
        }
コード例 #4
0
        public void CanCreateTemporaryDirectoryInLocation()
        {
            TemporaryDirectoryHandler directory = new TemporaryDirectoryHandler(Directory.GetCurrentDirectory() + "/temp_folder").Create();

            Assert.True(Directory.Exists(directory.GetPath()));
        }
コード例 #5
0
        public void CanCreateTemporaryDirectory()
        {
            TemporaryDirectoryHandler directory = new TemporaryDirectoryHandler().Create();

            Assert.True(Directory.Exists(directory.GetPath()));
        }