Enable analyzer for xUnit2000 (Constants and literals should be the expected argument) (dotnet/corefx#39842)

* Enable xUnit2000 analyzer

This commit enables xUnit2000 (Constants and literals should be the expected argument) and apply fixes for the existing violating codes.
* a Massive commit fixing xUnit2000
* fixing some 2003 errors

* Fix mistakes

* Fix missed errors for unix


Commit migrated from https://github.com/dotnet/corefx/commit/93d7aa1c1737b6da29d04b78557215e18eb786d4
This commit is contained in:
Ganbarukamo41 authored and Dan Moseley committed 2019-07-28 15:47:52 -07:00
1 parent 0d73813e42
commit 9be9c570be
189 files changed
+1387 -1387

No files matched your search

@@ -37,7 +37,7 @@ namespace System.Security.AccessControl
Assert.Equal(1, rules.Count);
CustomAccessRule rule = (CustomAccessRule)rules[0];
// Should be users group
Assert.Equal(rule.IdentityReference.Value, "S-1-5-32-545");
Assert.Equal("S-1-5-32-545", rule.IdentityReference.Value);
Assert.Equal(AccessControlType.Allow, rule.AccessControlType);
Assert.Equal(InheritanceFlags.ContainerInherit | InheritanceFlags.ObjectInherit, rule.InheritanceFlags);
Assert.Equal(0x1200a9, rule.AccessMaskValue);
@@ -14,8 +14,8 @@ namespace System.Security.AccessControl
{
var auditRule = new FileSystemAuditRule(Helpers.s_WorldSidNTAccount, FileSystemRights.ReadData, AuditFlags.Failure);
Assert.Equal(auditRule.IdentityReference, Helpers.s_WorldSidNTAccount);
Assert.Equal(auditRule.FileSystemRights, FileSystemRights.ReadData);
Assert.Equal(auditRule.AuditFlags, AuditFlags.Failure);
Assert.Equal(FileSystemRights.ReadData, auditRule.FileSystemRights);
Assert.Equal(AuditFlags.Failure, auditRule.AuditFlags);
}
[Fact]
@@ -23,17 +23,17 @@ namespace System.Security.AccessControl
{
var auditRule = new FileSystemAuditRule(@"MYDOMAIN\MyAccount", FileSystemRights.ReadData,
InheritanceFlags.ObjectInherit, PropagationFlags.InheritOnly, AuditFlags.Failure);
Assert.Equal(auditRule.PropagationFlags, PropagationFlags.InheritOnly);
Assert.Equal(auditRule.InheritanceFlags, InheritanceFlags.ObjectInherit);
Assert.Equal(PropagationFlags.InheritOnly, auditRule.PropagationFlags);
Assert.Equal(InheritanceFlags.ObjectInherit, auditRule.InheritanceFlags);
}
[Fact]
public void ObjectInitialization_Identity_FileSystemRights_AuditFlags_Success()
{
var auditRule = new FileSystemAuditRule(@"MYDOMAIN\MyAccount", FileSystemRights.ReadData, AuditFlags.Failure);
Assert.Equal(auditRule.FileSystemRights, FileSystemRights.ReadData);
Assert.Equal(auditRule.AuditFlags, AuditFlags.Failure);
Assert.Equal(auditRule.IdentityReference.Value, @"MYDOMAIN\MyAccount");
Assert.Equal(FileSystemRights.ReadData, auditRule.FileSystemRights);
Assert.Equal(AuditFlags.Failure, auditRule.AuditFlags);
Assert.Equal(@"MYDOMAIN\MyAccount", auditRule.IdentityReference.Value);
}
[Fact]
@@ -49,7 +49,7 @@ namespace System.Security.AccessControl
{
var auditRule = new FileSystemAuditRule(@"MYDOMAIN\MyAccount", FileSystemRights.ReadData, AuditFlags.Failure);
FileSystemRights fileSystemRights = auditRule.FileSystemRights;
Assert.Equal(fileSystemRights, FileSystemRights.ReadData);
Assert.Equal(FileSystemRights.ReadData, fileSystemRights);
}
}
}