예제 #1
0
        public void CanDeleteNonExistentFile()
        {
            Assert.IsFalse(File.Exists(NoExistsPath));
            var no = new SpecialFile(NoExistsPath);

            no.Delete();
            Assert.DoesNotThrow(() => no.Delete());
        }
예제 #2
0
        public void CanDeleteReadOnlyFile()
        {
            var path = NoPermsPath;

            Assert.IsTrue(File.Exists(path));
            var file = new SpecialFile(path);

            Assert.DoesNotThrow(() => file.Delete());
            Assert.IsTrue(File.Exists(path));
        }
예제 #3
0
        public void CanDeleteRegularFile()
        {
            var path = ExistsPath;

            Assert.IsTrue(File.Exists(path));
            var file = new SpecialFile(path);

            Assert.DoesNotThrow(() => file.Delete());
            Assert.IsFalse(File.Exists(path));
        }