Example #1
0
        public void DeletesCompleteDirectory()
        {
            TestFileGenerator.Generate(_testFilePath, 3, 2);
            DirectoryInfo directory = new DirectoryInfo(_testFilePath);

            Assert.That(directory.GetFiles().Count <FileInfo>() > 0, "no testfiles present");
            Blockbuster service = new Blockbuster();

            service.CleanUp(_testFilePath);
            Assert.That(directory.GetFiles().Count <FileInfo>() == 0);
        }
Example #2
0
        public void DeletesOnlyFiles()
        {
            TestFileGenerator.Generate(_testFilePath, 3, 2);
            DirectoryInfo directory = new DirectoryInfo(_testFilePath);

            Assert.That(directory.GetFiles().Count <FileInfo>() > 0, "no testfiles present");
            AbstractCommand[] commands = { new FilesOnly() };
            Blockbuster       service  = new Blockbuster();

            service.CleanUp(_testFilePath, commands);
            Assert.That(directory.GetFiles().Count <FileInfo>() == 0);
        }
Example #3
0
        public void DeletesFilesOnly()
        {
            AssertEmptyTestDirectory();
            TestFileGenerator.Generate(_testFilePath, 3, 2);
            var directory = new DirectoryInfo(_testFilePath);

            Assert.That(directory.GetFiles().Count <FileInfo>() > 0, "no testfiles present");
            var service = new Blockbuster();
            var dynamicConfiguration = MockRepository.GenerateStub <IDynamicConfiguration>();

            dynamicConfiguration.Stub(x => x.GetCommandConfigurations()).Return(new[] { string.Format("CommandName='FilesOnly'; Directory='{0}'", _testFilePath) });
            service.CleanUp(dynamicConfiguration, false);
            Assert.That(directory.GetFiles().Count <FileInfo>() == 0);
        }