Imported Upstream version 5.8.0.22

Former-commit-id: df344e34b07851d296efb3e6604c8db42b6f7aa3
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2017-10-19 20:04:20 +00:00
parent 5f4a27cc8a
commit 7d05485754
5020 changed files with 114082 additions and 186061 deletions

View File

@@ -1,5 +0,0 @@
kernel32.dll!GetDriveTypeW
kernel32.dll!GetLogicalDrives
kernel32.dll!GetVolumeInformationW
kernel32.dll!SetThreadErrorMode
kernel32.dll!SetVolumeLabelW

View File

@@ -16,19 +16,32 @@ namespace System.IO.FileSystem.DriveInfoTests
{
public class DriveInfoWindowsTests
{
[Theory]
[InlineData(":\0", "driveName")]
[InlineData(":", null)]
[InlineData("://", null)]
[InlineData(@":\", null)]
[InlineData(":/", null)]
[InlineData(@":\\", null)]
[InlineData("Az", null)]
[InlineData("1", null)]
[InlineData("a1", null)]
[InlineData(@"\\share", null)]
[InlineData(@"\\", null)]
[InlineData("c ", null)]
[InlineData("", "path")]
[InlineData(" c", null)]
public void Ctor_InvalidPath_ThrowsArgumentException(string driveName, string paramName)
{
AssertExtensions.Throws<ArgumentException>(paramName, null, () => new DriveInfo(driveName));
}
[Fact]
[PlatformSpecific(TestPlatforms.Windows)]
public void TestConstructor()
{
string[] invalidInput = { ":\0", ":", "://", @":\", ":/", @":\\", "Az", "1", "a1", @"\\share", @"\\", "c ", string.Empty, " c" };
string[] variableInput = { "{0}", "{0}", "{0}:", "{0}:", @"{0}:\", @"{0}:\\", "{0}://" };
// Test Invalid input
foreach (var input in invalidInput)
{
Assert.Throws<ArgumentException>(() => { new DriveInfo(input); });
}
// Test Null
Assert.Throws<ArgumentNullException>(() => { new DriveInfo(null); });
@@ -128,6 +141,7 @@ namespace System.IO.FileSystem.DriveInfoTests
[Fact]
[PlatformSpecific(TestPlatforms.Windows)]
[SkipOnTargetFramework(TargetFrameworkMonikers.Uap, "GetDiskFreeSpaceEx blocked in AC")]
public void TestValidDiskSpaceProperties()
{
bool win32Result;

View File

@@ -10,9 +10,6 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard-Windows_NT-Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard-Windows_NT-Release|AnyCPU'" />
<ItemGroup>
<Compile Include="$(CommonTestPath)\System\AssertExtensions.cs">
<Link>Common\System\AssertExtensions.cs</Link>
</Compile>
<Compile Include="DriveInfo.Unix.Tests.cs" Condition="'$(TargetsUnix)' == 'true'" />
<Compile Include="DriveInfo.Windows.Tests.cs" Condition="'$(TargetsWindows)' == 'true'" />
<Compile Include="$(CommonTestPath)\System\PlatformDetection.cs">