mirror of
https://github.com/BepInEx/dotnet-runtime.git
synced 2026-11-23 03:39:35 -10:00
Bulk updates of tests for AssertExtensions (dotnet/corefx#18491)
Bulk update to AssertExtensions.Throws for AOT support. This doesn't disable Assert.Throws. Commit migrated from https://github.com/dotnet/corefx/commit/b43b4df2e0e2182154bb0f425cb4a61bc1269828
This commit is contained in:
1 parent
c765bde0b8
commit
252cdc5e95
751 files changed
+5889
-5598
No files matched your search
+4
-3
@@ -2,6 +2,7 @@
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System;
|
||||
using System.Security.AccessControl;
|
||||
using Xunit;
|
||||
|
||||
@@ -105,7 +106,7 @@ namespace System.IO
|
||||
using (var directory = new TempDirectory())
|
||||
{
|
||||
DirectoryInfo directoryInfo = new DirectoryInfo(directory.Path);
|
||||
Assert.Throws<ArgumentNullException>("directorySecurity", () => directoryInfo.SetAccessControl((DirectorySecurity) null));
|
||||
AssertExtensions.Throws<ArgumentNullException>("directorySecurity", () => directoryInfo.SetAccessControl((DirectorySecurity) null));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -128,7 +129,7 @@ namespace System.IO
|
||||
using (var file = new TempFile(Path.Combine(directory.Path, "file.txt")))
|
||||
{
|
||||
FileInfo fileInfo = new FileInfo(file.Path);
|
||||
Assert.Throws<ArgumentNullException>("fileSecurity", () => fileInfo.SetAccessControl((FileSecurity) null));
|
||||
AssertExtensions.Throws<ArgumentNullException>("fileSecurity", () => fileInfo.SetAccessControl((FileSecurity) null));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -151,4 +152,4 @@ namespace System.IO
|
||||
Assert.Throws<NullReferenceException>(() => FileSystemAclExtensions.SetAccessControl((FileStream)null, (FileSecurity)null));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+3
@@ -8,6 +8,9 @@
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard-Windows_NT-Release|AnyCPU'" />
|
||||
<ItemGroup>
|
||||
<Compile Include="FileSystemAclExtensionsTests.cs" />
|
||||
<Compile Include="$(CommonTestPath)\System\AssertExtensions.cs">
|
||||
<Link>Common\System\AssertExtensions.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="$(CommonTestPath)\System\IO\TempFile.cs">
|
||||
<Link>Common\System\IO\TempFile.cs</Link>
|
||||
</Compile>
|
||||
|
||||
Reference in new issue
Block a user