Update remaining argument*exceptions to have param names (dotnet/corefx#21650)

Commit migrated from https://github.com/dotnet/corefx/commit/ea1bc38c237dfb768e7d442efa95cab785e89ac3
This commit is contained in:
Hugh Bellamy authored and Dan Moseley committed 2017-06-28 06:44:57 -07:00
1 parent fc91c23553
commit 7c660f36bb
21 files changed
+109 -109

No files matched your search

@@ -29,7 +29,7 @@ namespace System.Security.AccessControl
[Fact]
public void ObjectInitialization_InvalidSecurityDescriptor()
{
Assert.Throws<ArgumentNullException>("securityDescriptor", () => new CustomDirectoryObjectSecurity(null));
AssertExtensions.Throws<ArgumentNullException>("securityDescriptor", () => new CustomDirectoryObjectSecurity(null));
}
[Fact]
@@ -87,76 +87,76 @@ namespace System.Security.AccessControl
public void RemoveAuditRuleAll_InvalidObjectAuditRule()
{
var customObjectSecurity = new CustomDirectoryObjectSecurity();
Assert.Throws<ArgumentNullException>("rule", () => customObjectSecurity.RemoveAuditRuleAll(null));
AssertExtensions.Throws<ArgumentNullException>("rule", () => customObjectSecurity.RemoveAuditRuleAll(null));
}
[Fact]
public void RemoveAuditRuleSpecific_InvalidObjectAuditRule()
{
var customObjectSecurity = new CustomDirectoryObjectSecurity();
Assert.Throws<ArgumentNullException>("rule", () => customObjectSecurity.RemoveAuditRuleSpecific(null));
AssertExtensions.Throws<ArgumentNullException>("rule", () => customObjectSecurity.RemoveAuditRuleSpecific(null));
}
[Fact]
public void RemoveAuditRule_InvalidObjectAuditRule()
{
var customObjectSecurity = new CustomDirectoryObjectSecurity();
Assert.Throws<ArgumentNullException>("rule", () => customObjectSecurity.RemoveAuditRule(null));
AssertExtensions.Throws<ArgumentNullException>("rule", () => customObjectSecurity.RemoveAuditRule(null));
}
[Fact]
public void SetAuditRule_InvalidObjectAuditRule()
{
var customObjectSecurity = new CustomDirectoryObjectSecurity();
Assert.Throws<ArgumentNullException>("rule", () => customObjectSecurity.SetAuditRule(null));
AssertExtensions.Throws<ArgumentNullException>("rule", () => customObjectSecurity.SetAuditRule(null));
}
[Fact]
public void AddAuditRule_InvalidObjectAuditRule()
{
var customObjectSecurity = new CustomDirectoryObjectSecurity();
Assert.Throws<ArgumentNullException>("rule", () => customObjectSecurity.AddAuditRule(null));
AssertExtensions.Throws<ArgumentNullException>("rule", () => customObjectSecurity.AddAuditRule(null));
}
[Fact]
public void RemoveAccessRuleSpecific_InvalidObjectAccessRule()
{
var customObjectSecurity = new CustomDirectoryObjectSecurity();
Assert.Throws<ArgumentNullException>("rule", () => customObjectSecurity.RemoveAccessRuleSpecific(null));
AssertExtensions.Throws<ArgumentNullException>("rule", () => customObjectSecurity.RemoveAccessRuleSpecific(null));
}
[Fact]
public void RemoveAccessRuleAll_InvalidObjectAccessRule()
{
var customObjectSecurity = new CustomDirectoryObjectSecurity();
Assert.Throws<ArgumentNullException>("rule", () => customObjectSecurity.RemoveAccessRuleAll(null));
AssertExtensions.Throws<ArgumentNullException>("rule", () => customObjectSecurity.RemoveAccessRuleAll(null));
}
[Fact]
public void RemoveAccessRule_InvalidObjectAccessRule()
{
var customObjectSecurity = new CustomDirectoryObjectSecurity();
Assert.Throws<ArgumentNullException>("rule", () => customObjectSecurity.RemoveAccessRule(null));
AssertExtensions.Throws<ArgumentNullException>("rule", () => customObjectSecurity.RemoveAccessRule(null));
}
[Fact]
public void ResetAccessRule_InvalidObjectAccessRule()
{
var customObjectSecurity = new CustomDirectoryObjectSecurity();
Assert.Throws<ArgumentNullException>("rule", () => customObjectSecurity.ResetAccessRule(null));
AssertExtensions.Throws<ArgumentNullException>("rule", () => customObjectSecurity.ResetAccessRule(null));
}
[Fact]
public void SetAccessRule_InvalidObjectAccessRule()
{
var customObjectSecurity = new CustomDirectoryObjectSecurity();
Assert.Throws<ArgumentNullException>("rule", () => customObjectSecurity.SetAccessRule(null));
AssertExtensions.Throws<ArgumentNullException>("rule", () => customObjectSecurity.SetAccessRule(null));
}
[Fact]
public void AddAccessRule_InvalidObjectAccessRule()
{
var customObjectSecurity = new CustomDirectoryObjectSecurity();
Assert.Throws<ArgumentNullException>("rule", () => customObjectSecurity.AddAccessRule(null));
AssertExtensions.Throws<ArgumentNullException>("rule", () => customObjectSecurity.AddAccessRule(null));
}
private class CustomDirectoryObjectSecurity : DirectoryObjectSecurity
@@ -26,7 +26,7 @@ namespace System.IO
public void FileSystemAccessRule_InvalidFileSystemRights()
{
var identity = new SecurityIdentifier(WellKnownSidType.WorldSid, null);
Assert.Throws<ArgumentOutOfRangeException>("fileSystemRights", () =>
AssertExtensions.Throws<ArgumentOutOfRangeException>("fileSystemRights", () =>
new FileSystemAccessRule(identity, (FileSystemRights)(-1), AccessControlType.Allow));
}
@@ -171,7 +171,7 @@ namespace System.IO
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))
{
Assert.Throws<ArgumentNullException>("fileSecurity", () => FileSystemAclExtensions.SetAccessControl(fileStream, (FileSecurity)null));
AssertExtensions.Throws<ArgumentNullException>("fileSecurity", () => FileSystemAclExtensions.SetAccessControl(fileStream, (FileSecurity)null));
}
}
@@ -42,7 +42,7 @@ namespace System.Security.AccessControl
{
var fileSystemRights = (FileSystemRights)(-1);
var identity = new SecurityIdentifier(WellKnownSidType.WorldSid, null);
Assert.Throws<ArgumentOutOfRangeException>("fileSystemRights", () => new FileSystemAuditRule(@"MYDOMAIN\MyAccount", fileSystemRights, AuditFlags.Failure));
AssertExtensions.Throws<ArgumentOutOfRangeException>("fileSystemRights", () => new FileSystemAuditRule(@"MYDOMAIN\MyAccount", fileSystemRights, AuditFlags.Failure));
}
@@ -18,7 +18,7 @@ namespace System.IO
public void AddAccessRule_InvalidFileSystemAccessRule()
{
var fileSecurity = new FileSecurity();
Assert.Throws<ArgumentNullException>("rule", () => fileSecurity.AddAccessRule(null));
AssertExtensions.Throws<ArgumentNullException>("rule", () => fileSecurity.AddAccessRule(null));
}
[Fact]
@@ -41,7 +41,7 @@ namespace System.IO
public void SetAccessRule_InvalidFileSystemAccessRule()
{
var fileSecurity = new FileSecurity();
Assert.Throws<ArgumentNullException>("rule", () => fileSecurity.SetAccessRule(null));
AssertExtensions.Throws<ArgumentNullException>("rule", () => fileSecurity.SetAccessRule(null));
}
[Fact]
@@ -89,7 +89,7 @@ namespace System.IO
public void ResetAccessRule_InvalidFileSystemAccessRule()
{
var fileSecurity = new FileSecurity();
Assert.Throws<ArgumentNullException>("rule", () => fileSecurity.ResetAccessRule(null));
AssertExtensions.Throws<ArgumentNullException>("rule", () => fileSecurity.ResetAccessRule(null));
}
[Fact]
@@ -121,7 +121,7 @@ namespace System.IO
public void RemoveAccessRule_InvalidFileSystemAccessRule()
{
var fileSecurity = new FileSecurity();
Assert.Throws<ArgumentNullException>("rule", () => fileSecurity.RemoveAccessRule(null));
AssertExtensions.Throws<ArgumentNullException>("rule", () => fileSecurity.RemoveAccessRule(null));
}
[Fact]
@@ -184,7 +184,7 @@ namespace System.IO
public void RemoveAccessRuleSpecific_Invalid_FileSystemAccessRule()
{
var fileSecurity = new FileSecurity();
Assert.Throws<ArgumentNullException>("rule", () => fileSecurity.RemoveAccessRuleSpecific(null));
AssertExtensions.Throws<ArgumentNullException>("rule", () => fileSecurity.RemoveAccessRuleSpecific(null));
}
[Fact]
@@ -226,7 +226,7 @@ namespace System.IO
public void RemoveAccessRuleAll_InvalidFileSystemAccessRule()
{
var fileSecurity = new FileSecurity();
Assert.Throws<ArgumentNullException>("rule", () => fileSecurity.RemoveAccessRuleAll(null));
AssertExtensions.Throws<ArgumentNullException>("rule", () => fileSecurity.RemoveAccessRuleAll(null));
}
[Fact]