public void SetAccessControl_FileInfo_FileSecurity_InvalidArguments() { FileInfo fileInfo = new FileInfo("\\"); Assert.Throws <ArgumentNullException>("fileSecurity", () => FileSystemAclExtensions.SetAccessControl(fileInfo, (FileSecurity)null)); }
public void SetAccessControl_FileStream_FileSecurity_InvalidArguments() { Assert.Throws <NullReferenceException>(() => FileSystemAclExtensions.SetAccessControl((FileStream)null, (FileSecurity)null)); }
public void GetAccessControl_FileInfo_AccessControlSections_InvalidArguments() { Assert.Throws <NullReferenceException>(() => FileSystemAclExtensions.GetAccessControl((FileInfo)null, new AccessControlSections())); }
public void SetAccessControl_DirectoryInfo_DirectorySecurity_InvalidArguments() { DirectoryInfo directoryInfo = new DirectoryInfo("\\"); Assert.Throws <ArgumentNullException>("directorySecurity", () => FileSystemAclExtensions.SetAccessControl(directoryInfo, (DirectorySecurity)null)); }
public void GetAccessControl_DirectoryInfo_InvalidArguments() { Assert.Throws <NullReferenceException>(() => FileSystemAclExtensions.GetAccessControl((DirectoryInfo)null)); }
public void GetAccessControl_Filestream_InvalidArguments() { Assert.Throws <ArgumentNullException>("fileStream", () => FileSystemAclExtensions.GetAccessControl((FileStream)null)); }
public void GetAccessControl_FileInfo_InvalidArguments() { Assert.Throws <ArgumentNullException>(() => FileSystemAclExtensions.GetAccessControl((FileInfo)null)); }
public void GetAccessControl_DirectoryInfo_AccessControlSections_InvalidArguments() { Assert.Throws <ArgumentNullException>(() => FileSystemAclExtensions.GetAccessControl((DirectoryInfo)null, new AccessControlSections())); }
public void SetAccessControl_FileStream_FileSecurity_InvalidFileSecurityObject() { using (var directory = new TempDirectory()) using (var file = new TempFile(Path.Combine(directory.Path, "file.txt"))) using (FileStream fileStream = File.Open(file.Path, System.IO.FileMode.Append, System.IO.FileAccess.Write, System.IO.FileShare.None)) { AssertExtensions.Throws <ArgumentNullException>("fileSecurity", () => FileSystemAclExtensions.SetAccessControl(fileStream, (FileSecurity)null)); } }