Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,13 @@
mockFileSystem.SimulationMode != SimulationMode.Native);
Skip.If(Test.RunsOnMac, "GetDrives() can cause a native crash on macOS.");

System.IO.DriveInfo driveInfo = System.IO.DriveInfo.GetDrives()[0];
System.IO.DriveInfo driveInfo = System.IO.DriveInfo.GetDrives()
.First(d => d.Name == System.IO.Path.GetPathRoot(d.Name));

Check warning on line 140 in Tests/Testably.Abstractions.Tests/FileSystem/DriveInfoFactory/Tests.cs

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Use string.Equals instead of Equals operator

See more on https://sonarcloud.io/project/issues?id=Testably_Testably.Abstractions&issues=AaGY4cm8X8vNKzss2cJY&open=AaGY4cm8X8vNKzss2cJY&pullRequest=1181

IDriveInfo result = FileSystem.DriveInfo.Wrap(driveInfo);

await That(result.Name).IsEqualTo(driveInfo.Name);
await That(result.Name).IsEqualTo(driveInfo.Name)
.Because("the mock has no mount points like '/run' on Linux, so only a root drive keeps its name");
}

[Test]
Expand Down
Loading