mirror of
https://github.com/BepInEx/dotnet-runtime.git
synced 2026-11-24 04:11:14 -10:00
Commit migrated from https://github.com/dotnet/corefx/commit/493cb79ff4976479be5cc7c6f1fe2d5d9b710425
33 lines
1.1 KiB
C#
33 lines
1.1 KiB
C#
// Licensed to the .NET Foundation under one or more agreements.
|
|
// 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.Linq;
|
|
using System.Runtime.InteropServices;
|
|
using Xunit;
|
|
|
|
namespace System.IO.Tests
|
|
{
|
|
public class Directory_GetLogicalDrives
|
|
{
|
|
[Fact]
|
|
[PlatformSpecific(TestPlatforms.AnyUnix)] // Valid drive strings on Unix
|
|
public void GetsValidDriveStrings_Unix()
|
|
{
|
|
string[] drives = Directory.GetLogicalDrives();
|
|
Assert.NotEmpty(drives);
|
|
Assert.All(drives, d => Assert.NotNull(d));
|
|
Assert.Contains(drives, d => d == "/");
|
|
}
|
|
|
|
[Fact]
|
|
[PlatformSpecific(TestPlatforms.Windows)] // Valid drive strings on Windows
|
|
public void GetsValidDriveStrings_Windows()
|
|
{
|
|
string[] drives = Directory.GetLogicalDrives();
|
|
Assert.NotEmpty(drives);
|
|
Assert.All(drives, d => Assert.Matches(@"^[A-Z]:\\$", d));
|
|
}
|
|
}
|
|
}
|