public void Delete_EmptyDirectory_DirectoryIsDeleted()
        {
            var dir = new FreshDirectory(emptyDirectory);

            dir.Delete();

            emptyDirectory.Refresh();
            Assert.IsFalse(emptyDirectory.Exists);
        }
Beispiel #2
0
        public void DirectoryScanned_NonExistingDirectory_RaisedWithDirectorySkipped()
        {
            directory.Delete();

            DirectorySkippedEventArgs args = null;

            cleaner.DirectoryScanned += (s, e) => args = e as DirectorySkippedEventArgs;

            cleaner.Clean(directory);

            Assert.That(args, Is.Not.Null);
            Assert.That(args.Directory, Is.EqualTo(directory));
            Assert.That(args.Exception, Is.TypeOf <DirectoryNotFoundException>());
        }
        public void Delete_NonExistingDirectory_ThrowsDirectoryNotFoundException()
        {
            var dir = new FreshDirectory(Guid.NewGuid().ToString());

            Assert.That(() => dir.Delete(), Throws.TypeOf <DirectoryNotFoundException>());
        }
        public void Delete_DirectoryWithSubs_ThrowsIOException()
        {
            var dir = new FreshDirectory(directoryWithSubs);

            Assert.That(() => dir.Delete(), Throws.TypeOf <IOException>());
        }