diff --git a/src/libraries/System.IO.FileSystem.DriveInfo/tests/DriveInfo.Unix.Tests.cs b/src/libraries/System.IO.FileSystem.DriveInfo/tests/DriveInfo.Unix.Tests.cs index c922752d44757..d1475e38bbadb 100644 --- a/src/libraries/System.IO.FileSystem.DriveInfo/tests/DriveInfo.Unix.Tests.cs +++ b/src/libraries/System.IO.FileSystem.DriveInfo/tests/DriveInfo.Unix.Tests.cs @@ -60,29 +60,30 @@ public void PropertiesOfInvalidDrive() } [Fact] - [PlatformSpecific(TestPlatforms.AnyUnix & ~TestPlatforms.Android)] + [PlatformSpecific(TestPlatforms.AnyUnix)] public void PropertiesOfValidDrive() { - var root = new DriveInfo("/"); - var format = root.DriveFormat; - Assert.Equal(PlatformDetection.IsBrowser ? DriveType.Unknown : DriveType.Fixed, root.DriveType); - Assert.True(root.IsReady); - Assert.Equal("/", root.Name); - Assert.Equal("/", root.ToString()); - Assert.Equal("/", root.RootDirectory.FullName); - Assert.Equal("/", root.VolumeLabel); + var driveName = PlatformDetection.IsAndroid ? "/data" : "/"; + var driveInfo = new DriveInfo(driveName); + var format = driveInfo.DriveFormat; + Assert.Equal(PlatformDetection.IsBrowser ? DriveType.Unknown : DriveType.Fixed, driveInfo.DriveType); + Assert.True(driveInfo.IsReady); + Assert.Equal(driveName, driveInfo.Name); + Assert.Equal(driveName, driveInfo.ToString()); + Assert.Equal(driveName, driveInfo.RootDirectory.FullName); + Assert.Equal(driveName, driveInfo.VolumeLabel); if (PlatformDetection.IsBrowser) { - Assert.True(root.AvailableFreeSpace == 0); - Assert.True(root.TotalFreeSpace == 0); - Assert.True(root.TotalSize == 0); + Assert.True(driveInfo.AvailableFreeSpace == 0); + Assert.True(driveInfo.TotalFreeSpace == 0); + Assert.True(driveInfo.TotalSize == 0); } else { - Assert.True(root.AvailableFreeSpace > 0); - Assert.True(root.TotalFreeSpace > 0); - Assert.True(root.TotalSize > 0); + Assert.True(driveInfo.AvailableFreeSpace > 0); + Assert.True(driveInfo.TotalFreeSpace > 0); + Assert.True(driveInfo.TotalSize > 0); } }