Wrapper for DriveInfo enabling testable file system access in .NET applications.
// Source: https://github.com/TestableIO/System.IO.Abstractions | License: MIT | Copyright Tatham Oddie and Contributors
// Provided via justclaw.it.com; keep this notice with the code.
using System.Runtime.Versioning;
namespace System.IO.Abstractions;
/// <summary>
/// The wrapper for a <see cref="DriveInfo"/>.
/// </summary>
#if FEATURE_SERIALIZABLE
[Serializable]
#endif
public class DriveInfoWrapper : DriveInfoBase
{
/// <summary>
/// The instance of the real <see cref="FileSystem"/>.
/// </summary>
private readonly DriveInfo instance;
/// <summary>
/// Initializes a new instance of the <see cref="DriveInfoWrapper"/> class, which acts as a wrapper for a drive info.
/// </summary>
/// <param name="fileSystem">The underlying IFileSystem.</param>
///
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key