示例#1
0
        [TestCase(FileSystemRights.WriteData)]  // False on writing file
        public void ReadableWriteableDeletableDirectory_Of_NotWriteable_Events_Log(FileSystemRights fileSystemRights)
        {
            _fileSystemRights = fileSystemRights;
            AddDirectorySecurity(_directoryName, _user, _fileSystemRights, AccessControlType.Deny);

            Assert.IsFalse(FolderLibrary.ReadableWriteableDeletableDirectory(_pathOriginal));
        }
示例#2
0
        public void ReadableWriteableDeletableDirectory_Of_NotReadableDirectory_Returns_False()
        {
            _fileSystemRights = FileSystemRights.ReadData;
            AddDirectorySecurity(_directoryName, _user, _fileSystemRights, AccessControlType.Deny);

            Assert.IsFalse(FolderLibrary.ReadableWriteableDeletableDirectory(_pathOriginal));
        }
示例#3
0
        //[TestCase(FileSystemRights.Delete)]
        //[TestCase(FileSystemRights.DeleteSubdirectoriesAndFiles)]
        public void ReadableWriteableDeletableDirectory_Of_NotDeletableDirectory_Returns_False(FileSystemRights fileSystemRights)
        {
            string subDirName = Path.Combine(_pathOriginal, "ReadableWriteableDeletableDirectory");

            Directory.CreateDirectory(subDirName);

            _fileSystemRights = fileSystemRights;
            AddDirectorySecurity(_directoryName, _user, _fileSystemRights, AccessControlType.Deny);
            AddDirectorySecurity(subDirName, _user, _fileSystemRights, AccessControlType.Deny);

            Assert.IsFalse(FolderLibrary.ReadableWriteableDeletableDirectory(_pathOriginal));
        }
示例#4
0
 public void ReadableWriteableDeletableDirectory_Of_ReadableWriteableDeletableDirectory_Returns_True()
 {
     _noPermissionsRestricted = true;
     Assert.IsTrue(FolderLibrary.ReadableWriteableDeletableDirectory(_pathOriginal));
 }
示例#5
0
 public void ReadableWriteableDeletableDirectory_Of_InvalidPaths_Returns_False(string path)
 {
     _noPermissionsRestricted = true;
     Assert.IsFalse(FolderLibrary.ReadableWriteableDeletableDirectory(path));
 }