feat: add drive info expectations#146
Conversation
There was a problem hiding this comment.
Pull request overview
Adds drive-level assertions to aweXpect.Testably, enabling expressive expectations on IFileSystem drive presence via HasDrive/DoesNotHaveDrive (including .Which chaining), plus a set of IDriveInfo property assertions (readiness, sizes, format, type, name, volume label). Documentation and public API snapshots are updated accordingly.
Changes:
- Introduces
FileSystemExtensions.HasDrive/DoesNotHaveDriveand a newDriveResult<TParent>to support.Whichchaining intoIDriveInfoassertions. - Adds
DriveInfoExtensionswith multipleIThat<IDriveInfo>expectations (ready state, space/size, format/type, name/label). - Updates README and API approval test baselines to document/reflect the new surface area.
Reviewed changes
Copilot reviewed 29 out of 29 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| Tests/aweXpect.Testably.Tests/FileSystem.HasDrive.Which.Tests.cs | Tests for .Which chaining from HasDrive into IDriveInfo assertions. |
| Tests/aweXpect.Testably.Tests/FileSystem.HasDrive.Tests.cs | Tests for HasDrive success/failure and case-insensitive matching. |
| Tests/aweXpect.Testably.Tests/FileSystem.HasDrive.cs | Test class scaffolding for HasDrive grouping. |
| Tests/aweXpect.Testably.Tests/FileSystem.DoesNotHaveDrive.Tests.cs | Tests for DoesNotHaveDrive success/failure. |
| Tests/aweXpect.Testably.Tests/DriveInfo.IsReady.Tests.cs | Tests for That(IDriveInfo).IsReady(). |
| Tests/aweXpect.Testably.Tests/DriveInfo.IsNotReady.Tests.cs | Tests for That(IDriveInfo).IsNotReady(). |
| Tests/aweXpect.Testably.Tests/DriveInfo.HasVolumeLabel.Tests.cs | Tests for HasVolumeLabel and negation behavior. |
| Tests/aweXpect.Testably.Tests/DriveInfo.HasTotalSize.Tests.cs | Tests for HasTotalSize and negation behavior. |
| Tests/aweXpect.Testably.Tests/DriveInfo.HasTotalFreeSpace.Tests.cs | Tests for HasTotalFreeSpace and negation behavior. |
| Tests/aweXpect.Testably.Tests/DriveInfo.HasName.Tests.cs | Tests for HasName and negation behavior. |
| Tests/aweXpect.Testably.Tests/DriveInfo.HasDriveType.Tests.cs | Tests for HasDriveType and negation behavior. |
| Tests/aweXpect.Testably.Tests/DriveInfo.HasDriveFormat.Tests.cs | Tests for HasDriveFormat and negation behavior. |
| Tests/aweXpect.Testably.Tests/DriveInfo.HasAvailableFreeSpace.Tests.cs | Tests for HasAvailableFreeSpace and negation behavior. |
| Tests/aweXpect.Testably.Tests/DriveInfo.cs | Test class scaffolding for DriveInfo grouping. |
| Tests/aweXpect.Testably.Api.Tests/Expected/aweXpect.Testably_netstandard2.0.txt | Updates API snapshot for new drive assertions/results. |
| Tests/aweXpect.Testably.Api.Tests/Expected/aweXpect.Testably_net8.0.txt | Updates API snapshot for new drive assertions/results. |
| Tests/aweXpect.Testably.Api.Tests/Expected/aweXpect.Testably_net10.0.txt | Updates API snapshot for new drive assertions/results. |
| Source/aweXpect.Testably/Results/DriveResult.cs | Adds DriveResult<TParent> enabling .Which to continue with IDriveInfo expectations. |
| Source/aweXpect.Testably/FileSystemExtensions.HasDrive.cs | Adds HasDrive/DoesNotHaveDrive extensions and drive resolution/constraint. |
| Source/aweXpect.Testably/DriveInfoExtensions.IsReady.cs | Adds IsReady/IsNotReady assertions for IDriveInfo. |
| Source/aweXpect.Testably/DriveInfoExtensions.HasVolumeLabel.cs | Adds HasVolumeLabel assertion for IDriveInfo. |
| Source/aweXpect.Testably/DriveInfoExtensions.HasTotalSize.cs | Adds HasTotalSize assertion for IDriveInfo. |
| Source/aweXpect.Testably/DriveInfoExtensions.HasTotalFreeSpace.cs | Adds HasTotalFreeSpace assertion for IDriveInfo. |
| Source/aweXpect.Testably/DriveInfoExtensions.HasName.cs | Adds HasName assertion for IDriveInfo. |
| Source/aweXpect.Testably/DriveInfoExtensions.HasDriveType.cs | Adds HasDriveType assertion for IDriveInfo. |
| Source/aweXpect.Testably/DriveInfoExtensions.HasDriveFormat.cs | Adds HasDriveFormat assertion for IDriveInfo. |
| Source/aweXpect.Testably/DriveInfoExtensions.HasAvailableFreeSpace.cs | Adds HasAvailableFreeSpace assertion for IDriveInfo. |
| Source/aweXpect.Testably/DriveInfoExtensions.cs | Adds the DriveInfoExtensions partial class container. |
| README.md | Documents new drive assertions and .Which chaining usage. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
🚀 Benchmark ResultsDetails
|
1f49d46 to
e9b25c1
Compare
|
👽 Mutation ResultsaweXpect.TestablyDetails
The final mutation score is 49.66%Coverage Thresholds: high:80 low:60 break:0 |
|
This is addressed in release v0.15.0. |



This pull request adds comprehensive support for drive-level assertions to the testing library, both in documentation and implementation. It introduces new extension methods for asserting properties of
IDriveInfoobjects, such as drive existence, readiness, size, format, and more. The documentation is updated to demonstrate these new capabilities, and the codebase now includes several new files implementing these assertions.Drive assertion support:
HasDriveandDoesNotHaveDriveextension methods toIFileSystemfor asserting the presence or absence of drives by name, with case-insensitive matching and.Whichchaining to accessIDriveInfoassertions.DriveInfoExtensionsas the container for all drive-related assertion extensions.Drive property assertions:
IThat<IDriveInfo>for asserting drive properties:IsReadyandIsNotReadyto check drive readinessHasTotalSize,HasTotalFreeSpace, andHasAvailableFreeSpacefor size-related assertionsHasDriveFormat,HasDriveType,HasName, andHasVolumeLabelfor format, type, name, and label assertionsDocumentation updates:
README.mdwith a new "Drives" section, including usage examples for the new drive assertions and.Whichchaining..Whichto includeHasDrivein addition toHasFileandHasDirectory.These changes significantly enhance the ability to write expressive and comprehensive tests involving file system drives.