diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json
new file mode 100644
index 000000000..4505872b7
--- /dev/null
+++ b/.devcontainer/devcontainer.json
@@ -0,0 +1,8 @@
+{
+ "name": "C# (.NET Core)",
+ "image": "mcr.microsoft.com/vscode/devcontainers/dotnet:10.0",
+ "settings": {
+ "terminal.integrated.shell.linux": "/bin/bash"
+ },
+ "postCreateCommand": "dotnet restore"
+}
\ No newline at end of file
diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 000000000..64fe33bba
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,11 @@
+; This file is for unifying the coding style for different editors and IDEs.
+; More information at http://EditorConfig.org
+
+root = true
+
+[*]
+end_of_line = CRLF
+
+[*.cs]
+indent_style = space
+indent_size = 4
diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md
new file mode 100644
index 000000000..3f67edd4a
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/bug_report.md
@@ -0,0 +1,24 @@
+---
+name: Bug report
+about: Create a report to help us improve
+title: ''
+labels: 'state: needs discussion, type: bug'
+assignees: ''
+
+---
+
+**Describe the bug**
+A clear and concise description of what the bug is.
+
+**To Reproduce**
+Steps to reproduce the behavior:
+1. Go to '...'
+2. Click on '....'
+3. Scroll down to '....'
+4. See error
+
+**Expected behavior**
+A clear and concise description of what you expected to happen.
+
+**Additional context**
+Add any other context about the problem here.
diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md
new file mode 100644
index 000000000..a5f90597a
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/feature_request.md
@@ -0,0 +1,20 @@
+---
+name: Feature request
+about: Suggest an idea for this project
+title: ''
+labels: 'state: needs discussion, type: enhancement'
+assignees: ''
+
+---
+
+**Is your feature request related to a problem? Please describe.**
+A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
+
+**Describe the solution you'd like**
+A clear and concise description of what you want to happen.
+
+**Describe alternatives you've considered**
+A clear and concise description of any alternative solutions or features you've considered.
+
+**Additional context**
+Add any other context or screenshots about the feature request here.
diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md
new file mode 100644
index 000000000..6d1647723
--- /dev/null
+++ b/.github/copilot-instructions.md
@@ -0,0 +1,147 @@
+# System.IO.Abstractions Development Guide
+
+System.IO.Abstractions is a .NET library that provides testable abstractions for System.IO operations, enabling developers to write unit tests that don't rely on the actual file system.
+
+**ALWAYS reference these instructions first and fallback to search or bash commands only when you encounter unexpected information that does not match the info here.**
+
+## Working Effectively
+
+### Bootstrap and Build Process
+- **CRITICAL**: Install .NET SDK 9.0.304 (required version specified in global.json):
+ ```bash
+ curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin --version 9.0.304
+ export PATH="$HOME/.dotnet:$PATH"
+ ```
+- Verify installation: `dotnet --version` should return `9.0.304`
+- **Build the solution**: `dotnet build` -- takes ~70 seconds. NEVER CANCEL. Set timeout to 120+ minutes.
+- **Run all tests**: `dotnet test --configuration Release` -- takes ~30 seconds. NEVER CANCEL. Set timeout to 60+ minutes.
+
+### Code Quality and Formatting
+- **ALWAYS run code formatting before committing**: `dotnet format`
+- **Verify formatting compliance**: `dotnet format --verify-no-changes` -- takes ~40 seconds. NEVER CANCEL.
+- The codebase uses EditorConfig with CRLF line endings and 4-space indentation for C# files
+- **CRITICAL**: All formatting issues must be resolved before CI will pass
+
+### Build System Details
+- **Primary build method**: `dotnet build` and `dotnet test` commands work reliably
+- **NUKE build script**: `./build.sh` available but may have GitVersion issues with shallow clones
+- **Available NUKE targets**: UnitTests, ApiChecks, CodeCoverage, CodeAnalysis, Pack
+- **Build artifacts**: Generated in `Artifacts/` and `TestResults/` directories
+
+## Project Structure
+
+### Key Projects
+- **System.IO.Abstractions**: Core abstractions and interfaces
+- **TestableIO.System.IO.Abstractions**: Main implementation
+- **TestableIO.System.IO.Abstractions.Wrappers**: Wrapper implementations
+- **TestableIO.System.IO.Abstractions.TestingHelpers**: Mock implementations for testing
+- **Multiple test projects**: Comprehensive test coverage across different scenarios
+
+### Target Frameworks
+- .NET Framework 4.7.2 (net472)
+- .NET Standard 2.0, 2.1 (netstandard2.0, netstandard2.1)
+- .NET 6.0, 8.0, 9.0 (net6.0, net8.0, net9.0)
+
+### Important Directories
+- `src/`: All source code projects
+- `tests/`: All test projects including unit tests, API tests, and parity tests
+- `benchmarks/`: Performance benchmarking projects
+- `Pipeline/`: NUKE build system configuration
+- `.github/workflows/`: CI/CD pipeline definitions
+
+## Validation
+
+### Manual Validation Steps
+After making changes, ALWAYS validate functionality by:
+
+1. **Build verification**: `dotnet build` must succeed
+2. **Test execution**: `dotnet test --configuration Release` must pass
+3. **Code formatting**: `dotnet format --verify-no-changes` must pass
+4. **Functional validation**: Create a test scenario to verify your changes work:
+
+```csharp
+using System.IO.Abstractions;
+using System.IO.Abstractions.TestingHelpers;
+
+// Test MockFileSystem functionality
+var mockFileSystem = new MockFileSystem();
+mockFileSystem.File.WriteAllText(@"C:\test.txt", "Test content");
+var content = mockFileSystem.File.ReadAllText(@"C:\test.txt");
+
+// Test real FileSystem functionality
+var realFileSystem = new FileSystem();
+var tempFile = "/tmp/test.txt";
+realFileSystem.File.WriteAllText(tempFile, "Real test");
+var realContent = realFileSystem.File.ReadAllText(tempFile);
+realFileSystem.File.Delete(tempFile);
+```
+
+### Test Suite Information
+- **Total tests**: ~2,234 tests across all projects
+- **Expected passing**: ~1,993 tests (some platform-specific tests are skipped on Linux)
+- **Test categories**: Unit tests, API compatibility tests, parity tests
+- **Platform considerations**: Some Windows-specific functionality is skipped on Linux/macOS
+
+### Continuous Integration Requirements
+The CI pipeline (.github/workflows/ci.yml) requires:
+- All unit tests to pass on Ubuntu, Windows, and macOS
+- API compatibility checks to succeed
+- Code formatting compliance
+- Static code analysis (SonarCloud) to pass
+
+## Common Development Tasks
+
+### Adding New Functionality
+- Implement abstractions in the main System.IO.Abstractions project
+- Add wrapper implementations in TestableIO.System.IO.Abstractions.Wrappers
+- Create mock implementations in TestableIO.System.IO.Abstractions.TestingHelpers
+- Add comprehensive tests covering all target frameworks
+- Update XML documentation for all public APIs
+
+### Debugging Build Issues
+- Check .NET SDK version compatibility first
+- Verify all package references are properly restored
+- For NUKE build issues, use direct `dotnet` commands instead
+- Review build logs in Artifacts/ directory for detailed error information
+
+### Package Management
+- Uses Central Package Management (Directory.Packages.props)
+- NuGet source: nuget.org only (configured in nuget.config)
+- Package versioning uses Nerdbank.GitVersioning
+
+## Pull Request Guidelines
+
+### Pull Request Title
+To communicate intent to the consumers of your library, the title of the pull requests is prefixed with one of the following elements:
+- `fix:`: patches a bug
+- `feat:`: introduces a new feature
+- `refactor:`: improves internal structure without changing the observable behavior
+- `docs:`: updates documentation or XML comments
+- `chore:`: updates to dependencies, build pipelines, ...
+
+## Performance Expectations
+
+### Command Timing (with appropriate timeouts)
+- **dotnet build**: ~70 seconds (set timeout: 120+ minutes)
+- **dotnet test**: ~30 seconds (set timeout: 60+ minutes)
+- **dotnet format**: ~40 seconds (set timeout: 10+ minutes)
+- **NUKE build restore**: ~30 seconds (set timeout: 10+ minutes)
+
+### **NEVER CANCEL** long-running operations
+Builds and tests may occasionally take longer than expected. Always wait for completion rather than canceling operations.
+
+## Troubleshooting
+
+### Common Issues
+- **GitVersion errors**: Use direct `dotnet` commands instead of NUKE build script
+- **Shallow clone issues**: Expected in GitHub Actions environment, doesn't affect functionality
+- **Platform-specific test failures**: Normal for Windows-specific functionality on Linux/macOS
+- **Code formatting failures**: Run `dotnet format` to fix automatically
+
+### SDK Installation Issues
+If .NET SDK 9.0.304 is not available:
+- Check global.json for exact version requirement
+- Use dotnet-install script with specific version
+- Ensure PATH includes the installed SDK location
+
+**Remember**: This is a mature, well-tested library with extensive CI/CD. Focus on maintaining compatibility across all target frameworks and ensuring comprehensive test coverage for any changes.
\ No newline at end of file
diff --git a/.github/mergify.yml b/.github/mergify.yml
new file mode 100644
index 000000000..edb6bc85d
--- /dev/null
+++ b/.github/mergify.yml
@@ -0,0 +1,16 @@
+pull_request_rules:
+ - name: Automatic merge on approval
+ conditions:
+ - "#approved-reviews-by>=1"
+ actions:
+ merge:
+ method: squash
+ commit_message_template: |-
+ {{ title }} (#{{ number }})
+ {{ body }}
+ - name: Automatic merge for Renovate pull requests
+ conditions:
+ - author=renovate[bot]
+ actions:
+ merge:
+ method: squash
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
new file mode 100644
index 000000000..7a56907ad
--- /dev/null
+++ b/.github/workflows/build.yml
@@ -0,0 +1,213 @@
+name: Build
+
+on:
+ push:
+ branches: [ main ]
+ tags: [ 'v[0-9]+.[0-9]+.[0-9]+*' ]
+
+jobs:
+ unit-tests:
+ name: "Unit tests"
+ strategy:
+ matrix:
+ os: [ ubuntu-latest, windows-latest, macos-latest ]
+ runs-on: ${{ matrix.os }}
+ steps:
+ - uses: actions/checkout@v6
+ with:
+ fetch-depth: 0
+ - name: Setup .NET SDKs
+ uses: actions/setup-dotnet@v5
+ with:
+ dotnet-version: |
+ 6.0.x
+ 7.0.x
+ 8.0.x
+ 9.0.x
+ 10.0.x
+ - name: Run unit tests (windows)
+ if: matrix.os == 'windows-latest'
+ run: ./build.ps1 CodeCoverage
+ - name: Run unit tests (ubuntu|macos)
+ if: matrix.os != 'windows-latest'
+ run: ./build.sh CodeCoverage
+ - name: Upload artifacts
+ if: always()
+ uses: actions/upload-artifact@v6
+ with:
+ name: ${{ runner.os }}-artifacts
+ path: |
+ ./Artifacts/*
+ ./TestResults/*.trx
+
+ api-tests:
+ name: "API tests"
+ runs-on: ubuntu-latest
+ env:
+ DOTNET_NOLOGO: true
+ steps:
+ - uses: actions/checkout@v6
+ with:
+ fetch-depth: 0
+ - name: Setup .NET SDKs
+ uses: actions/setup-dotnet@v5
+ with:
+ dotnet-version: |
+ 6.0.x
+ 7.0.x
+ 8.0.x
+ 9.0.x
+ 10.0.x
+ - name: API checks
+ run: ./build.sh ApiChecks
+ - name: Upload artifacts
+ if: always()
+ uses: actions/upload-artifact@v6
+ with:
+ name: API-tests
+ path: |
+ ./Artifacts/*
+ ./TestResults/*.trx
+
+ static-code-analysis:
+ name: "Static code analysis"
+ runs-on: ubuntu-latest
+ env:
+ REPORTGENERATOR_LICENSE: ${{ secrets.REPORTGENERATOR_LICENSE }}
+ SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
+ DOTNET_NOLOGO: true
+ steps:
+ - uses: actions/checkout@v6
+ with:
+ fetch-depth: 0
+ - name: Setup .NET SDKs
+ uses: actions/setup-dotnet@v5
+ with:
+ dotnet-version: |
+ 6.0.x
+ 7.0.x
+ 8.0.x
+ 9.0.x
+ 10.0.x
+ - name: Run sonarcloud analysis
+ run: ./build.sh CodeAnalysis
+
+ publish-test-results:
+ name: "Publish Tests Results"
+ needs: [ api-tests, unit-tests ]
+ runs-on: ubuntu-latest
+ permissions:
+ checks: write
+ pull-requests: write
+ if: always()
+ steps:
+ - name: Download Artifacts
+ uses: actions/download-artifact@v7
+ with:
+ path: artifacts
+ - name: Publish Test Results
+ uses: EnricoMi/publish-unit-test-result-action@v2
+ with:
+ comment_mode: always
+ files: "artifacts/**/**/*.trx"
+
+ pack:
+ name: "Pack"
+ runs-on: ubuntu-latest
+ needs: [ publish-test-results, static-code-analysis ]
+ env:
+ DOTNET_NOLOGO: true
+ steps:
+ - uses: actions/checkout@v6
+ with:
+ fetch-depth: 0
+ - name: Setup .NET SDKs
+ uses: actions/setup-dotnet@v5
+ with:
+ dotnet-version: |
+ 6.0.x
+ 7.0.x
+ 8.0.x
+ 9.0.x
+ 10.0.x
+ - name: Pack nuget packages
+ run: ./build.sh Pack
+ - name: Upload packages
+ if: always()
+ uses: actions/upload-artifact@v6
+ with:
+ path: Artifacts/Packages
+ name: Packages
+
+ push:
+ name: "Push"
+ if: ${{ startsWith(github.ref, 'refs/tags/v') }}
+ runs-on: macos-latest
+ environment: production
+ needs: [ pack ]
+ permissions:
+ contents: write
+ steps:
+ - name: Download packages
+ uses: actions/download-artifact@v7
+ with:
+ name: Packages
+ path: Artifacts/Packages
+ - name: Setup .NET SDKs
+ uses: actions/setup-dotnet@v5
+ - name: Publish
+ run: |
+ echo "Found the following packages to push:"
+ search_dir=Artifacts/Packages
+ for entry in Artifacts/Packages/*.nupkg
+ do
+ echo "- $entry"
+ done
+ for entry in Artifacts/Packages/*.nupkg
+ do
+ dotnet nuget push $entry --source https://api.nuget.org/v3/index.json --api-key "${{secrets.NUGET_API_KEY}}" --skip-duplicate
+ done
+ - name: Check pre-release
+ id: check-pre-release
+ run: |
+ if [[ ${{ github.event.ref }} =~ ^refs/tags/v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
+ echo "release=true" >> $GITHUB_OUTPUT
+ fi
+ - name: Create GitHub release
+ if: steps.check-pre-release.outputs.release == 'true'
+ continue-on-error: true
+ uses: softprops/action-gh-release@v2
+ with:
+ name: ${{ steps.tag.outputs.release_version }}
+ tag_name: ${{ steps.tag.outputs.release_version }}
+ token: ${{ secrets.GITHUB_TOKEN }}
+ generate_release_notes: true
+
+ finalize-release:
+ name: "Finalize release"
+ if: startsWith(github.ref, 'refs/tags/v')
+ runs-on: ubuntu-latest
+ needs: [ push ]
+ permissions:
+ contents: read
+ issues: write
+ pull-requests: write
+ steps:
+ - name: Check pre-release
+ id: check-pre-release
+ run: |
+ if [[ ${{ github.event.ref }} =~ ^refs/tags/v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
+ echo "release=true" >> $GITHUB_OUTPUT
+ fi
+ - name: Comment relevant issues and pull requests
+ if: steps.check-pre-release.outputs.release == 'true'
+ continue-on-error: true
+ uses: apexskier/github-release-commenter@v1.4.1
+ with:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ comment-template: |
+ This is addressed in release {release_link}.
+ label-template: |
+ state: released
+ skip-label: |
+ state: released
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
new file mode 100644
index 000000000..814ea78ab
--- /dev/null
+++ b/.github/workflows/ci.yml
@@ -0,0 +1,113 @@
+name: CI
+
+on:
+ workflow_dispatch:
+ pull_request:
+ branches: [ main ]
+
+jobs:
+ unit-tests:
+ name: "Unit tests"
+ strategy:
+ matrix:
+ os: [ ubuntu-latest, windows-latest, macos-latest ]
+ runs-on: ${{ matrix.os }}
+ steps:
+ - uses: actions/checkout@v6
+ with:
+ fetch-depth: 0
+ - name: Setup .NET SDKs
+ uses: actions/setup-dotnet@v5
+ with:
+ dotnet-version: |
+ 6.0.x
+ 7.0.x
+ 8.0.x
+ 9.0.x
+ 10.0.x
+ - name: Run unit tests (windows)
+ if: matrix.os == 'windows-latest'
+ run: ./build.ps1 CodeCoverage
+ - name: Run unit tests (ubuntu|macos)
+ if: matrix.os != 'windows-latest'
+ run: ./build.sh CodeCoverage
+ - name: Upload artifacts
+ if: always()
+ uses: actions/upload-artifact@v6
+ with:
+ name: ${{ runner.os }}-artifacts
+ path: |
+ ./Artifacts/*
+ ./TestResults/*.trx
+
+ api-tests:
+ name: "API tests"
+ runs-on: ubuntu-latest
+ env:
+ DOTNET_NOLOGO: true
+ steps:
+ - uses: actions/checkout@v6
+ with:
+ fetch-depth: 0
+ - name: Setup .NET SDKs
+ uses: actions/setup-dotnet@v5
+ with:
+ dotnet-version: |
+ 6.0.x
+ 7.0.x
+ 8.0.x
+ 9.0.x
+ 10.0.x
+ - name: API checks
+ run: ./build.sh ApiChecks
+ - name: Upload artifacts
+ if: always()
+ uses: actions/upload-artifact@v6
+ with:
+ name: API-tests
+ path: |
+ ./Artifacts/*
+ ./TestResults/*.trx
+
+ static-code-analysis:
+ name: "Static code analysis"
+ if: ${{ github.actor != 'dependabot[bot]' && github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name }}
+ runs-on: ubuntu-latest
+ env:
+ REPORTGENERATOR_LICENSE: ${{ secrets.REPORTGENERATOR_LICENSE }}
+ SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
+ DOTNET_NOLOGO: true
+ steps:
+ - uses: actions/checkout@v6
+ with:
+ fetch-depth: 0
+ - name: Setup .NET SDKs
+ uses: actions/setup-dotnet@v5
+ with:
+ dotnet-version: |
+ 6.0.x
+ 7.0.x
+ 8.0.x
+ 9.0.x
+ 10.0.x
+ - name: Run sonarcloud analysis
+ run: ./build.sh CodeAnalysis
+
+ publish-test-results:
+ name: "Publish Tests Results"
+ needs: [ api-tests, unit-tests ]
+ runs-on: ubuntu-latest
+ permissions:
+ checks: write
+ pull-requests: write
+ if: always()
+ steps:
+ - name: Download Artifacts
+ uses: actions/download-artifact@v7
+ with:
+ path: artifacts
+ - name: Publish Test Results
+ uses: EnricoMi/publish-unit-test-result-action@v2
+ with:
+ comment_mode: always
+ files: "artifacts/**/**/*.trx"
diff --git a/.gitignore b/.gitignore
index 5715feb65..2a6761c23 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,7 @@
+# Artifact and test results directories
+/Artifacts
+/TestResults
+
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
@@ -6,6 +10,7 @@
*.user
*.sln.docstates
*.ide/
+.vs/
# Build results
@@ -44,6 +49,9 @@ build/
*.log
*.scc
+# Benchmarks results
+BenchmarkDotNet.Artifacts
+
# Visual C++ cache files
ipch/
*.aps
@@ -151,3 +159,27 @@ $RECYCLE.BIN/
#System.IO.Abstractions specific ignores
Releases
System.IO.Abstractions.*.nupkg
+
+# Common IntelliJ Platform excludes
+# https://github.com/JetBrains/resharper-rider-samples/blob/master/.gitignore
+
+# User specific
+**/.idea/**/workspace.xml
+**/.idea/**/tasks.xml
+**/.idea/shelf/*
+**/.idea/dictionaries
+**/.idea/httpRequests/
+
+# Sensitive or high-churn files
+**/.idea/**/dataSources/
+**/.idea/**/dataSources.ids
+**/.idea/**/dataSources.xml
+**/.idea/**/dataSources.local.xml
+**/.idea/**/sqlDataSources.xml
+**/.idea/**/dynamic.xml
+
+# Rider
+# Rider auto-generates .iml files, and contentModel.xml
+**/.idea/**/*.iml
+**/.idea/**/contentModel.xml
+**/.idea/**/modules.xml
\ No newline at end of file
diff --git a/.idea/.idea.System.IO.Abstractions/.idea/.gitignore b/.idea/.idea.System.IO.Abstractions/.idea/.gitignore
new file mode 100644
index 000000000..9b9147a9b
--- /dev/null
+++ b/.idea/.idea.System.IO.Abstractions/.idea/.gitignore
@@ -0,0 +1,13 @@
+# Default ignored files
+/shelf/
+/workspace.xml
+# Rider ignored files
+/contentModel.xml
+/projectSettingsUpdater.xml
+/.idea.System.IO.Abstractions.iml
+/modules.xml
+# Editor-based HTTP Client requests
+/httpRequests/
+# Datasource local storage ignored files
+/dataSources/
+/dataSources.local.xml
diff --git a/.idea/.idea.System.IO.Abstractions/.idea/encodings.xml b/.idea/.idea.System.IO.Abstractions/.idea/encodings.xml
new file mode 100644
index 000000000..df87cf951
--- /dev/null
+++ b/.idea/.idea.System.IO.Abstractions/.idea/encodings.xml
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/.idea/.idea.System.IO.Abstractions/.idea/indexLayout.xml b/.idea/.idea.System.IO.Abstractions/.idea/indexLayout.xml
new file mode 100644
index 000000000..7b08163ce
--- /dev/null
+++ b/.idea/.idea.System.IO.Abstractions/.idea/indexLayout.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/.idea.System.IO.Abstractions/.idea/vcs.xml b/.idea/.idea.System.IO.Abstractions/.idea/vcs.xml
new file mode 100644
index 000000000..94a25f7f4
--- /dev/null
+++ b/.idea/.idea.System.IO.Abstractions/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.nuke/build.schema.json b/.nuke/build.schema.json
new file mode 100644
index 000000000..47d67fd11
--- /dev/null
+++ b/.nuke/build.schema.json
@@ -0,0 +1,141 @@
+{
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "definitions": {
+ "Host": {
+ "type": "string",
+ "enum": [
+ "AppVeyor",
+ "AzurePipelines",
+ "Bamboo",
+ "Bitbucket",
+ "Bitrise",
+ "GitHubActions",
+ "GitLab",
+ "Jenkins",
+ "Rider",
+ "SpaceAutomation",
+ "TeamCity",
+ "Terminal",
+ "TravisCI",
+ "VisualStudio",
+ "VSCode"
+ ]
+ },
+ "ExecutableTarget": {
+ "type": "string",
+ "enum": [
+ "ApiChecks",
+ "CalculateNugetVersion",
+ "Clean",
+ "CodeAnalysis",
+ "CodeAnalysisBegin",
+ "CodeAnalysisEnd",
+ "CodeCoverage",
+ "Compile",
+ "DotNetFrameworkUnitTests",
+ "DotNetUnitTests",
+ "Pack",
+ "Restore",
+ "UnitTests",
+ "UpdateReadme"
+ ]
+ },
+ "Verbosity": {
+ "type": "string",
+ "description": "",
+ "enum": [
+ "Verbose",
+ "Normal",
+ "Minimal",
+ "Quiet"
+ ]
+ },
+ "NukeBuild": {
+ "properties": {
+ "Continue": {
+ "type": "boolean",
+ "description": "Indicates to continue a previously failed build attempt"
+ },
+ "Help": {
+ "type": "boolean",
+ "description": "Shows the help text for this build assembly"
+ },
+ "Host": {
+ "description": "Host for execution. Default is 'automatic'",
+ "$ref": "#/definitions/Host"
+ },
+ "NoLogo": {
+ "type": "boolean",
+ "description": "Disables displaying the NUKE logo"
+ },
+ "Partition": {
+ "type": "string",
+ "description": "Partition to use on CI"
+ },
+ "Plan": {
+ "type": "boolean",
+ "description": "Shows the execution plan (HTML)"
+ },
+ "Profile": {
+ "type": "array",
+ "description": "Defines the profiles to load",
+ "items": {
+ "type": "string"
+ }
+ },
+ "Root": {
+ "type": "string",
+ "description": "Root directory during build execution"
+ },
+ "Skip": {
+ "type": "array",
+ "description": "List of targets to be skipped. Empty list skips all dependencies",
+ "items": {
+ "$ref": "#/definitions/ExecutableTarget"
+ }
+ },
+ "Target": {
+ "type": "array",
+ "description": "List of targets to be invoked. Default is '{default_target}'",
+ "items": {
+ "$ref": "#/definitions/ExecutableTarget"
+ }
+ },
+ "Verbosity": {
+ "description": "Logging verbosity during build execution. Default is 'Normal'",
+ "$ref": "#/definitions/Verbosity"
+ }
+ }
+ }
+ },
+ "allOf": [
+ {
+ "properties": {
+ "Configuration": {
+ "type": "string",
+ "description": "Configuration to build - Default is 'Debug' (local) or 'Release' (server)",
+ "enum": [
+ "Debug",
+ "Release"
+ ]
+ },
+ "GithubToken": {
+ "type": "string",
+ "description": "Github Token"
+ },
+ "Solution": {
+ "type": "string",
+ "description": "Path to a solution file that is automatically loaded"
+ },
+ "SonarToken": {
+ "type": "string",
+ "description": "The key to push to sonarcloud",
+ "default": "Secrets must be entered via 'nuke :secrets [profile]'"
+ }
+ }
+ },
+ {
+ "$ref": "#/definitions/NukeBuild"
+ }
+ ]
+}
diff --git a/.nuke/parameters.json b/.nuke/parameters.json
new file mode 100644
index 000000000..80b1853fd
--- /dev/null
+++ b/.nuke/parameters.json
@@ -0,0 +1,4 @@
+{
+ "$schema": "build.schema.json",
+ "Solution": "System.IO.Abstractions.slnx"
+}
diff --git a/.remarkrc.yaml b/.remarkrc.yaml
new file mode 100644
index 000000000..8b3ed1a09
--- /dev/null
+++ b/.remarkrc.yaml
@@ -0,0 +1,3 @@
+plugins:
+ - remark-preset-lint-consistent
+ - remark-preset-lint-markdown-style-guide
\ No newline at end of file
diff --git a/.vscode/extensions.json b/.vscode/extensions.json
new file mode 100644
index 000000000..e958ab141
--- /dev/null
+++ b/.vscode/extensions.json
@@ -0,0 +1,6 @@
+{
+ "recommendations": [
+ "ms-vscode-remote.remote-containers",
+ "ms-dotnettools.csharp"
+ ]
+}
\ No newline at end of file
diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md
new file mode 100644
index 000000000..80cb5799b
--- /dev/null
+++ b/CODE_OF_CONDUCT.md
@@ -0,0 +1,76 @@
+# Contributor Covenant Code of Conduct
+
+## Our Pledge
+
+In the interest of fostering an open and welcoming environment, we as
+contributors and maintainers pledge to making participation in our project and
+our community a harassment-free experience for everyone, regardless of age, body
+size, disability, ethnicity, sex characteristics, gender identity and expression,
+level of experience, education, socio-economic status, nationality, personal
+appearance, race, religion, or sexual identity and orientation.
+
+## Our Standards
+
+Examples of behavior that contributes to creating a positive environment
+include:
+
+* Using welcoming and inclusive language
+* Being respectful of differing viewpoints and experiences
+* Gracefully accepting constructive criticism
+* Focusing on what is best for the community
+* Showing empathy towards other community members
+
+Examples of unacceptable behavior by participants include:
+
+* The use of sexualized language or imagery and unwelcome sexual attention or
+ advances
+* Trolling, insulting/derogatory comments, and personal or political attacks
+* Public or private harassment
+* Publishing others' private information, such as a physical or electronic
+ address, without explicit permission
+* Other conduct which could reasonably be considered inappropriate in a
+ professional setting
+
+## Our Responsibilities
+
+Project maintainers are responsible for clarifying the standards of acceptable
+behavior and are expected to take appropriate and fair corrective action in
+response to any instances of unacceptable behavior.
+
+Project maintainers have the right and responsibility to remove, edit, or
+reject comments, commits, code, wiki edits, issues, and other contributions
+that are not aligned to this Code of Conduct, or to ban temporarily or
+permanently any contributor for other behaviors that they deem inappropriate,
+threatening, offensive, or harmful.
+
+## Scope
+
+This Code of Conduct applies both within project spaces and in public spaces
+when an individual is representing the project or its community. Examples of
+representing a project or community include using an official project e-mail
+address, posting via an official social media account, or acting as an appointed
+representative at an online or offline event. Representation of a project may be
+further defined and clarified by project maintainers.
+
+## Enforcement
+
+Instances of abusive, harassing, or otherwise unacceptable behavior may be
+reported by contacting the project team at code-of-conduct@testably.org. All
+complaints will be reviewed and investigated and will result in a response that
+is deemed necessary and appropriate to the circumstances. The project team is
+obligated to maintain confidentiality with regard to the reporter of an incident.
+Further details of specific enforcement policies may be posted separately.
+
+Project maintainers who do not follow or enforce the Code of Conduct in good
+faith may face temporary or permanent repercussions as determined by other
+members of the project's leadership.
+
+## Attribution
+
+This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
+available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
+
+[homepage]: https://www.contributor-covenant.org
+
+For answers to common questions about this code of conduct, see
+https://www.contributor-covenant.org/faq
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
new file mode 100644
index 000000000..e1a7488f6
--- /dev/null
+++ b/CONTRIBUTING.md
@@ -0,0 +1,31 @@
+# Contributor guide
+
+## Versioning
+
+This library uses [Nerdbank.GitVersioning](https://github.com/AArnott/Nerdbank.GitVersioning) for generating stable and reproducible version numbers.
+
+The base version is manually maintained in [the version config](version.json). Every build calculates its final version number based on the base version and the number of changes that occured since the last change to the version config.
+
+The base version represents the MAJOR and MINOR parts of [SemVer](https://semver.org). If a PR contains breaking changes or new features the base version has to be changed accordingly. If a PR solely contains minor changes (bug fixes, code improvements) nothing needs to be done as the PATCH number will automatically increment with each commit.
+
+## Branches / tags
+
+- `main` contains the latest sources. Each merge there triggers a deploy to `nuget.org`.
+- All versions on `nuget.org` have a matching GitHub release/tag.
+
+## Commits and PR title
+
+- Please use [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/) to name your commits and PR title.
+ We use [action-semantic-pull-request](https://github.com/amannn/action-semantic-pull-request?tab=readme-ov-file#configuration) to enforce this policy, feel free to have a closer look.
+- Available prefixes:
+ - `feat:` A new feature
+ - `fix:` A bug fix
+ - `docs:` Documentation only changes
+ - `style:` Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
+ - `refactor:` A code change that neither fixes a bug nor adds a feature
+ - `perf:` A code change that improves performance
+ - `test:` Adding missing tests or correcting existing tests
+ - `build:` Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
+ - `ci:` Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)
+ - `chore:` Other changes that don't modify src or test files
+ - `revert:` Reverts a previous commit
diff --git a/Directory.Build.props b/Directory.Build.props
new file mode 100644
index 000000000..a2f0f6f0b
--- /dev/null
+++ b/Directory.Build.props
@@ -0,0 +1,32 @@
+
+
+ System.IO.Abstractions
+ Copyright © Tatham Oddie & friends 2010-$([System.DateTime]::Now.ToString('yyyy'))
+ Tatham Oddie & friends
+ True
+ 00240000048000009400000006020000002400005253413100040000010001001160c7a0f907c400c5392975b66d2f3752fb82625d5674d386b83896d4d4ae8d0ef8319ef391fbb3466de0058ad2f361b8f5cb8a32ecb4e908bece5c519387552cedd2ca0250e36b59c6d6dc3dc260ca73a7e27c3add4ae22d5abaa562225d7ba34d427e8f3f52928a46a674deb0208eca7d379aa22712355b91a55a5ce521d2
+ $(MSBuildThisFileDirectory)StrongName.snk
+ latest
+ testing
+ CS1591
+ https://github.com/TestableIO/System.IO.Abstractions
+ MIT
+ README.md
+ $(DefineConstants);FEATURE_FILE_SYSTEM_ACL_EXTENSIONS
+ $(DefineConstants);FEATURE_ASYNC_FILE;FEATURE_ENUMERATION_OPTIONS;FEATURE_ADVANCED_PATH_OPERATIONS;FEATURE_PATH_JOIN_WITH_SPAN;FEATURE_SPAN
+ $(DefineConstants);FEATURE_FILE_MOVE_WITH_OVERWRITE;FEATURE_SUPPORTED_OS_ATTRIBUTE;FEATURE_FILE_SYSTEM_WATCHER_FILTERS;FEATURE_ENDS_IN_DIRECTORY_SEPARATOR;FEATURE_PATH_JOIN_WITH_PARAMS;FEATURE_PATH_JOIN_WITH_FOUR_PATHS;FEATURE_FILE_SYSTEM_INFO_LINK_TARGET;FEATURE_CREATE_SYMBOLIC_LINK;FEATURE_FILESTREAM_OPTIONS
+ $(DefineConstants);FEATURE_PATH_EXISTS;FEATURE_FILE_SYSTEM_WATCHER_WAIT_WITH_TIMESPAN;FEATURE_FILE_ATTRIBUTES_VIA_HANDLE;FEATURE_CREATE_TEMP_SUBDIRECTORY;FEATURE_READ_LINES_ASYNC;FEATURE_UNIX_FILE_MODE
+ $(DefineConstants);FEATURE_PATH_SPAN;FEATURE_FILE_SPAN
+ $(DefineConstants);FEATURE_SERIALIZABLE
+
+
+ true
+ true
+ true
+ snupkg
+ false
+
+
+
+
+
diff --git a/Directory.Packages.props b/Directory.Packages.props
new file mode 100644
index 000000000..c42994a1c
--- /dev/null
+++ b/Directory.Packages.props
@@ -0,0 +1,39 @@
+
+
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 000000000..64c7af08b
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,23 @@
+The MIT License (MIT)
+
+Copyright (c) Tatham Oddie and Contributors
+
+All rights reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/License.txt b/License.txt
deleted file mode 100644
index da3dc935e..000000000
--- a/License.txt
+++ /dev/null
@@ -1,31 +0,0 @@
-Microsoft Public License (Ms-PL)
-
-This license governs use of the accompanying software. If you use the software, you accept this license. If you do not accept the license, do not use the software.
-
-1. Definitions
-
-The terms "reproduce," "reproduction," "derivative works," and "distribution" have the same meaning here as under U.S. copyright law.
-
-A "contribution" is the original software, or any additions or changes to the software.
-
-A "contributor" is any person that distributes its contribution under this license.
-
-"Licensed patents" are a contributor's patent claims that read directly on its contribution.
-
-2. Grant of Rights
-
-(A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution or any derivative works that you create.
-
-(B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution in the software or derivative works of the contribution in the software.
-
-3. Conditions and Limitations
-
-(A) No Trademark License- This license does not grant you rights to use any contributors' name, logo, or trademarks.
-
-(B) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your patent license from such contributor to the software ends automatically.
-
-(C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution notices that are present in the software.
-
-(D) If you distribute any portion of the software in source code form, you may do so only under this license by including a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or object code form, you may only do so under a license that complies with this license.
-
-(E) The software is licensed "as-is." You bear the risk of using it. The contributors give no express warranties, guarantees or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a particular purpose and non-infringement.
\ No newline at end of file
diff --git a/Pipeline/.editorconfig b/Pipeline/.editorconfig
new file mode 100644
index 000000000..31e43dcd8
--- /dev/null
+++ b/Pipeline/.editorconfig
@@ -0,0 +1,11 @@
+[*.cs]
+dotnet_style_qualification_for_field = false:warning
+dotnet_style_qualification_for_property = false:warning
+dotnet_style_qualification_for_method = false:warning
+dotnet_style_qualification_for_event = false:warning
+dotnet_style_require_accessibility_modifiers = never:warning
+
+csharp_style_expression_bodied_methods = true:silent
+csharp_style_expression_bodied_properties = true:warning
+csharp_style_expression_bodied_indexers = true:warning
+csharp_style_expression_bodied_accessors = true:warning
diff --git a/Pipeline/Build.ApiChecks.cs b/Pipeline/Build.ApiChecks.cs
new file mode 100644
index 000000000..f99768d39
--- /dev/null
+++ b/Pipeline/Build.ApiChecks.cs
@@ -0,0 +1,28 @@
+using Nuke.Common;
+using Nuke.Common.ProjectModel;
+using Nuke.Common.Tooling;
+using Nuke.Common.Tools.DotNet;
+using static Nuke.Common.Tools.DotNet.DotNetTasks;
+
+// ReSharper disable AllUnderscoreLocalParameterName
+
+namespace Build;
+
+partial class Build
+{
+ Target ApiChecks => _ => _
+ .DependsOn(Compile)
+ .Executes(() =>
+ {
+ Project project = Solution.Tests.TestableIO_System_IO_Abstractions_Api_Tests;
+
+ DotNetTest(s => s
+ .SetConfiguration(Configuration == Configuration.Debug ? "Debug" : "Release")
+ .SetProcessEnvironmentVariable("DOTNET_CLI_UI_LANGUAGE", "en-US")
+ .EnableNoBuild()
+ .SetResultsDirectory(TestResultsDirectory)
+ .CombineWith(cc => cc
+ .SetProjectFile(project)
+ .AddLoggers($"trx;LogFileName={project.Name}.trx")), completeOnFailure: true);
+ });
+}
diff --git a/Pipeline/Build.CodeAnalysis.cs b/Pipeline/Build.CodeAnalysis.cs
new file mode 100644
index 000000000..9f3e9b035
--- /dev/null
+++ b/Pipeline/Build.CodeAnalysis.cs
@@ -0,0 +1,42 @@
+using Nuke.Common;
+using Nuke.Common.Tools.SonarScanner;
+
+// ReSharper disable AllUnderscoreLocalParameterName
+
+namespace Build;
+
+partial class Build
+{
+ [Parameter("The key to push to sonarcloud")] [Secret] readonly string SonarToken;
+
+ Target CodeAnalysisBegin => _ => _
+ .Unlisted()
+ .Before(Compile)
+ .Before(CodeCoverage)
+ .Executes(() =>
+ {
+ SonarScannerTasks.SonarScannerBegin(s => s
+ .SetOrganization("testableio")
+ .SetProjectKey("TestableIO_System.IO.Abstractions")
+ .AddVSTestReports(TestResultsDirectory / "*.trx")
+ .AddOpenCoverPaths(TestResultsDirectory / "reports" / "OpenCover.xml")
+ .SetPullRequestOrBranchName(GitHubActions, GitVersion)
+ .SetVersion(GitVersion.SemVer)
+ .SetToken(SonarToken));
+ });
+
+ Target CodeAnalysisEnd => _ => _
+ .Unlisted()
+ .DependsOn(Compile)
+ .DependsOn(CodeCoverage)
+ .OnlyWhenDynamic(() => IsServerBuild)
+ .Executes(() =>
+ {
+ SonarScannerTasks.SonarScannerEnd(s => s
+ .SetToken(SonarToken));
+ });
+
+ Target CodeAnalysis => _ => _
+ .DependsOn(CodeAnalysisBegin)
+ .DependsOn(CodeAnalysisEnd);
+}
diff --git a/Pipeline/Build.CodeCoverage.cs b/Pipeline/Build.CodeCoverage.cs
new file mode 100644
index 000000000..6954e898b
--- /dev/null
+++ b/Pipeline/Build.CodeCoverage.cs
@@ -0,0 +1,25 @@
+using Nuke.Common;
+using Nuke.Common.Tooling;
+using Nuke.Common.Tools.ReportGenerator;
+using static Nuke.Common.Tools.ReportGenerator.ReportGeneratorTasks;
+
+// ReSharper disable AllUnderscoreLocalParameterName
+
+namespace Build;
+
+partial class Build
+{
+ Target CodeCoverage => _ => _
+ .DependsOn(UnitTests)
+ .Executes(() =>
+ {
+ ReportGenerator(s => s
+ .SetProcessToolPath(NuGetToolPathResolver.GetPackageExecutable("ReportGenerator", "ReportGenerator.dll",
+ framework: "net8.0"))
+ .SetTargetDirectory(TestResultsDirectory / "reports")
+ .AddReports(TestResultsDirectory / "**/coverage.cobertura.xml")
+ .AddReportTypes(ReportTypes.OpenCover)
+ .AddFileFilters("-*.g.cs")
+ .SetAssemblyFilters("+TestableIO*", "+System.IO.Abstractions*"));
+ });
+}
diff --git a/Pipeline/Build.Compile.cs b/Pipeline/Build.Compile.cs
new file mode 100644
index 000000000..a26a6ef7b
--- /dev/null
+++ b/Pipeline/Build.Compile.cs
@@ -0,0 +1,119 @@
+using System;
+using System.Linq;
+using Nuke.Common;
+using Nuke.Common.IO;
+using Nuke.Common.Tools.DotNet;
+using Nuke.Common.Tools.GitVersion;
+using Nuke.Common.Utilities;
+using Nuke.Common.Utilities.Collections;
+using Serilog;
+using static Nuke.Common.Tools.DotNet.DotNetTasks;
+
+// ReSharper disable AllUnderscoreLocalParameterName
+
+namespace Build;
+
+partial class Build
+{
+ string BranchName;
+ string SemVer;
+ AssemblyVersion MainVersion;
+
+ Target CalculateNugetVersion => _ => _
+ .Unlisted()
+ .Executes(() =>
+ {
+ string preRelease = "-CI";
+ if (GitHubActions == null)
+ {
+ preRelease = "-DEV";
+ }
+ else if (GitHubActions.Ref.StartsWith("refs/tags/", StringComparison.OrdinalIgnoreCase))
+ {
+ int preReleaseIndex = GitHubActions.Ref.IndexOf('-');
+ preRelease = preReleaseIndex > 0 ? GitHubActions.Ref[preReleaseIndex..] : "";
+ }
+
+ SemVer = GitVersion.SemVer;
+ BranchName = GitVersion.BranchName;
+ MainVersion = AssemblyVersion.FromGitVersion(GitVersion, preRelease);
+
+ if (GitHubActions?.IsPullRequest == true)
+ {
+ string buildNumber = GitHubActions.RunNumber.ToString();
+ Console.WriteLine(
+ $"Branch spec is a pull request. Adding build number {buildNumber}");
+
+ SemVer = string.Join('.', GitVersion.SemVer.Split('.').Take(3).Union([buildNumber,]));
+ }
+
+ Console.WriteLine($"SemVer = {SemVer}");
+ });
+
+ Target Clean => _ => _
+ .Unlisted()
+ .Before(Restore)
+ .Executes(() =>
+ {
+ ArtifactsDirectory.CreateOrCleanDirectory();
+ Log.Information("Cleaned {path}...", ArtifactsDirectory);
+
+ TestResultsDirectory.CreateOrCleanDirectory();
+ Log.Information("Cleaned {path}...", TestResultsDirectory);
+ });
+
+ Target Restore => _ => _
+ .Unlisted()
+ .DependsOn(Clean)
+ .Executes(() =>
+ {
+ DotNetRestore(s => s
+ .SetProjectFile(Solution)
+ .EnableNoCache()
+ .SetConfigFile(RootDirectory / "nuget.config"));
+ });
+
+ Target Compile => _ => _
+ .DependsOn(Restore)
+ .DependsOn(CalculateNugetVersion)
+ .Executes(() =>
+ {
+ string preRelease = "-CI";
+ if (GitHubActions == null)
+ {
+ preRelease = "-DEV";
+ }
+ else if (GitHubActions.Ref.StartsWith("refs/tags/", StringComparison.OrdinalIgnoreCase))
+ {
+ int preReleaseIndex = GitHubActions.Ref.IndexOf('-');
+ preRelease = preReleaseIndex > 0 ? GitHubActions.Ref[preReleaseIndex..] : "";
+ }
+
+ ReportSummary(s => s
+ .WhenNotNull(SemVer, (summary, semVer) => summary
+ .AddPair("Version", MainVersion.FileVersion + MainVersion.PreRelease)));
+
+ DotNetBuild(s => s
+ .SetProjectFile(Solution)
+ .SetConfiguration(Configuration)
+ .EnableNoLogo()
+ .EnableNoRestore()
+ .SetVersion(MainVersion.FileVersion + MainVersion.PreRelease)
+ .SetAssemblyVersion(MainVersion.FileVersion)
+ .SetFileVersion(MainVersion.FileVersion)
+ .SetInformationalVersion(MainVersion.InformationalVersion));
+ });
+
+ public record AssemblyVersion(string FileVersion, string InformationalVersion, string PreRelease)
+ {
+ public static AssemblyVersion FromGitVersion(GitVersion gitVersion, string preRelease)
+ {
+ if (gitVersion is null)
+ {
+ return null;
+ }
+
+ return new AssemblyVersion(gitVersion.AssemblySemVer, gitVersion.InformationalVersion, preRelease);
+ }
+ }
+}
diff --git a/Pipeline/Build.Pack.cs b/Pipeline/Build.Pack.cs
new file mode 100644
index 000000000..75fc31bde
--- /dev/null
+++ b/Pipeline/Build.Pack.cs
@@ -0,0 +1,99 @@
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Text;
+using Nuke.Common;
+using Nuke.Common.IO;
+using Nuke.Common.ProjectModel;
+using Nuke.Common.Utilities;
+using Nuke.Common.Utilities.Collections;
+using static Serilog.Log;
+
+// ReSharper disable AllUnderscoreLocalParameterName
+
+namespace Build;
+
+partial class Build
+{
+ Target UpdateReadme => _ => _
+ .DependsOn(Clean)
+ .Before(Compile)
+ .Executes(() =>
+ {
+ string version = string.Join('.', GitVersion.SemVer.Split('.').Take(3));
+ if (version.IndexOf('-') != -1)
+ {
+ version = version.Substring(0, version.IndexOf('-'));
+ }
+
+ StringBuilder sb = new();
+ string[] lines = File.ReadAllLines(Solution.Directory / "README.md");
+ sb.AppendLine(lines.First());
+ sb.AppendLine(
+ $"[](https://github.com/TestableIO/System.IO.Abstractions/releases/tag/v{version})");
+ foreach (string line in lines.Skip(1))
+ {
+ if (line.StartsWith("[ ||
+ line.StartsWith("[)
+ {
+ continue;
+ }
+
+ if (line.StartsWith("[)
+ {
+ sb.AppendLine(line
+ .Replace(")", $"&branch=release/v{version})"));
+ continue;
+ }
+
+ if (line.StartsWith("[)
+ {
+ sb.AppendLine(line
+ .Replace("%2Fmain)", $"%2Frelease%2Fv{version})")
+ .Replace("/main)", $"/release/v{version})"));
+ continue;
+ }
+
+ sb.AppendLine(line);
+ }
+
+ File.WriteAllText(ArtifactsDirectory / "README.md", sb.ToString());
+ });
+
+ Target Pack => _ => _
+ .DependsOn(UpdateReadme)
+ .DependsOn(Compile)
+ .Executes(() =>
+ {
+ AbsolutePath packagesDirectory = ArtifactsDirectory / "Packages";
+ packagesDirectory.CreateOrCleanDirectory();
+
+ List packages = new();
+ foreach (Project project in new[]
+ {
+ Solution.TestableIO_System_IO_Abstractions_Wrappers,
+ Solution.TestableIO_System_IO_Abstractions_TestingHelpers,
+ Solution.Meta.TestableIO_System_IO_Abstractions,
+ Solution.Meta.System_IO_Abstractions,
+ Solution.Meta.System_IO_Abstractions_TestingHelpers,
+ })
+ {
+ foreach (string package in
+ Directory.EnumerateFiles(project.Directory / "bin", "*.nupkg", SearchOption.AllDirectories))
+ {
+ File.Move(package, packagesDirectory / Path.GetFileName(package));
+ Debug("Found nuget package: {PackagePath}", package);
+ packages.Add(Path.GetFileName(package));
+ }
+
+ foreach (string symbolPackage in
+ Directory.EnumerateFiles(project.Directory / "bin", "*.snupkg", SearchOption.AllDirectories))
+ {
+ File.Move(symbolPackage, packagesDirectory / Path.GetFileName(symbolPackage));
+ Debug("Found symbol package: {PackagePath}", symbolPackage);
+ }
+ }
+ ReportSummary(s => s
+ .AddPair("Packages", string.Join(", ", packages)));
+ });
+}
diff --git a/Pipeline/Build.UnitTest.cs b/Pipeline/Build.UnitTest.cs
new file mode 100644
index 000000000..c88133073
--- /dev/null
+++ b/Pipeline/Build.UnitTest.cs
@@ -0,0 +1,79 @@
+using System.IO;
+using System.Linq;
+using Nuke.Common;
+using Nuke.Common.IO;
+using Nuke.Common.ProjectModel;
+using Nuke.Common.Tooling;
+using Nuke.Common.Tools.DotNet;
+using Nuke.Common.Tools.NUnit;
+using static Nuke.Common.Tools.DotNet.DotNetTasks;
+
+// ReSharper disable AllUnderscoreLocalParameterName
+
+namespace Build;
+
+partial class Build
+{
+ Target UnitTests => _ => _
+ .DependsOn(DotNetFrameworkUnitTests)
+ .DependsOn(DotNetUnitTests);
+
+ Project[] UnitTestProjects =>
+ [
+ Solution.Tests.TestableIO_System_IO_Abstractions_Wrappers_Tests,
+ Solution.Tests.TestableIO_System_IO_Abstractions_TestingHelpers_Tests,
+ Solution.Tests.TestableIO_System_IO_Abstractions_Parity_Tests,
+ ];
+
+ Target DotNetFrameworkUnitTests => _ => _
+ .Unlisted()
+ .DependsOn(Compile)
+ .OnlyWhenDynamic(() => EnvironmentInfo.IsWin)
+ .Executes(() =>
+ {
+ var testAssemblies = UnitTestProjects
+ .SelectMany(project =>
+ project.Directory.GlobFiles(
+ $"bin/{(Configuration == Configuration.Debug ? "Debug" : "Release")}/net472/*.Tests.dll"))
+ .Select(p => p.ToString())
+ .ToArray();
+
+ Assert.NotEmpty(testAssemblies.ToList());
+
+ foreach (var testAssembly in testAssemblies)
+ {
+ var currentDirectory = Path.GetDirectoryName(testAssembly);
+
+ NUnitTasks.NUnit3(s => s
+ .SetInputFiles(testAssembly)
+ .SetProcessWorkingDirectory(currentDirectory)
+ );
+ }
+ });
+
+ Target DotNetUnitTests => _ => _
+ .Unlisted()
+ .DependsOn(Compile)
+ .Executes(() =>
+ {
+ string[] excludedFrameworks = ["net48",];
+ DotNetTest(s => s
+ .SetConfiguration(Configuration)
+ .SetProcessEnvironmentVariable("DOTNET_CLI_UI_LANGUAGE", "en-US")
+ .EnableNoBuild()
+ .SetDataCollector("XPlat Code Coverage")
+ .SetResultsDirectory(TestResultsDirectory)
+ .CombineWith(
+ UnitTestProjects,
+ (settings, project) => settings
+ .SetProjectFile(project)
+ .CombineWith(
+ project.GetTargetFrameworks()?.Except(excludedFrameworks),
+ (frameworkSettings, framework) => frameworkSettings
+ .SetFramework(framework)
+ .AddLoggers($"trx;LogFileName={project.Name}_{framework}.trx")
+ )
+ ), completeOnFailure: true
+ );
+ });
+}
\ No newline at end of file
diff --git a/Pipeline/Build.cs b/Pipeline/Build.cs
new file mode 100644
index 000000000..10372f655
--- /dev/null
+++ b/Pipeline/Build.cs
@@ -0,0 +1,31 @@
+using Nuke.Common;
+using Nuke.Common.CI.GitHubActions;
+using Nuke.Common.IO;
+using Nuke.Common.ProjectModel;
+using Nuke.Common.Tools.GitVersion;
+
+namespace Build;
+
+[GitHubActions(
+ "Build",
+ GitHubActionsImage.UbuntuLatest,
+ AutoGenerate = false,
+ ImportSecrets = [nameof(GithubToken),]
+)]
+partial class Build : NukeBuild
+{
+ [Parameter("Configuration to build - Default is 'Debug' (local) or 'Release' (server)")]
+ readonly Configuration Configuration = IsLocalBuild ? Configuration.Debug : Configuration.Release;
+
+ [Parameter("Github Token")] readonly string GithubToken;
+
+ [Required] [GitVersion(Framework = "net8.0", NoCache = true, NoFetch = true)] readonly GitVersion GitVersion;
+
+ [Solution(GenerateProjects = true)] readonly Solution Solution;
+
+ AbsolutePath ArtifactsDirectory => RootDirectory / "Artifacts";
+ AbsolutePath TestResultsDirectory => RootDirectory / "TestResults";
+ GitHubActions GitHubActions => GitHubActions.Instance;
+
+ public static int Main() => Execute(x => x.UnitTests, x => x.Pack);
+}
diff --git a/Pipeline/Build.csproj b/Pipeline/Build.csproj
new file mode 100644
index 000000000..bef4b864c
--- /dev/null
+++ b/Pipeline/Build.csproj
@@ -0,0 +1,31 @@
+
+
+
+ Exe
+ net10.0
+
+ CS0649;CS0169;CA1050;CA1822;CA2211;IDE1006
+ ..
+ ..
+ 1
+ false
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Pipeline/Build.csproj.DotSettings b/Pipeline/Build.csproj.DotSettings
new file mode 100644
index 000000000..88a8824cd
--- /dev/null
+++ b/Pipeline/Build.csproj.DotSettings
@@ -0,0 +1,31 @@
+
+ DO_NOT_SHOW
+ DO_NOT_SHOW
+ DO_NOT_SHOW
+ DO_NOT_SHOW
+ DO_NOT_SHOW
+ Implicit
+ Implicit
+ ExpressionBody
+ 0
+ NEXT_LINE
+ True
+ False
+ 120
+ IF_OWNER_IS_SINGLE_LINE
+ WRAP_IF_LONG
+ False
+ <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" />
+ <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" />
+ <Policy><Descriptor Staticness="Instance" AccessRightKinds="Private" Description="Instance fields (private)"><ElementKinds><Kind Name="FIELD" /><Kind Name="READONLY_FIELD" /></ElementKinds></Descriptor><Policy Inspect="True" WarnAboutPrefixesAndSuffixes="False" Prefix="" Suffix="" Style="AaBb" /></Policy>
+ <Policy><Descriptor Staticness="Static" AccessRightKinds="Private" Description="Static fields (private)"><ElementKinds><Kind Name="FIELD" /></ElementKinds></Descriptor><Policy Inspect="True" WarnAboutPrefixesAndSuffixes="False" Prefix="" Suffix="" Style="AaBb" /></Policy>
+ True
+ True
+ True
+ True
+ True
+ True
+ True
+ True
+ True
+ True
diff --git a/Pipeline/BuildExtensions.cs b/Pipeline/BuildExtensions.cs
new file mode 100644
index 000000000..cd3e593a6
--- /dev/null
+++ b/Pipeline/BuildExtensions.cs
@@ -0,0 +1,36 @@
+using System;
+using Nuke.Common.CI.GitHubActions;
+using Nuke.Common.Tools.GitVersion;
+using Nuke.Common.Tools.SonarScanner;
+using Serilog;
+
+namespace Build;
+
+public static class BuildExtensions
+{
+ public static SonarScannerBeginSettings SetPullRequestOrBranchName(
+ this SonarScannerBeginSettings settings,
+ GitHubActions gitHubActions,
+ GitVersion gitVersion)
+ {
+ if (gitHubActions?.IsPullRequest == true)
+ {
+ Log.Information("Use pull request analysis");
+ return settings
+ .SetPullRequestKey(gitHubActions.PullRequestNumber.ToString())
+ .SetPullRequestBranch(gitHubActions.Ref)
+ .SetPullRequestBase(gitHubActions.BaseRef);
+ }
+
+ if (gitHubActions?.Ref.StartsWith("refs/tags/", StringComparison.OrdinalIgnoreCase) == true)
+ {
+ string version = gitHubActions.Ref.Substring("refs/tags/".Length);
+ string branchName = "release/" + version;
+ Log.Information("Use release branch analysis for '{BranchName}'", branchName);
+ return settings.SetBranchName(branchName);
+ }
+
+ Log.Information("Use branch analysis for '{BranchName}'", gitVersion.BranchName);
+ return settings.SetBranchName(gitVersion.BranchName);
+ }
+}
diff --git a/Pipeline/Configuration.cs b/Pipeline/Configuration.cs
new file mode 100644
index 000000000..9c08b1ae9
--- /dev/null
+++ b/Pipeline/Configuration.cs
@@ -0,0 +1,16 @@
+using System;
+using System.ComponentModel;
+using System.Linq;
+using Nuke.Common.Tooling;
+
+[TypeConverter(typeof(TypeConverter))]
+public class Configuration : Enumeration
+{
+ public static Configuration Debug = new Configuration { Value = nameof(Debug) };
+ public static Configuration Release = new Configuration { Value = nameof(Release) };
+
+ public static implicit operator string(Configuration configuration)
+ {
+ return configuration.Value;
+ }
+}
diff --git a/Pipeline/Directory.Build.props b/Pipeline/Directory.Build.props
new file mode 100644
index 000000000..e147d6352
--- /dev/null
+++ b/Pipeline/Directory.Build.props
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
diff --git a/Pipeline/Directory.Build.targets b/Pipeline/Directory.Build.targets
new file mode 100644
index 000000000..253260956
--- /dev/null
+++ b/Pipeline/Directory.Build.targets
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
diff --git a/README.md b/README.md
index 4648956b7..64b50d973 100644
--- a/README.md
+++ b/README.md
@@ -1,16 +1,20 @@
-[](https://ci.appveyor.com/project/tathamoddie/system-io-abstractions)
+
+[](https://www.nuget.org/packages/TestableIO.System.IO.Abstractions)
+[](https://github.com/TestableIO/System.IO.Abstractions/actions/workflows/build.yml)
+[](https://sonarcloud.io/summary/new_code?id=TestableIO_System.IO.Abstractions)
+[](https://sonarcloud.io/summary/new_code?id=TestableIO_System.IO.Abstractions)
+[](https://renovatebot.com/)
+[](https://app.fossa.com/projects/git%2Bgithub.com%2FTestableIO%2FSystem.IO.Abstractions?ref=badge_shield)
-Just like System.Web.Abstractions, but for System.IO. Yay for testable IO access!
+At the core of the library is `IFileSystem` and `FileSystem`. Instead of calling methods like `File.ReadAllText` directly, use `IFileSystem.File.ReadAllText`. We have exactly the same API, except that ours is injectable and testable.
-NuGet only:
+## Usage
- Install-Package System.IO.Abstractions
-
-and/or:
-
- Install-Package System.IO.Abstractions.TestingHelpers
+```shell
+dotnet add package TestableIO.System.IO.Abstractions.Wrappers
+```
-At the core of the library is IFileSystem and FileSystem. Instead of calling methods like `File.ReadAllText` directly, use `IFileSystem.File.ReadAllText`. We have exactly the same API, except that ours is injectable and testable.
+*Note: This NuGet package is also published as `System.IO.Abstractions` but we suggest to use the prefix to make clear that this is not an official .NET package.*
```csharp
public class MyComponent
@@ -23,9 +27,9 @@ public class MyComponent
this.fileSystem = fileSystem;
}
/// Create MyComponent
- public MyComponent() : this(
+ public MyComponent() : this(
fileSystem: new FileSystem() //use default implementation which calls System.IO
- )
+ )
{
}
@@ -41,8 +45,16 @@ public class MyComponent
}
```
+### Test helpers
+
The library also ships with a series of test helpers to save you from having to mock out every call, for basic scenarios. They are not a complete copy of a real-life file system, but they'll get you most of the way there.
+```shell
+dotnet add package TestableIO.System.IO.Abstractions.TestingHelpers
+```
+
+*Note: This NuGet package is also published as `System.IO.Abstractions.TestingHelpers` but we suggest to use the prefix to make clear that this is not an official .NET package.*
+
```csharp
[Test]
public void MyComponent_Validate_ShouldThrowNotSupportedExceptionIfTestingIsNotAwesome()
@@ -64,24 +76,134 @@ public void MyComponent_Validate_ShouldThrowNotSupportedExceptionIfTestingIsNotA
catch (NotSupportedException ex)
{
// Assert
- Assert.AreEqual("We can't go on together. It's not me, it's you.", ex.Message);
+ Assert.That(ex.Message, Is.EqualTo("We can't go on together. It's not me, it's you."));
return;
}
Assert.Fail("The expected exception was not thrown.");
}
```
+
We even support casting from the .NET Framework's untestable types to our testable wrappers:
```csharp
-FileInfo SomeBadApiMethodThatReturnsFileInfo()
+FileInfo SomeApiMethodThatReturnsFileInfo()
{
return new FileInfo("a");
}
void MyFancyMethod()
{
- var testableFileInfo = (FileInfoBase)SomeBadApiMethodThatReturnsFileInfo();
+ var testableFileInfo = (FileInfoBase)SomeApiMethodThatReturnsFileInfo();
...
}
```
+
+### Mock support
+
+Since version 4.0 the top-level APIs expose interfaces instead of abstract base classes (these still exist, though), allowing you to completely mock the file system. Here's a small example, using [Mockolate](https://github.com/aweXpect/Mockolate):
+
+```csharp
+[Test]
+public void Test1()
+{
+ var watcher = Mock.Create();
+ var file = Mock.Create();
+
+ file.SetupMock.Method.Exists(It.IsAny()).Returns(true);
+ file.SetupMock.Method.ReadAllText(It.IsAny()).Throws();
+
+ var unitUnderTest = new SomeClassUsingFileSystemWatcher(watcher, file);
+
+ Assert.Throws(() => {
+ watcher.RaiseOnMock.Created(null, new System.IO.FileSystemEventArgs(System.IO.WatcherChangeTypes.Created, @"C:\Some\Directory", "Some.File"));
+ });
+
+ file.VerifyMock.Invoked.Exists(It.IsAny()).Once();
+
+ Assert.That(unitUnderTest.FileWasCreated, Is.True);
+}
+
+public class SomeClassUsingFileSystemWatcher
+{
+ private readonly IFileSystemWatcher _watcher;
+ private readonly IFile _file;
+
+ public bool FileWasCreated { get; private set; }
+
+ public SomeClassUsingFileSystemWatcher(IFileSystemWatcher watcher, IFile file)
+ {
+ this._file = file;
+ this._watcher = watcher;
+ this._watcher.Created += Watcher_Created;
+ }
+
+ private void Watcher_Created(object sender, System.IO.FileSystemEventArgs e)
+ {
+ FileWasCreated = true;
+
+ if(_file.Exists(e.FullPath))
+ {
+ var text = _file.ReadAllText(e.FullPath);
+ }
+ }
+}
+```
+
+## Relationship with Testably.Abstractions
+
+[`Testably.Abstractions`](https://github.com/Testably/Testably.Abstractions) is a complementary project that uses the same interfaces as TestableIO. This means **no changes to your production code are necessary** when switching between the testing libraries.
+
+Both projects share the same maintainer, but active development and new features are primarily focused on the Testably.Abstractions project. TestableIO.System.IO.Abstractions continues to be maintained for stability and compatibility, but significant new functionality is unlikely to be added.
+
+### When to use Testably.Abstractions vs TestableIO
+- **Use TestableIO.System.IO.Abstractions** if you need:
+ - Basic file system mocking capabilities
+ - Direct manipulation of stored file entities (MockFileData, MockDirectoryData)
+ - Established codebase with existing TestableIO integration
+
+- **Use Testably.Abstractions** if you need:
+ - Advanced testing scenarios (FileSystemWatcher, SafeFileHandles, multiple drives)
+ - Additional abstractions (ITimeSystem, IRandomSystem)
+ - Cross-platform file system simulation (Linux, MacOS, Windows)
+ - More extensive and consistent behavior validation
+ - Active development and new features
+
+### Migrating from TestableIO
+Switching from TestableIO to Testably only requires changes in your test projects:
+
+1. Replace the NuGet package reference in your test projects:
+ ```xml
+
+
+
+
+ ```
+
+2. Update your test code to use the new `MockFileSystem`:
+ ```csharp
+ // Before (TestableIO)
+ var fileSystem = new MockFileSystem();
+ fileSystem.AddDirectory("some-directory");
+ fileSystem.AddFile("some-file.txt", new MockFileData("content"));
+
+ // After (Testably)
+ var fileSystem = new MockFileSystem();
+ fileSystem.Directory.CreateDirectory("some-directory");
+ fileSystem.File.WriteAllText("some-file.txt", "content");
+ // or using fluent initialization:
+ fileSystem.Initialize()
+ .WithSubdirectory("some-directory")
+ .WithFile("some-file.txt").Which(f => f
+ .HasStringContent("content"));
+ ```
+
+Your production code using `IFileSystem` remains unchanged.
+
+## Other related projects
+
+- [`System.IO.Abstractions.Extensions`](https://github.com/TestableIO/System.IO.Abstractions.Extensions)
+ provides convenience functionality on top of the core abstractions.
+
+- [`System.IO.Abstractions.Analyzers`](https://github.com/TestableIO/System.IO.Abstractions.Analyzers)
+ provides Roslyn analyzers to help use abstractions over static methods.
\ No newline at end of file
diff --git a/StrongName.pfx b/StrongName.pfx
deleted file mode 100644
index 39bb6519c..000000000
Binary files a/StrongName.pfx and /dev/null differ
diff --git a/StrongName.snk b/StrongName.snk
new file mode 100644
index 000000000..31c957881
Binary files /dev/null and b/StrongName.snk differ
diff --git a/System.IO.Abstractions.ncrunchsolution b/System.IO.Abstractions.ncrunchsolution
deleted file mode 100644
index f2e00196f..000000000
--- a/System.IO.Abstractions.ncrunchsolution
+++ /dev/null
@@ -1,13 +0,0 @@
-
- 1
- True
- true
- true
- UseDynamicAnalysis
- UseStaticAnalysis
- UseStaticAnalysis
- UseStaticAnalysis
- Run all tests automatically:BFRydWU=;Run all tests manually:BUZhbHNl;Run impacted tests automatically, others manually (experimental!):CklzSW1wYWN0ZWQ=;Run pinned tests automatically, others manually:CElzUGlubmVk
-
-
-
\ No newline at end of file
diff --git a/System.IO.Abstractions.sln b/System.IO.Abstractions.sln
deleted file mode 100644
index c9047e5d3..000000000
--- a/System.IO.Abstractions.sln
+++ /dev/null
@@ -1,40 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 14
-VisualStudioVersion = 14.0.25420.1
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{5F3BDA62-8052-4C37-97A0-94354AA971B0}"
- ProjectSection(SolutionItems) = preProject
- appveyor.yml = appveyor.yml
- StrongName.pfx = StrongName.pfx
- EndProjectSection
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.IO.Abstractions", "System.IO.Abstractions\System.IO.Abstractions.csproj", "{4D398F3A-0784-4401-93CD-46CD2FBD6B92}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestingHelpers", "TestingHelpers\TestingHelpers.csproj", "{251BD5E5-8133-47A4-AB19-17CF0F43D6AE}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestHelpers.Tests", "TestHelpers.Tests\TestHelpers.Tests.csproj", "{20B02738-952A-40F5-9C10-E2F83013E9FC}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Any CPU = Debug|Any CPU
- Release|Any CPU = Release|Any CPU
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {4D398F3A-0784-4401-93CD-46CD2FBD6B92}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {4D398F3A-0784-4401-93CD-46CD2FBD6B92}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {4D398F3A-0784-4401-93CD-46CD2FBD6B92}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {4D398F3A-0784-4401-93CD-46CD2FBD6B92}.Release|Any CPU.Build.0 = Release|Any CPU
- {251BD5E5-8133-47A4-AB19-17CF0F43D6AE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {251BD5E5-8133-47A4-AB19-17CF0F43D6AE}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {251BD5E5-8133-47A4-AB19-17CF0F43D6AE}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {251BD5E5-8133-47A4-AB19-17CF0F43D6AE}.Release|Any CPU.Build.0 = Release|Any CPU
- {20B02738-952A-40F5-9C10-E2F83013E9FC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {20B02738-952A-40F5-9C10-E2F83013E9FC}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {20B02738-952A-40F5-9C10-E2F83013E9FC}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {20B02738-952A-40F5-9C10-E2F83013E9FC}.Release|Any CPU.Build.0 = Release|Any CPU
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
diff --git a/System.IO.Abstractions.sln.DotSettings b/System.IO.Abstractions.sln.DotSettings
deleted file mode 100644
index f455d6b20..000000000
--- a/System.IO.Abstractions.sln.DotSettings
+++ /dev/null
@@ -1,2 +0,0 @@
-
- <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" />
\ No newline at end of file
diff --git a/System.IO.Abstractions.slnx b/System.IO.Abstractions.slnx
new file mode 100644
index 000000000..4d162ad2d
--- /dev/null
+++ b/System.IO.Abstractions.slnx
@@ -0,0 +1,41 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/System.IO.Abstractions/Converters.cs b/System.IO.Abstractions/Converters.cs
deleted file mode 100644
index d4784bf6a..000000000
--- a/System.IO.Abstractions/Converters.cs
+++ /dev/null
@@ -1,39 +0,0 @@
-using System.Collections.Generic;
-using System.Globalization;
-using System.Linq;
-
-namespace System.IO.Abstractions
-{
- internal static class Converters
- {
- internal static FileSystemInfoBase[] WrapFileSystemInfos(this IEnumerable input)
- {
- return input
- .Select(item =>
- {
- if (item is FileInfo)
- return (FileInfoBase) item;
-
- if (item is DirectoryInfo)
- return (DirectoryInfoBase) item;
-
- throw new NotImplementedException(string.Format(
- CultureInfo.InvariantCulture,
- "The type {0} is not recognized by the System.IO.Abstractions library.",
- item.GetType().AssemblyQualifiedName
- ));
- })
- .ToArray();
- }
-
- internal static DirectoryInfoBase[] WrapDirectories(this IEnumerable input)
- {
- return input.Select(f => (DirectoryInfoBase)f).ToArray();
- }
-
- internal static FileInfoBase[] WrapFiles(this IEnumerable input)
- {
- return input.Select(f => (FileInfoBase)f).ToArray();
- }
- }
-}
\ No newline at end of file
diff --git a/System.IO.Abstractions/DirectoryBase.cs b/System.IO.Abstractions/DirectoryBase.cs
deleted file mode 100644
index 84db1e6e3..000000000
--- a/System.IO.Abstractions/DirectoryBase.cs
+++ /dev/null
@@ -1,53 +0,0 @@
-using System.Collections.Generic;
-using System.Security.AccessControl;
-
-namespace System.IO.Abstractions
-{
- [Serializable]
- public abstract class DirectoryBase
- {
- public abstract DirectoryInfoBase CreateDirectory(string path);
- public abstract DirectoryInfoBase CreateDirectory(string path, DirectorySecurity directorySecurity);
- public abstract void Delete(string path);
- public abstract void Delete(string path, bool recursive);
- public abstract bool Exists(string path);
- public abstract DirectorySecurity GetAccessControl(string path);
- public abstract DirectorySecurity GetAccessControl(string path, AccessControlSections includeSections);
- public abstract DateTime GetCreationTime(string path);
- public abstract DateTime GetCreationTimeUtc(string path);
- public abstract string GetCurrentDirectory();
- public abstract string[] GetDirectories(string path);
- public abstract string[] GetDirectories(string path, string searchPattern);
- public abstract string[] GetDirectories(string path, string searchPattern, SearchOption searchOption);
- public abstract string GetDirectoryRoot(string path);
- public abstract string[] GetFiles(string path);
- public abstract string[] GetFiles(string path, string searchPattern);
- public abstract string[] GetFiles(string path, string searchPattern, SearchOption searchOption);
- public abstract string[] GetFileSystemEntries(string path);
- public abstract string[] GetFileSystemEntries(string path, string searchPattern);
- public abstract DateTime GetLastAccessTime(string path);
- public abstract DateTime GetLastAccessTimeUtc(string path);
- public abstract DateTime GetLastWriteTime(string path);
- public abstract DateTime GetLastWriteTimeUtc(string path);
- public abstract string[] GetLogicalDrives();
- public abstract DirectoryInfoBase GetParent(string path);
- public abstract void Move(string sourceDirName, string destDirName);
- public abstract void SetAccessControl(string path, DirectorySecurity directorySecurity);
- public abstract void SetCreationTime(string path, DateTime creationTime);
- public abstract void SetCreationTimeUtc(string path, DateTime creationTimeUtc);
- public abstract void SetCurrentDirectory(string path);
- public abstract void SetLastAccessTime(string path, DateTime lastAccessTime);
- public abstract void SetLastAccessTimeUtc(string path, DateTime lastAccessTimeUtc);
- public abstract void SetLastWriteTime(string path, DateTime lastWriteTime);
- public abstract void SetLastWriteTimeUtc(string path, DateTime lastWriteTimeUtc);
- public abstract IEnumerable EnumerateDirectories(String path);
- public abstract IEnumerable EnumerateDirectories(String path, String searchPattern);
- public abstract IEnumerable EnumerateDirectories(String path, String searchPattern, SearchOption searchOption);
- public abstract IEnumerable EnumerateFiles(string path);
- public abstract IEnumerable EnumerateFiles(string path, string searchPattern);
- public abstract IEnumerable EnumerateFiles(string path, string searchPattern, SearchOption searchOption);
- public abstract IEnumerable EnumerateFileSystemEntries(string path);
- public abstract IEnumerable EnumerateFileSystemEntries(string path, string searchPattern);
- public abstract IEnumerable EnumerateFileSystemEntries(string path, string searchPattern, SearchOption searchOption);
- }
-}
\ No newline at end of file
diff --git a/System.IO.Abstractions/DirectoryInfoBase.cs b/System.IO.Abstractions/DirectoryInfoBase.cs
deleted file mode 100644
index 19be4683c..000000000
--- a/System.IO.Abstractions/DirectoryInfoBase.cs
+++ /dev/null
@@ -1,46 +0,0 @@
-using System.Collections.Generic;
-using System.Security.AccessControl;
-
-namespace System.IO.Abstractions
-{
- [Serializable]
- public abstract class DirectoryInfoBase : FileSystemInfoBase
- {
- public abstract void Create();
- public abstract void Create(DirectorySecurity directorySecurity);
- public abstract DirectoryInfoBase CreateSubdirectory(string path);
- public abstract DirectoryInfoBase CreateSubdirectory(string path, DirectorySecurity directorySecurity);
- public abstract void Delete(bool recursive);
- public abstract IEnumerable EnumerateDirectories();
- public abstract IEnumerable EnumerateDirectories(string searchPattern);
- public abstract IEnumerable EnumerateDirectories(string searchPattern, SearchOption searchOption);
- public abstract IEnumerable EnumerateFiles();
- public abstract IEnumerable EnumerateFiles(string searchPattern);
- public abstract IEnumerable EnumerateFiles(string searchPattern, SearchOption searchOption);
- public abstract IEnumerable EnumerateFileSystemInfos();
- public abstract IEnumerable EnumerateFileSystemInfos(string searchPattern);
- public abstract IEnumerable EnumerateFileSystemInfos(string searchPattern, SearchOption searchOption);
- public abstract DirectorySecurity GetAccessControl();
- public abstract DirectorySecurity GetAccessControl(AccessControlSections includeSections);
- public abstract DirectoryInfoBase[] GetDirectories();
- public abstract DirectoryInfoBase[] GetDirectories(string searchPattern);
- public abstract DirectoryInfoBase[] GetDirectories(string searchPattern, SearchOption searchOption);
- public abstract FileInfoBase[] GetFiles();
- public abstract FileInfoBase[] GetFiles(string searchPattern);
- public abstract FileInfoBase[] GetFiles(string searchPattern, SearchOption searchOption);
- public abstract FileSystemInfoBase[] GetFileSystemInfos();
- public abstract FileSystemInfoBase[] GetFileSystemInfos(string searchPattern);
- public abstract FileSystemInfoBase[] GetFileSystemInfos(string searchPattern, SearchOption searchOption);
- public abstract void MoveTo(string destDirName);
- public abstract void SetAccessControl(DirectorySecurity directorySecurity);
- public abstract DirectoryInfoBase Parent { get; }
- public abstract DirectoryInfoBase Root { get; }
-
- public static implicit operator DirectoryInfoBase(DirectoryInfo directoryInfo)
- {
- if (directoryInfo == null)
- return null;
- return new DirectoryInfoWrapper(directoryInfo);
- }
- }
-}
\ No newline at end of file
diff --git a/System.IO.Abstractions/DirectoryInfoFactory.cs b/System.IO.Abstractions/DirectoryInfoFactory.cs
deleted file mode 100644
index 61e4f34dc..000000000
--- a/System.IO.Abstractions/DirectoryInfoFactory.cs
+++ /dev/null
@@ -1,12 +0,0 @@
-namespace System.IO.Abstractions
-{
- [Serializable]
- internal class DirectoryInfoFactory : IDirectoryInfoFactory
- {
- public DirectoryInfoBase FromDirectoryName(string directoryName)
- {
- var realDirectoryInfo = new DirectoryInfo(directoryName);
- return new DirectoryInfoWrapper(realDirectoryInfo);
- }
- }
-}
\ No newline at end of file
diff --git a/System.IO.Abstractions/DirectoryInfoWrapper.cs b/System.IO.Abstractions/DirectoryInfoWrapper.cs
deleted file mode 100644
index 06c4bf456..000000000
--- a/System.IO.Abstractions/DirectoryInfoWrapper.cs
+++ /dev/null
@@ -1,244 +0,0 @@
-using System.Collections.Generic;
-using System.Linq;
-using System.Security.AccessControl;
-
-namespace System.IO.Abstractions
-{
- [Serializable]
- public class DirectoryInfoWrapper : DirectoryInfoBase
- {
- private readonly DirectoryInfo instance;
-
- public DirectoryInfoWrapper(DirectoryInfo instance)
- {
- if (instance == null)
- {
- throw new ArgumentNullException("instance");
- }
-
- this.instance = instance;
- }
-
- public override void Delete()
- {
- instance.Delete();
- }
-
- public override void Refresh()
- {
- instance.Refresh();
- }
-
- public override FileAttributes Attributes
- {
- get { return instance.Attributes; }
- set { instance.Attributes = value; }
- }
-
- public override DateTime CreationTime
- {
- get { return instance.CreationTime; }
- set { instance.CreationTime = value; }
- }
-
- public override DateTime CreationTimeUtc
- {
- get { return instance.CreationTimeUtc; }
- set { instance.CreationTimeUtc = value; }
- }
-
- public override bool Exists
- {
- get { return instance.Exists; }
- }
-
- public override string Extension
- {
- get { return instance.Extension; }
- }
-
- public override string FullName
- {
- get { return instance.FullName; }
- }
-
- public override DateTime LastAccessTime
- {
- get { return instance.LastAccessTime; }
- set { instance.LastAccessTime = value; }
- }
-
- public override DateTime LastAccessTimeUtc
- {
- get { return instance.LastAccessTimeUtc; }
- set { instance.LastAccessTimeUtc = value; }
- }
-
- public override DateTime LastWriteTime
- {
- get { return instance.LastWriteTime; }
- set { instance.LastWriteTime = value; }
- }
-
- public override DateTime LastWriteTimeUtc
- {
- get { return instance.LastWriteTimeUtc; }
- set { instance.LastWriteTimeUtc = value; }
- }
-
- public override string Name
- {
- get { return instance.Name; }
- }
-
- public override void Create()
- {
- instance.Create();
- }
-
- public override void Create(DirectorySecurity directorySecurity)
- {
- instance.Create(directorySecurity);
- }
-
- public override DirectoryInfoBase CreateSubdirectory(string path)
- {
- return new DirectoryInfoWrapper(instance.CreateSubdirectory(path));
- }
-
- public override DirectoryInfoBase CreateSubdirectory(string path, DirectorySecurity directorySecurity)
- {
- return new DirectoryInfoWrapper(instance.CreateSubdirectory(path, directorySecurity));
- }
-
- public override void Delete(bool recursive)
- {
- instance.Delete(recursive);
- }
-
- public override IEnumerable EnumerateDirectories()
- {
- return instance.EnumerateDirectories().Select(directoryInfo => new DirectoryInfoWrapper(directoryInfo));
- }
-
- public override IEnumerable EnumerateDirectories(string searchPattern)
- {
- return instance.EnumerateDirectories(searchPattern).Select(directoryInfo => new DirectoryInfoWrapper(directoryInfo));
- }
-
- public override IEnumerable EnumerateDirectories(string searchPattern, SearchOption searchOption)
- {
- return instance.EnumerateDirectories(searchPattern, searchOption).Select(directoryInfo => new DirectoryInfoWrapper(directoryInfo));
- }
-
- public override IEnumerable EnumerateFiles()
- {
- return instance.EnumerateFiles().Select(fileInfo => new FileInfoWrapper(fileInfo));
- }
-
- public override IEnumerable EnumerateFiles(string searchPattern)
- {
- return instance.EnumerateFiles(searchPattern).Select(fileInfo => new FileInfoWrapper(fileInfo));
- }
-
- public override IEnumerable EnumerateFiles(string searchPattern, SearchOption searchOption)
- {
- return instance.EnumerateFiles(searchPattern, searchOption).Select(fileInfo => new FileInfoWrapper(fileInfo));
- }
-
- public override IEnumerable EnumerateFileSystemInfos()
- {
- return instance.EnumerateFileSystemInfos().WrapFileSystemInfos();
- }
-
- public override IEnumerable EnumerateFileSystemInfos(string searchPattern)
- {
- return instance.EnumerateFileSystemInfos(searchPattern).WrapFileSystemInfos();
- }
-
- public override IEnumerable EnumerateFileSystemInfos(string searchPattern, SearchOption searchOption)
- {
- return instance.EnumerateFileSystemInfos(searchPattern, searchOption).WrapFileSystemInfos();
- }
-
- public override DirectorySecurity GetAccessControl()
- {
- return instance.GetAccessControl();
- }
-
- public override DirectorySecurity GetAccessControl(AccessControlSections includeSections)
- {
- return instance.GetAccessControl(includeSections);
- }
-
- public override DirectoryInfoBase[] GetDirectories()
- {
- return instance.GetDirectories().WrapDirectories();
- }
-
- public override DirectoryInfoBase[] GetDirectories(string searchPattern)
- {
- return instance.GetDirectories(searchPattern).WrapDirectories();
- }
-
- public override DirectoryInfoBase[] GetDirectories(string searchPattern, SearchOption searchOption)
- {
- return instance.GetDirectories(searchPattern, searchOption).WrapDirectories();
- }
-
- public override FileInfoBase[] GetFiles()
- {
- return instance.GetFiles().WrapFiles();
- }
-
- public override FileInfoBase[] GetFiles(string searchPattern)
- {
- return instance.GetFiles(searchPattern).WrapFiles();
- }
-
- public override FileInfoBase[] GetFiles(string searchPattern, SearchOption searchOption)
- {
- return instance.GetFiles(searchPattern, searchOption).WrapFiles();
- }
-
- public override FileSystemInfoBase[] GetFileSystemInfos()
- {
- return instance.GetFileSystemInfos().WrapFileSystemInfos();
- }
-
- public override FileSystemInfoBase[] GetFileSystemInfos(string searchPattern)
- {
- return instance.GetFileSystemInfos(searchPattern).WrapFileSystemInfos();
- }
-
- public override FileSystemInfoBase[] GetFileSystemInfos(string searchPattern, SearchOption searchOption)
- {
- return instance.GetFileSystemInfos(searchPattern, searchOption).WrapFileSystemInfos();
- }
-
- public override void MoveTo(string destDirName)
- {
- instance.MoveTo(destDirName);
- }
-
- public override void SetAccessControl(DirectorySecurity directorySecurity)
- {
- instance.SetAccessControl(directorySecurity);
- }
-
- public override DirectoryInfoBase Parent
- {
- get { return instance.Parent; }
- }
-
- public override DirectoryInfoBase Root
- {
- get { return instance.Root; }
- }
-
- public override string ToString()
- {
- return instance.ToString();
- }
- }
-}
\ No newline at end of file
diff --git a/System.IO.Abstractions/DirectoryWrapper.cs b/System.IO.Abstractions/DirectoryWrapper.cs
deleted file mode 100644
index 760632924..000000000
--- a/System.IO.Abstractions/DirectoryWrapper.cs
+++ /dev/null
@@ -1,224 +0,0 @@
-using System.Collections.Generic;
-using System.Security.AccessControl;
-
-namespace System.IO.Abstractions
-{
- [Serializable]
- public class DirectoryWrapper : DirectoryBase
- {
- public override DirectoryInfoBase CreateDirectory(string path)
- {
- return Directory.CreateDirectory(path);
- }
-
- public override DirectoryInfoBase CreateDirectory(string path, DirectorySecurity directorySecurity)
- {
- return Directory.CreateDirectory(path, directorySecurity);
- }
-
- public override void Delete(string path)
- {
- Directory.Delete(path);
- }
-
- public override void Delete(string path, bool recursive)
- {
- Directory.Delete(path, recursive);
- }
-
- public override bool Exists(string path)
- {
- return Directory.Exists(path);
- }
-
- public override DirectorySecurity GetAccessControl(string path)
- {
- return Directory.GetAccessControl(path);
- }
-
- public override DirectorySecurity GetAccessControl(string path, AccessControlSections includeSections)
- {
- return Directory.GetAccessControl(path, includeSections);
- }
-
- public override DateTime GetCreationTime(string path)
- {
- return Directory.GetCreationTime(path);
- }
-
- public override DateTime GetCreationTimeUtc(string path)
- {
- return Directory.GetCreationTimeUtc(path);
- }
-
- public override string GetCurrentDirectory()
- {
- return Directory.GetCurrentDirectory();
- }
-
- public override string[] GetDirectories(string path)
- {
- return Directory.GetDirectories(path);
- }
-
- public override string[] GetDirectories(string path, string searchPattern)
- {
- return Directory.GetDirectories(path, searchPattern);
- }
-
- public override string[] GetDirectories(string path, string searchPattern, SearchOption searchOption)
- {
- return Directory.GetDirectories(path, searchPattern, searchOption);
- }
-
- public override string GetDirectoryRoot(string path)
- {
- return Directory.GetDirectoryRoot(path);
- }
-
- public override string[] GetFiles(string path)
- {
- return Directory.GetFiles(path);
- }
-
- public override string[] GetFiles(string path, string searchPattern)
- {
- return Directory.GetFiles(path, searchPattern);
- }
-
- public override string[] GetFiles(string path, string searchPattern, SearchOption searchOption)
- {
- return Directory.GetFiles(path, searchPattern, searchOption);
- }
-
- public override string[] GetFileSystemEntries(string path)
- {
- return Directory.GetFileSystemEntries(path);
- }
-
- public override string[] GetFileSystemEntries(string path, string searchPattern)
- {
- return Directory.GetFileSystemEntries(path, searchPattern);
- }
-
- public override DateTime GetLastAccessTime(string path)
- {
- return Directory.GetLastAccessTime(path);
- }
-
- public override DateTime GetLastAccessTimeUtc(string path)
- {
- return Directory.GetLastAccessTimeUtc(path);
- }
-
- public override DateTime GetLastWriteTime(string path)
- {
- return Directory.GetLastWriteTime(path);
- }
-
- public override DateTime GetLastWriteTimeUtc(string path)
- {
- return Directory.GetLastWriteTimeUtc(path);
- }
-
- public override string[] GetLogicalDrives()
- {
- return Directory.GetLogicalDrives();
- }
-
- public override DirectoryInfoBase GetParent(string path)
- {
- return Directory.GetParent(path);
- }
-
- public override void Move(string sourceDirName, string destDirName)
- {
- Directory.Move(sourceDirName, destDirName);
- }
-
- public override void SetAccessControl(string path, DirectorySecurity directorySecurity)
- {
- Directory.SetAccessControl(path, directorySecurity);
- }
-
- public override void SetCreationTime(string path, DateTime creationTime)
- {
- Directory.SetCreationTime(path, creationTime);
- }
-
- public override void SetCreationTimeUtc(string path, DateTime creationTimeUtc)
- {
- Directory.SetCreationTimeUtc(path, creationTimeUtc);
- }
-
- public override void SetCurrentDirectory(string path)
- {
- Directory.SetCurrentDirectory(path);
- }
-
- public override void SetLastAccessTime(string path, DateTime lastAccessTime)
- {
- Directory.SetLastAccessTime(path, lastAccessTime);
- }
-
- public override void SetLastAccessTimeUtc(string path, DateTime lastAccessTimeUtc)
- {
- Directory.SetLastAccessTimeUtc(path, lastAccessTimeUtc);
- }
-
- public override void SetLastWriteTime(string path, DateTime lastWriteTime)
- {
- Directory.SetLastAccessTime(path, lastWriteTime);
- }
-
- public override void SetLastWriteTimeUtc(string path, DateTime lastWriteTimeUtc)
- {
- Directory.SetLastWriteTimeUtc(path, lastWriteTimeUtc);
- }
-
- public override IEnumerable EnumerateDirectories(string path)
- {
- return Directory.EnumerateDirectories(path);
- }
-
- public override IEnumerable EnumerateDirectories(string path, string searchPattern)
- {
- return Directory.EnumerateDirectories(path, searchPattern);
- }
-
- public override IEnumerable EnumerateDirectories(string path, string searchPattern, SearchOption searchOption)
- {
- return Directory.EnumerateDirectories(path, searchPattern, searchOption);
- }
-
- public override IEnumerable EnumerateFiles(string path)
- {
- return Directory.EnumerateFiles(path);
- }
-
- public override IEnumerable EnumerateFiles(string path, string searchPattern)
- {
- return Directory.EnumerateFiles(path, searchPattern);
- }
-
- public override IEnumerable EnumerateFiles(string path, string searchPattern, SearchOption searchOption)
- {
- return Directory.EnumerateFiles(path, searchPattern, searchOption);
- }
-
- public override IEnumerable EnumerateFileSystemEntries(string path)
- {
- return Directory.EnumerateFileSystemEntries(path);
- }
-
- public override IEnumerable EnumerateFileSystemEntries(string path, string searchPattern)
- {
- return Directory.EnumerateFileSystemEntries(path, searchPattern);
- }
-
- public override IEnumerable EnumerateFileSystemEntries(string path, string searchPattern, SearchOption searchOption)
- {
- return Directory.EnumerateFileSystemEntries(path, searchPattern, searchOption);
- }
- }
-}
\ No newline at end of file
diff --git a/System.IO.Abstractions/DriveInfoBase.cs b/System.IO.Abstractions/DriveInfoBase.cs
deleted file mode 100644
index 7e80f3a96..000000000
--- a/System.IO.Abstractions/DriveInfoBase.cs
+++ /dev/null
@@ -1,124 +0,0 @@
-namespace System.IO.Abstractions
-{
- [Serializable]
- public abstract class DriveInfoBase
- {
- ///
- /// Gets or sets the amount of available free space on a drive, in bytes.
- ///
- /// The amount of free space available on the drive, in bytes.
- ///
- /// This property indicates the amount of free space available on the drive.
- /// Note that this number may be different from the TotalFreeSpace number because this property takes into account disk quotas.
- ///
- /// Thrown if the access to the drive information is denied.
- /// Thrown if an I/O error occurred (for example, a disk error or a drive was not ready).
- public virtual long AvailableFreeSpace { get; protected set; }
-
- ///
- /// Gets or sets the name of the file system, such as NTFS or FAT32.
- ///
- ///
- /// Use DriveFormat to determine what formatting a drive uses.
- ///
- /// The name of the file system on the specified drive.
- /// Thrown if the access to the drive information is denied.
- /// Thrown if the drive does not exist or is not mapped.
- /// Thrown if an I/O error occurred (for example, a disk error or a drive was not ready).
- public virtual string DriveFormat { get; protected set; }
-
- ///
- /// Gets or sets the drive type, such as CD-ROM, removable, network, or fixed.
- ///
- /// One of the enumeration values that specifies a drive type.
- ///
- /// The DriveType property indicates whether a drive is one of the following: CDRom, Fixed, Network, NoRootDirectory, Ram, Removable, or Unknown.
- /// These values are described in the DriveType enumeration.
- ///
- public virtual DriveType DriveType { get; protected set; }
-
- ///
- /// Gets or sets a value indicating whether a drive is ready.
- ///
- ///
- /// if the drive is ready; if the drive is not ready.
- ///
- ///
- /// IsReady indicates whether a drive is ready.
- /// For example, it indicates whether a CD is in a CD drive or whether a removable storage device is ready for read/write operations.
- /// If you do not test whether a drive is ready, and it is not ready, querying the drive using will raise an IOException.
- /// Do not rely on IsReady to avoid catching exceptions from other members such as TotalSize, TotalFreeSpace, and .
- /// Between the time that your code checks IsReady and then accesses one of the other properties (even if the access occurs immediately after the check),
- /// a drive may have been disconnected or a disk may have been removed.
- ///
- public virtual bool IsReady { get; protected set; }
-
- ///
- /// Gets or sets the name of a drive, such as C:\.
- ///
- /// The name of the drive.
- ///
- /// This property is the name assigned to the drive, such as C:\ or E:\.
- ///
- public virtual string Name { get; protected set; }
-
- ///
- /// Gets or sets the root directory of a drive.
- ///
- /// An object that contains the root directory of the drive.
- public virtual DirectoryInfoBase RootDirectory { get; protected set; }
-
- ///
- /// Gets or sets the total amount of free space available on a drive, in bytes.
- ///
- /// The total free space available on a drive, in bytes.
- /// This property indicates the total amount of free space available on the drive, not just what is available to the current user.
- /// Thrown if the access to the drive information is denied.
- /// Thrown if the drive does not exist or is not mapped.
- /// Thrown if an I/O error occurred (for example, a disk error or a drive was not ready).
- public virtual long TotalFreeSpace { get; protected set; }
-
- ///
- /// Gets or sets the total size of storage space on a drive, in bytes.
- ///
- /// The total size of the drive, in bytes.
- ///
- /// This property indicates the total size of the drive in bytes, not just what is available to the current user.
- ///
- /// Thrown if the access to the drive information is denied.
- /// Thrown if the drive does not exist or is not mapped.
- /// Thrown if an I/O error occurred (for example, a disk error or a drive was not ready).
- public virtual long TotalSize { get; protected set; }
-
- ///
- /// Gets or sets the volume label of a drive.
- ///
- /// The volume label.
- ///
- /// The label length is determined by the operating system. For example, NTFS allows a volume label to be up to 32 characters long. Note that is a valid VolumeLabel.
- ///
- /// Thrown if an I/O error occurred (for example, a disk error or a drive was not ready).
- /// Thrown if the drive does not exist or is not mapped.
- /// Thrown if the caller does not have the required permission.
- ///
- /// Thrown if the volume label is being set on a network or CD-ROM drive
- /// -or-
- /// Access to the drive information is denied.
- ///
- public virtual string VolumeLabel { get; set; }
-
- ///
- /// Converts a into a .
- ///
- /// The drive info to be converted.
- public static implicit operator DriveInfoBase(DriveInfo driveInfo)
- {
- if (driveInfo == null)
- {
- return null;
- }
-
- return new DriveInfoWrapper(driveInfo);
- }
- }
-}
diff --git a/System.IO.Abstractions/DriveInfoFactory.cs b/System.IO.Abstractions/DriveInfoFactory.cs
deleted file mode 100644
index 4bef25b00..000000000
--- a/System.IO.Abstractions/DriveInfoFactory.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-namespace System.IO.Abstractions
-{
- [Serializable]
- internal class DriveInfoFactory : IDriveInfoFactory
- {
- ///
- /// Retrieves the drive names of all logical drives on a computer.
- ///
- /// An array of type that represents the logical drives on a computer.
- public DriveInfoBase[] GetDrives()
- {
- var driveInfos = DriveInfo.GetDrives();
- var driveInfoWrappers = new DriveInfoBase[driveInfos.Length];
- for (int index = 0; index < driveInfos.Length; index++)
- {
- var driveInfo = driveInfos[index];
- driveInfoWrappers[index] = new DriveInfoWrapper(driveInfo);
- }
-
- return driveInfoWrappers;
- }
- }
-}
diff --git a/System.IO.Abstractions/DriveInfoWrapper.cs b/System.IO.Abstractions/DriveInfoWrapper.cs
deleted file mode 100644
index e5b028093..000000000
--- a/System.IO.Abstractions/DriveInfoWrapper.cs
+++ /dev/null
@@ -1,166 +0,0 @@
-namespace System.IO.Abstractions
-{
- ///
- /// The wrapper for a .
- ///
- [Serializable]
- public class DriveInfoWrapper : DriveInfoBase
- {
- ///
- /// The instance of the real .
- ///
- private readonly DriveInfo instance;
-
- ///
- /// Initializes a new instance of the class, which acts as a wrapper for a drive info.
- ///
- /// The drive info.
- public DriveInfoWrapper(DriveInfo instance)
- {
- if (instance == null)
- {
- throw new ArgumentNullException("instance");
- }
-
- this.instance = instance;
- }
-
- ///
- /// Gets or sets the name of a drive, such as C:\.
- ///
- /// The name of the drive.
- ///
- /// This property is the name assigned to the drive, such as C:\ or E:\.
- ///
- public override string Name
- {
- get { return instance.Name; }
- }
-
- ///
- /// Gets or sets the drive type, such as CD-ROM, removable, network, or fixed.
- ///
- /// One of the enumeration values that specifies a drive type.
- ///
- /// The DriveType property indicates whether a drive is one of the following: CDRom, Fixed, Network, NoRootDirectory, Ram, Removable, or Unknown.
- /// These values are described in the DriveType enumeration.
- ///
- public override DriveType DriveType
- {
- get { return instance.DriveType; }
- }
-
- ///
- /// Gets or sets the name of the file system, such as NTFS or FAT32.
- ///
- ///
- /// Use DriveFormat to determine what formatting a drive uses.
- ///
- /// The name of the file system on the specified drive.
- /// Thrown if the access to the drive information is denied.
- /// Thrown if the drive does not exist or is not mapped.
- /// Thrown if an I/O error occurred (for example, a disk error or a drive was not ready).
- public override string DriveFormat
- {
- get { return instance.DriveFormat; }
- }
-
- ///
- /// Gets or sets a value indicating whether a drive is ready.
- ///
- ///
- /// if the drive is ready; if the drive is not ready.
- ///
- ///
- /// IsReady indicates whether a drive is ready.
- /// For example, it indicates whether a CD is in a CD drive or whether a removable storage device is ready for read/write operations.
- /// If you do not test whether a drive is ready, and it is not ready, querying the drive using will raise an IOException.
- /// Do not rely on IsReady to avoid catching exceptions from other members such as TotalSize, TotalFreeSpace, and .
- /// Between the time that your code checks IsReady and then accesses one of the other properties (even if the access occurs immediately after the check),
- /// a drive may have been disconnected or a disk may have been removed.
- ///
- public override bool IsReady
- {
- get { return instance.IsReady; }
- }
-
- ///
- /// Gets or sets the amount of available free space on a drive, in bytes.
- ///
- /// The amount of free space available on the drive, in bytes.
- ///
- /// This property indicates the amount of free space available on the drive.
- /// Note that this number may be different from the TotalFreeSpace number because this property takes into account disk quotas.
- ///
- /// Thrown if the access to the drive information is denied.
- /// Thrown if an I/O error occurred (for example, a disk error or a drive was not ready).
- public override long AvailableFreeSpace
- {
- get { return instance.AvailableFreeSpace; }
- }
-
- ///
- /// Gets or sets the total amount of free space available on a drive, in bytes.
- ///
- /// The total free space available on a drive, in bytes.
- /// This property indicates the total amount of free space available on the drive, not just what is available to the current user.
- /// Thrown if the access to the drive information is denied.
- /// Thrown if the drive does not exist or is not mapped.
- /// Thrown if an I/O error occurred (for example, a disk error or a drive was not ready).
- public override long TotalFreeSpace
- {
- get { return instance.TotalFreeSpace; }
- }
-
- ///
- /// Gets or sets the total size of storage space on a drive, in bytes.
- ///
- /// The total size of the drive, in bytes.
- ///
- /// This property indicates the total size of the drive in bytes, not just what is available to the current user.
- ///
- /// Thrown if the access to the drive information is denied.
- /// Thrown if the drive does not exist or is not mapped.
- /// Thrown if an I/O error occurred (for example, a disk error or a drive was not ready).
- public override long TotalSize
- {
- get { return instance.TotalSize; }
- }
-
- ///
- /// Gets or sets the root directory of a drive.
- ///
- /// An object that contains the root directory of the drive.
- public override DirectoryInfoBase RootDirectory
- {
- get { return instance.RootDirectory; }
- }
-
- ///
- /// Gets or sets the volume label of a drive.
- ///
- /// The volume label.
- ///
- /// The label length is determined by the operating system. For example, NTFS allows a volume label to be up to 32 characters long. Note that is a valid VolumeLabel.
- ///
- /// Thrown if an I/O error occurred (for example, a disk error or a drive was not ready).
- /// Thrown if the drive does not exist or is not mapped.
- /// Thrown if the caller does not have the required permission.
- ///
- /// Thrown if the volume label is being set on a network or CD-ROM drive
- /// -or-
- /// Access to the drive information is denied.
- ///
- public override string VolumeLabel
- {
- get { return instance.VolumeLabel; }
-
- set { instance.VolumeLabel = value; }
- }
-
- public override string ToString()
- {
- return instance.ToString();
- }
- }
-}
diff --git a/System.IO.Abstractions/FileBase.cs b/System.IO.Abstractions/FileBase.cs
deleted file mode 100644
index eb3c6bf3f..000000000
--- a/System.IO.Abstractions/FileBase.cs
+++ /dev/null
@@ -1,485 +0,0 @@
-using System.Collections.Generic;
-using System.Security.AccessControl;
-using System.Text;
-
-namespace System.IO.Abstractions
-{
- [Serializable]
- public abstract class FileBase
- {
- public abstract void AppendAllLines(string path, IEnumerable contents);
- public abstract void AppendAllLines(string path, IEnumerable contents, Encoding encoding);
- public abstract void AppendAllText(string path, string contents);
- public abstract void AppendAllText(string path, string contents, Encoding encoding);
- public abstract StreamWriter AppendText(string path);
- public abstract void Copy(string sourceFileName, string destFileName);
- public abstract void Copy(string sourceFileName, string destFileName, bool overwrite);
- public abstract Stream Create(string path);
- public abstract Stream Create(string path, int bufferSize);
- public abstract Stream Create(string path, int bufferSize, FileOptions options);
- public abstract Stream Create(string path, int bufferSize, FileOptions options, FileSecurity fileSecurity);
- public abstract StreamWriter CreateText(string path);
- public abstract void Decrypt(string path);
- public abstract void Delete(string path);
- public abstract void Encrypt(string path);
-
- ///
- /// Determines whether the specified file exists.
- ///
- /// The file to check.
- /// if the caller has the required permissions and path contains the name of an existing file; otherwise, . This method also returns if is , an invalid path, or a zero-length string. If the caller does not have sufficient permissions to read the specified file, no exception is thrown and the method returns regardless of the existence of .
- ///
- ///
- /// The Exists method should not be used for path validation, this method merely checks if the file specified in exists.
- /// Passing an invalid path to Exists returns .
- ///
- ///
- /// Be aware that another process can potentially do something with the file in between the time you call the Exists method and perform another operation on the file, such as .
- ///
- ///
- /// The parameter is permitted to specify relative or absolute path information.
- /// Relative path information is interpreted as relative to the current working directory.
- /// To obtain the current working directory, see .
- ///
- ///
- /// If describes a directory, this method returns . Trailing spaces are removed from the parameter before determining if the file exists.
- ///
- ///
- /// The Exists method returns if any error occurs while trying to determine if the specified file exists.
- /// This can occur in situations that raise exceptions such as passing a file name with invalid characters or too many characters
- /// a failing or missing disk, or if the caller does not have permission to read the file.
- ///
- ///
- public abstract bool Exists(string path);
- public abstract FileSecurity GetAccessControl(string path);
- public abstract FileSecurity GetAccessControl(string path, AccessControlSections includeSections);
-
- ///
- /// Gets the of the file on the path.
- ///
- /// The path to the file.
- /// The of the file on the path.
- /// is empty, contains only white spaces, or contains invalid characters.
- /// The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters.
- /// is in an invalid format.
- /// represents a file and is invalid, such as being on an unmapped drive, or the file cannot be found.
- /// represents a directory and is invalid, such as being on an unmapped drive, or the directory cannot be found.
- /// This file is being used by another process.
- /// The caller does not have the required permission.
- public abstract FileAttributes GetAttributes(string path);
-
- ///
- /// Returns the creation date and time of the specified file or directory.
- ///
- /// The file or directory for which to obtain creation date and time information.
- /// A structure set to the creation date and time for the specified file or directory. This value is expressed in local time.
- /// The caller does not have the required permission.
- /// is empty, contains only white spaces, or contains invalid characters.
- /// is .
- /// The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters.
- /// is in an invalid format.
- ///
- ///
- /// The parameter is permitted to specify relative or absolute path information. Relative path information is interpreted as relative to the current working directory. To obtain the current working directory, see .
- ///
- ///
- /// If the file described in the parameter does not exist, this method returns 12:00 midnight, January 1, 1601 A.D. (C.E.) Coordinated Universal Time (UTC), adjusted to local time.
- ///
- ///
- /// NTFS-formatted drives may cache file meta-info, such as file creation time, for a short period of time, which is known as "file tunneling." As a result, it may be necessary to explicitly set the creation time of a file if you are overwriting or replacing an existing file.
- ///
- ///
- public abstract DateTime GetCreationTime(string path);
-
- ///
- /// Returns the creation date and time, in coordinated universal time (UTC), of the specified file or directory.
- ///
- /// The file or directory for which to obtain creation date and time information.
- /// A structure set to the creation date and time for the specified file or directory. This value is expressed in UTC time.
- /// The caller does not have the required permission.
- /// is empty, contains only white spaces, or contains invalid characters.
- /// is .
- /// The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters.
- /// is in an invalid format.
- ///
- ///
- /// The parameter is permitted to specify relative or absolute path information. Relative path information is interpreted as relative to the current working directory. To obtain the current working directory, see .
- ///
- ///
- /// If the file described in the parameter does not exist, this method returns 12:00 midnight, January 1, 1601 A.D. (C.E.) Coordinated Universal Time (UTC).
- ///
- ///
- /// NTFS-formatted drives may cache file meta-info, such as file creation time, for a short period of time, which is known as "file tunneling." As a result, it may be necessary to explicitly set the creation time of a file if you are overwriting or replacing an existing file.
- ///
- ///
- public abstract DateTime GetCreationTimeUtc(string path);
-
- ///
- /// Returns the date and time the specified file or directory was last accessed.
- ///
- /// The file or directory for which to obtain access date and time information.
- /// A structure set to the date and time that the specified file or directory was last accessed. This value is expressed in local time.
- /// The caller does not have the required permission.
- /// is empty, contains only white spaces, or contains invalid characters.
- /// is .
- /// The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters.
- /// is in an invalid format.
- ///
- ///
- /// The parameter is permitted to specify relative or absolute path information. Relative path information is interpreted as relative to the current working directory. To obtain the current working directory, see .
- ///
- ///
- /// If the file described in the parameter does not exist, this method returns 12:00 midnight, January 1, 1601 A.D. (C.E.) Coordinated Universal Time (UTC), adjusted to local time.
- ///
- ///
- /// NTFS-formatted drives may cache file meta-info, such as file creation time, for a short period of time, which is known as "file tunneling." As a result, it may be necessary to explicitly set the creation time of a file if you are overwriting or replacing an existing file.
- ///
- ///
- public abstract DateTime GetLastAccessTime(string path);
-
- ///
- /// Returns the date and time, in coordinated universal time (UTC), that the specified file or directory was last accessed.
- ///
- /// The file or directory for which to obtain creation date and time information.
- /// A structure set to the date and time that the specified file or directory was last accessed. This value is expressed in UTC time.
- /// The caller does not have the required permission.
- /// is empty, contains only white spaces, or contains invalid characters.
- /// is .
- /// The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters.
- /// is in an invalid format.
- ///
- ///
- /// The parameter is permitted to specify relative or absolute path information. Relative path information is interpreted as relative to the current working directory. To obtain the current working directory, see .
- ///
- ///
- /// If the file described in the parameter does not exist, this method returns 12:00 midnight, January 1, 1601 A.D. (C.E.) Coordinated Universal Time (UTC).
- ///
- ///
- /// NTFS-formatted drives may cache file meta-info, such as file creation time, for a short period of time, which is known as "file tunneling." As a result, it may be necessary to explicitly set the creation time of a file if you are overwriting or replacing an existing file.
- ///
- ///
- public abstract DateTime GetLastAccessTimeUtc(string path);
-
- ///
- /// Returns the date and time the specified file or directory was last written to.
- ///
- /// The file or directory for which to obtain creation date and time information.
- /// A structure set to the date and time that the specified file or directory was last written to. This value is expressed in local time.
- /// The caller does not have the required permission.
- /// is empty, contains only white spaces, or contains invalid characters.
- /// is .
- /// The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters.
- /// is in an invalid format.
- ///
- ///
- /// If the file described in the path parameter does not exist, this method returns 12:00 midnight, January 1, 1601 A.D. (C.E.) Coordinated Universal Time (UTC), adjusted to local time.
- ///
- ///
- /// The parameter is permitted to specify relative or absolute path information. Relative path information is interpreted as relative to the current working directory. To obtain the current working directory, see .
- ///
- ///
- /// NTFS-formatted drives may cache file meta-info, such as file creation time, for a short period of time, which is known as "file tunneling." As a result, it may be necessary to explicitly set the creation time of a file if you are overwriting or replacing an existing file.
- ///
- ///
- public abstract DateTime GetLastWriteTime(string path);
-
- ///
- /// Returns the date and time, in coordinated universal time (UTC), that the specified file or directory was last written to.
- ///
- /// The file or directory for which to obtain creation date and time information.
- /// A structure set to the date and time that the specified file or directory was last written to. This value is expressed in local time.
- /// The caller does not have the required permission.
- /// is empty, contains only white spaces, or contains invalid characters.
- /// is .
- /// The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters.
- /// is in an invalid format.
- ///
- ///
- /// If the file described in the path parameter does not exist, this method returns 12:00 midnight, January 1, 1601 A.D. (C.E.) Coordinated Universal Time (UTC).
- ///
- ///
- /// The parameter is permitted to specify relative or absolute path information. Relative path information is interpreted as relative to the current working directory. To obtain the current working directory, see .
- ///
- ///
- /// NTFS-formatted drives may cache file meta-info, such as file creation time, for a short period of time, which is known as "file tunneling." As a result, it may be necessary to explicitly set the creation time of a file if you are overwriting or replacing an existing file.
- ///
- ///
- public abstract DateTime GetLastWriteTimeUtc(string path);
- public abstract void Move(string sourceFileName, string destFileName);
- public abstract Stream Open(string path, FileMode mode);
- public abstract Stream Open(string path, FileMode mode, FileAccess access);
- public abstract Stream Open(string path, FileMode mode, FileAccess access, FileShare share);
- public abstract Stream OpenRead(string path);
- public abstract StreamReader OpenText(string path);
- public abstract Stream OpenWrite(string path);
- public abstract byte[] ReadAllBytes(string path);
- public abstract string[] ReadAllLines(string path);
- public abstract string[] ReadAllLines(string path, Encoding encoding);
- public abstract string ReadAllText(string path);
- public abstract string ReadAllText(string path, Encoding encoding);
- public abstract IEnumerable ReadLines(string path);
- public abstract IEnumerable ReadLines(string path, Encoding encoding);
- public abstract void Replace(string sourceFileName, string destinationFileName, string destinationBackupFileName);
- public abstract void Replace(string sourceFileName, string destinationFileName, string destinationBackupFileName, bool ignoreMetadataErrors);
- public abstract void SetAccessControl(string path, FileSecurity fileSecurity);
- public abstract void SetAttributes(string path, FileAttributes fileAttributes);
- public abstract void SetCreationTime(string path, DateTime creationTime);
- public abstract void SetCreationTimeUtc(string path, DateTime creationTimeUtc);
- public abstract void SetLastAccessTime(string path, DateTime lastAccessTime);
- public abstract void SetLastAccessTimeUtc(string path, DateTime lastAccessTimeUtc);
- public abstract void SetLastWriteTime(string path, DateTime lastWriteTime);
- public abstract void SetLastWriteTimeUtc(string path, DateTime lastWriteTimeUtc);
-
- ///
- /// Creates a new file, writes the specified byte array to the file, and then closes the file.
- /// If the target file already exists, it is overwritten.
- ///
- /// The file to write to.
- /// The bytes to write to the file.
- /// is a zero-length string, contains only white space, or contains one or more invalid characters as defined by .
- /// is or contents is empty.
- ///
- /// The specified path, file name, or both exceed the system-defined maximum length.
- /// For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters.
- ///
- /// The specified path is invalid (for example, it is on an unmapped drive).
- /// An I/O error occurred while opening the file.
- ///
- /// path specified a file that is read-only.
- /// -or-
- /// This operation is not supported on the current platform.
- /// -or-
- /// path specified a directory.
- /// -or-
- /// The caller does not have the required permission.
- ///
- /// The file specified in was not found.
- /// is in an invalid format.
- /// The caller does not have the required permission.
- ///
- /// Given a byte array and a file path, this method opens the specified file, writes the contents of the byte array to the file, and then closes the file.
- ///
- public abstract void WriteAllBytes(string path, byte[] bytes);
-
- ///
- /// Creates a new file, writes a collection of strings to the file, and then closes the file.
- ///
- /// The file to write to.
- /// The lines to write to the file.
- /// is a zero-length string, contains only white space, or contains one or more invalid characters as defined by .
- /// Either or is .
- /// The specified path is invalid (for example, it is on an unmapped drive).
- /// The file specified in was not found.
- /// An I/O error occurred while opening the file.
- ///
- /// The specified path, file name, or both exceed the system-defined maximum length.
- /// For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters.
- ///
- /// is in an invalid format.
- /// The caller does not have the required permission.
- ///
- /// specified a file that is read-only.
- /// -or-
- /// This operation is not supported on the current platform.
- /// -or-
- /// specified a directory.
- /// -or-
- /// The caller does not have the required permission.
- ///
- ///
- ///
- /// If the target file already exists, it is overwritten.
- ///
- ///
- /// You can use this method to create the contents for a collection class that takes an in its constructor, such as a , , or a class.
- ///
- ///
- public abstract void WriteAllLines(string path, IEnumerable contents);
-
- ///
- /// Creates a new file by using the specified encoding, writes a collection of strings to the file, and then closes the file.
- ///
- /// The file to write to.
- /// The lines to write to the file.
- /// The character encoding to use.
- /// is a zero-length string, contains only white space, or contains one or more invalid characters as defined by .
- /// Either , , or is .
- /// The specified path is invalid (for example, it is on an unmapped drive).
- /// The file specified in was not found.
- /// An I/O error occurred while opening the file.
- ///
- /// The specified path, file name, or both exceed the system-defined maximum length.
- /// For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters.
- ///
- /// is in an invalid format.
- /// The caller does not have the required permission.
- ///
- /// specified a file that is read-only.
- /// -or-
- /// This operation is not supported on the current platform.
- /// -or-
- /// specified a directory.
- /// -or-
- /// The caller does not have the required permission.
- ///
- ///
- ///
- /// If the target file already exists, it is overwritten.
- ///
- ///
- /// You can use this method to create a file that contains the following:
- ///
- /// -
- /// The results of a LINQ to Objects query on the lines of a file, as obtained by using the ReadLines method.
- ///
- /// -
- /// The contents of a collection that implements an of strings.
- ///
- ///
- ///
- ///
- public abstract void WriteAllLines(string path, IEnumerable contents, Encoding encoding);
-
- ///
- /// Creates a new file, writes the specified string array to the file by using the specified encoding, and then closes the file.
- ///
- /// The file to write to.
- /// The string array to write to the file.
- /// is a zero-length string, contains only white space, or contains one or more invalid characters as defined by .
- /// Either or is .
- ///
- /// The specified path, file name, or both exceed the system-defined maximum length.
- /// For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters.
- ///
- /// The specified path is invalid (for example, it is on an unmapped drive).
- /// An I/O error occurred while opening the file.
- ///
- /// specified a file that is read-only.
- /// -or-
- /// This operation is not supported on the current platform.
- /// -or-
- /// specified a directory.
- /// -or-
- /// The caller does not have the required permission.
- ///
- /// The file specified in was not found.
- /// is in an invalid format.
- /// The caller does not have the required permission.
- ///
- ///
- /// If the target file already exists, it is overwritten.
- ///
- ///
- /// The default behavior of the WriteAllLines method is to write out data using UTF-8 encoding without a byte order mark (BOM). If it is necessary to include a UTF-8 identifier, such as a byte order mark, at the beginning of a file, use the method overload with encoding.
- ///
- ///
- /// Given a string array and a file path, this method opens the specified file, writes the string array to the file using the specified encoding,
- /// and then closes the file.
- ///
- ///
- public abstract void WriteAllLines(string path, string[] contents);
-
- ///
- /// Creates a new file, writes the specified string array to the file by using the specified encoding, and then closes the file.
- ///
- /// The file to write to.
- /// The string array to write to the file.
- /// An object that represents the character encoding applied to the string array.
- /// is a zero-length string, contains only white space, or contains one or more invalid characters as defined by .
- /// Either or is .
- ///
- /// The specified path, file name, or both exceed the system-defined maximum length.
- /// For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters.
- ///
- /// The specified path is invalid (for example, it is on an unmapped drive).
- /// An I/O error occurred while opening the file.
- ///
- /// specified a file that is read-only.
- /// -or-
- /// This operation is not supported on the current platform.
- /// -or-
- /// specified a directory.
- /// -or-
- /// The caller does not have the required permission.
- ///
- /// The file specified in was not found.
- /// is in an invalid format.
- /// The caller does not have the required permission.
- ///
- ///
- /// If the target file already exists, it is overwritten.
- ///
- ///
- /// Given a string array and a file path, this method opens the specified file, writes the string array to the file using the specified encoding,
- /// and then closes the file.
- ///
- ///
- public abstract void WriteAllLines(string path, string[] contents, Encoding encoding);
-
- ///
- /// Creates a new file, writes the specified string to the file using the specified encoding, and then closes the file. If the target file already exists, it is overwritten.
- ///
- /// The file to write to.
- /// The string to write to the file.
- /// is a zero-length string, contains only white space, or contains one or more invalid characters as defined by .
- /// is or contents is empty.
- ///
- /// The specified path, file name, or both exceed the system-defined maximum length.
- /// For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters.
- ///
- /// The specified path is invalid (for example, it is on an unmapped drive).
- /// An I/O error occurred while opening the file.
- ///
- /// path specified a file that is read-only.
- /// -or-
- /// This operation is not supported on the current platform.
- /// -or-
- /// path specified a directory.
- /// -or-
- /// The caller does not have the required permission.
- ///
- /// The file specified in was not found.
- /// is in an invalid format.
- /// The caller does not have the required permission.
- ///
- /// This method uses UTF-8 encoding without a Byte-Order Mark (BOM), so using the method will return an empty byte array.
- /// If it is necessary to include a UTF-8 identifier, such as a byte order mark, at the beginning of a file, use the method overload with encoding.
- ///
- /// Given a string and a file path, this method opens the specified file, writes the string to the file, and then closes the file.
- ///
- ///
- public abstract void WriteAllText(string path, string contents);
-
- ///
- /// Creates a new file, writes the specified string to the file using the specified encoding, and then closes the file. If the target file already exists, it is overwritten.
- ///
- /// The file to write to.
- /// The string to write to the file.
- /// The encoding to apply to the string.
- /// is a zero-length string, contains only white space, or contains one or more invalid characters as defined by .
- /// is or contents is empty.
- ///
- /// The specified path, file name, or both exceed the system-defined maximum length.
- /// For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters.
- ///
- /// The specified path is invalid (for example, it is on an unmapped drive).
- /// An I/O error occurred while opening the file.
- ///
- /// path specified a file that is read-only.
- /// -or-
- /// This operation is not supported on the current platform.
- /// -or-
- /// path specified a directory.
- /// -or-
- /// The caller does not have the required permission.
- ///
- /// The file specified in was not found.
- /// is in an invalid format.
- /// The caller does not have the required permission.
- ///
- /// Given a string and a file path, this method opens the specified file, writes the string to the file using the specified encoding, and then closes the file.
- /// The file handle is guaranteed to be closed by this method, even if exceptions are raised.
- ///
- public abstract void WriteAllText(string path, string contents, Encoding encoding);
- }
-}
\ No newline at end of file
diff --git a/System.IO.Abstractions/FileInfoBase.cs b/System.IO.Abstractions/FileInfoBase.cs
deleted file mode 100644
index 31d31979c..000000000
--- a/System.IO.Abstractions/FileInfoBase.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-using System.Security.AccessControl;
-
-namespace System.IO.Abstractions
-{
- [Serializable]
- public abstract class FileInfoBase : FileSystemInfoBase
- {
- public abstract StreamWriter AppendText();
- public abstract FileInfoBase CopyTo(string destFileName);
- public abstract FileInfoBase CopyTo(string destFileName, bool overwrite);
- public abstract Stream Create();
- public abstract StreamWriter CreateText();
- public abstract void Decrypt();
- public abstract void Encrypt();
- public abstract FileSecurity GetAccessControl();
- public abstract FileSecurity GetAccessControl(AccessControlSections includeSections);
- public abstract void MoveTo(string destFileName);
- public abstract Stream Open(FileMode mode);
- public abstract Stream Open(FileMode mode, FileAccess access);
- public abstract Stream Open(FileMode mode, FileAccess access, FileShare share);
- public abstract Stream OpenRead();
- public abstract StreamReader OpenText();
- public abstract Stream OpenWrite();
- public abstract FileInfoBase Replace(string destinationFileName, string destinationBackupFileName);
- public abstract FileInfoBase Replace(string destinationFileName, string destinationBackupFileName, bool ignoreMetadataErrors);
- public abstract void SetAccessControl(FileSecurity fileSecurity);
- public abstract DirectoryInfoBase Directory { get; }
- public abstract string DirectoryName { get; }
- public abstract bool IsReadOnly { get; set; }
- public abstract long Length { get; }
-
- public static implicit operator FileInfoBase(FileInfo fileInfo)
- {
- return new FileInfoWrapper(fileInfo);
- }
- }
-}
\ No newline at end of file
diff --git a/System.IO.Abstractions/FileInfoFactory.cs b/System.IO.Abstractions/FileInfoFactory.cs
deleted file mode 100644
index e34449dd9..000000000
--- a/System.IO.Abstractions/FileInfoFactory.cs
+++ /dev/null
@@ -1,12 +0,0 @@
-namespace System.IO.Abstractions
-{
- [Serializable]
- internal class FileInfoFactory : IFileInfoFactory
- {
- public FileInfoBase FromFileName(string fileName)
- {
- var realFileInfo = new FileInfo(fileName);
- return new FileInfoWrapper(realFileInfo);
- }
- }
-}
\ No newline at end of file
diff --git a/System.IO.Abstractions/FileInfoWrapper.cs b/System.IO.Abstractions/FileInfoWrapper.cs
deleted file mode 100644
index 2660723d1..000000000
--- a/System.IO.Abstractions/FileInfoWrapper.cs
+++ /dev/null
@@ -1,208 +0,0 @@
-using System.Security.AccessControl;
-
-namespace System.IO.Abstractions
-{
- [Serializable]
- public class FileInfoWrapper : FileInfoBase
- {
- private readonly FileInfo instance;
-
- public FileInfoWrapper(FileInfo instance)
- {
- if (instance == null)
- {
- throw new ArgumentNullException("instance");
- }
-
- this.instance = instance;
- }
-
- public override void Delete()
- {
- instance.Delete();
- }
-
- public override void Refresh()
- {
- instance.Refresh();
- }
-
- public override FileAttributes Attributes
- {
- get { return instance.Attributes; }
- set { instance.Attributes = value; }
- }
-
- public override DateTime CreationTime
- {
- get { return instance.CreationTime; }
- set { instance.CreationTime = value; }
- }
-
- public override DateTime CreationTimeUtc
- {
- get { return instance.CreationTimeUtc; }
- set { instance.CreationTimeUtc = value; }
- }
-
- public override bool Exists
- {
- get { return instance.Exists; }
- }
-
- public override string Extension
- {
- get { return instance.Extension; }
- }
-
- public override string FullName
- {
- get { return instance.FullName; }
- }
-
- public override DateTime LastAccessTime
- {
- get { return instance.LastAccessTime; }
- set { instance.LastAccessTime = value; }
- }
-
- public override DateTime LastAccessTimeUtc
- {
- get { return instance.LastAccessTimeUtc; }
- set { instance.LastAccessTimeUtc = value; }
- }
-
- public override DateTime LastWriteTime
- {
- get { return instance.LastWriteTime; }
- set { instance.LastWriteTime = value; }
- }
-
- public override DateTime LastWriteTimeUtc
- {
- get { return instance.LastWriteTimeUtc; }
- set { instance.LastWriteTimeUtc = value; }
- }
-
- public override string Name
- {
- get { return instance.Name; }
- }
-
- public override StreamWriter AppendText()
- {
- return instance.AppendText();
- }
-
- public override FileInfoBase CopyTo(string destFileName)
- {
- return instance.CopyTo(destFileName);
- }
-
- public override FileInfoBase CopyTo(string destFileName, bool overwrite)
- {
- return instance.CopyTo(destFileName, overwrite);
- }
-
- public override Stream Create()
- {
- return instance.Create();
- }
-
- public override StreamWriter CreateText()
- {
- return instance.CreateText();
- }
-
- public override void Decrypt()
- {
- instance.Decrypt();
- }
-
- public override void Encrypt()
- {
- instance.Encrypt();
- }
-
- public override FileSecurity GetAccessControl()
- {
- return instance.GetAccessControl();
- }
-
- public override FileSecurity GetAccessControl(AccessControlSections includeSections)
- {
- return instance.GetAccessControl(includeSections);
- }
-
- public override void MoveTo(string destFileName)
- {
- instance.MoveTo(destFileName);
- }
-
- public override Stream Open(FileMode mode)
- {
- return instance.Open(mode);
- }
-
- public override Stream Open(FileMode mode, FileAccess access)
- {
- return instance.Open(mode, access);
- }
-
- public override Stream Open(FileMode mode, FileAccess access, FileShare share)
- {
- return instance.Open(mode, access, share);
- }
-
- public override Stream OpenRead()
- {
- return instance.OpenRead();
- }
-
- public override StreamReader OpenText()
- {
- return instance.OpenText();
- }
-
- public override Stream OpenWrite()
- {
- return instance.OpenWrite();
- }
-
- public override FileInfoBase Replace(string destinationFileName, string destinationBackupFileName)
- {
- return instance.Replace(destinationFileName, destinationBackupFileName);
- }
-
- public override FileInfoBase Replace(string destinationFileName, string destinationBackupFileName, bool ignoreMetadataErrors)
- {
- return instance.Replace(destinationFileName, destinationBackupFileName, ignoreMetadataErrors);
- }
-
- public override void SetAccessControl(FileSecurity fileSecurity)
- {
- instance.SetAccessControl(fileSecurity);
- }
-
- public override DirectoryInfoBase Directory
- {
- get { return instance.Directory; }
- }
-
- public override string DirectoryName
- {
- get { return instance.DirectoryName; }
- }
-
- public override bool IsReadOnly
- {
- get { return instance.IsReadOnly; }
- set { instance.IsReadOnly = value; }
- }
-
- public override long Length
- {
- get { return instance.Length; }
- }
- }
-}
\ No newline at end of file
diff --git a/System.IO.Abstractions/FileSystem.cs b/System.IO.Abstractions/FileSystem.cs
deleted file mode 100644
index 28f3a77c5..000000000
--- a/System.IO.Abstractions/FileSystem.cs
+++ /dev/null
@@ -1,43 +0,0 @@
-namespace System.IO.Abstractions
-{
- [Serializable]
- public class FileSystem : IFileSystem
- {
- DirectoryBase directory;
- public DirectoryBase Directory
- {
- get { return directory ?? (directory = new DirectoryWrapper()); }
- }
-
- FileBase file;
- public FileBase File
- {
- get { return file ?? (file = new FileWrapper()); }
- }
-
- FileInfoFactory fileInfoFactory;
- public IFileInfoFactory FileInfo
- {
- get { return fileInfoFactory ?? (fileInfoFactory = new FileInfoFactory()); }
- }
-
- PathBase path;
- public PathBase Path
- {
- get { return path ?? (path = new PathWrapper()); }
- }
-
- DirectoryInfoFactory directoryInfoFactory;
- public IDirectoryInfoFactory DirectoryInfo
- {
- get { return directoryInfoFactory ?? (directoryInfoFactory = new DirectoryInfoFactory()); }
- }
-
- private readonly Lazy driveInfoFactory = new Lazy(() => new DriveInfoFactory());
-
- public IDriveInfoFactory DriveInfo
- {
- get { return driveInfoFactory.Value; }
- }
- }
-}
\ No newline at end of file
diff --git a/System.IO.Abstractions/FileSystemInfoBase.cs b/System.IO.Abstractions/FileSystemInfoBase.cs
deleted file mode 100644
index 28e81dd76..000000000
--- a/System.IO.Abstractions/FileSystemInfoBase.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-namespace System.IO.Abstractions
-{
- [Serializable]
- public abstract class FileSystemInfoBase
- {
- public abstract void Delete();
- public abstract void Refresh();
- public abstract FileAttributes Attributes { get; set; }
- public abstract DateTime CreationTime { get; set; }
- public abstract DateTime CreationTimeUtc { get; set; }
- public abstract bool Exists { get; }
- public abstract string Extension { get; }
- public abstract string FullName { get; }
- public abstract DateTime LastAccessTime { get; set; }
- public abstract DateTime LastAccessTimeUtc { get; set; }
- public abstract DateTime LastWriteTime { get; set; }
- public abstract DateTime LastWriteTimeUtc { get; set; }
- public abstract string Name { get; }
- }
-}
\ No newline at end of file
diff --git a/System.IO.Abstractions/FileSystemWatcherBase.cs b/System.IO.Abstractions/FileSystemWatcherBase.cs
deleted file mode 100644
index 474425566..000000000
--- a/System.IO.Abstractions/FileSystemWatcherBase.cs
+++ /dev/null
@@ -1,93 +0,0 @@
-using System.ComponentModel;
-
-namespace System.IO.Abstractions
-{
- [Serializable]
- public abstract class FileSystemWatcherBase : IDisposable
- {
- public abstract bool IncludeSubdirectories { get; set; }
- public abstract bool EnableRaisingEvents { get; set; }
- public abstract string Filter { get; set; }
- public abstract int InternalBufferSize { get; set; }
- public abstract NotifyFilters NotifyFilter { get; set; }
- public abstract string Path { get; set; }
- public abstract ISite Site { get; set; }
- public abstract ISynchronizeInvoke SynchronizingObject { get; set; }
- public virtual event FileSystemEventHandler Changed;
- public virtual event FileSystemEventHandler Created;
- public virtual event FileSystemEventHandler Deleted;
- public virtual event ErrorEventHandler Error;
- public virtual event RenamedEventHandler Renamed;
- public abstract void BeginInit();
-
- public void Dispose()
- {
- Dispose(true);
- GC.SuppressFinalize(this);
- }
-
- public abstract void EndInit();
- public abstract WaitForChangedResult WaitForChanged(WatcherChangeTypes changeType);
- public abstract WaitForChangedResult WaitForChanged(WatcherChangeTypes changeType, int timeout);
-
- public static implicit operator FileSystemWatcherBase(FileSystemWatcher watcher)
- {
- if (watcher == null)
- {
- throw new ArgumentNullException("watcher");
- }
-
- return new FileSystemWatcherWrapper(watcher);
- }
-
- public virtual void Dispose(bool disposing)
- {
- // do nothing
- }
-
- protected void OnCreated(object sender, FileSystemEventArgs args)
- {
- var onCreated = Created;
- if (onCreated != null)
- {
- onCreated(sender, args);
- }
- }
-
- protected void OnChanged(object sender, FileSystemEventArgs args)
- {
- var onChanged = Changed;
- if (onChanged != null)
- {
- onChanged(sender, args);
- }
- }
-
- protected void OnDeleted(object sender, FileSystemEventArgs args)
- {
- var onDeleted = Deleted;
- if (onDeleted != null)
- {
- onDeleted(sender, args);
- }
- }
-
- protected void OnRenamed(object sender, RenamedEventArgs args)
- {
- var onRenamed = Renamed;
- if (onRenamed != null)
- {
- onRenamed(sender, args);
- }
- }
-
- protected void OnError(object sender, ErrorEventArgs args)
- {
- var onError = Error;
- if (onError != null)
- {
- onError(sender, args);
- }
- }
- }
-}
diff --git a/System.IO.Abstractions/FileSystemWatcherWrapper.cs b/System.IO.Abstractions/FileSystemWatcherWrapper.cs
deleted file mode 100644
index a3c24dfd0..000000000
--- a/System.IO.Abstractions/FileSystemWatcherWrapper.cs
+++ /dev/null
@@ -1,127 +0,0 @@
-using System.ComponentModel;
-
-namespace System.IO.Abstractions
-{
- [Serializable]
- public class FileSystemWatcherWrapper : FileSystemWatcherBase
- {
- [NonSerialized]
- private readonly FileSystemWatcher watcher;
-
- public FileSystemWatcherWrapper()
- : this(new FileSystemWatcher())
- {
- // do nothing
- }
-
- public FileSystemWatcherWrapper(string path)
- : this(new FileSystemWatcher(path))
- {
- // do nothing
- }
-
- public FileSystemWatcherWrapper(string path, string filter)
- : this(new FileSystemWatcher(path, filter))
- {
- // do nothing
- }
-
- public FileSystemWatcherWrapper(FileSystemWatcher watcher)
- {
- if (watcher == null)
- {
- throw new ArgumentNullException("watcher");
- }
-
- this.watcher = watcher;
- this.watcher.Created += OnCreated;
- this.watcher.Changed += OnChanged;
- this.watcher.Deleted += OnDeleted;
- this.watcher.Error += OnError;
- this.watcher.Renamed += OnRenamed;
- }
-
- public override bool IncludeSubdirectories
- {
- get { return watcher.IncludeSubdirectories; }
- set { watcher.IncludeSubdirectories = value; }
- }
-
- public override bool EnableRaisingEvents
- {
- get { return watcher.EnableRaisingEvents; }
- set { watcher.EnableRaisingEvents = value; }
- }
-
- public override string Filter
- {
- get { return watcher.Filter; }
- set { watcher.Filter = value; }
- }
-
- public override int InternalBufferSize
- {
- get { return watcher.InternalBufferSize; }
- set { watcher.InternalBufferSize = value; }
- }
-
- public override NotifyFilters NotifyFilter
- {
- get { return watcher.NotifyFilter; }
- set { watcher.NotifyFilter = value; }
- }
-
- public override string Path
- {
- get { return watcher.Path; }
- set { watcher.Path = value; }
- }
-
- public override ISite Site
- {
- get { return watcher.Site; }
- set { watcher.Site = value; }
- }
-
- public override ISynchronizeInvoke SynchronizingObject
- {
- get { return watcher.SynchronizingObject; }
- set { watcher.SynchronizingObject = value; }
- }
-
- public override void BeginInit()
- {
- watcher.BeginInit();
- }
-
- public override void Dispose(bool disposing)
- {
- if (disposing)
- {
- watcher.Created -= OnCreated;
- watcher.Changed -= OnChanged;
- watcher.Deleted -= OnDeleted;
- watcher.Error -= OnError;
- watcher.Renamed -= OnRenamed;
- watcher.Dispose();
- }
-
- base.Dispose(disposing);
- }
-
- public override void EndInit()
- {
- watcher.EndInit();
- }
-
- public override WaitForChangedResult WaitForChanged(WatcherChangeTypes changeType)
- {
- return watcher.WaitForChanged(changeType);
- }
-
- public override WaitForChangedResult WaitForChanged(WatcherChangeTypes changeType, int timeout)
- {
- return watcher.WaitForChanged(changeType, timeout);
- }
- }
-}
diff --git a/System.IO.Abstractions/FileWrapper.cs b/System.IO.Abstractions/FileWrapper.cs
deleted file mode 100644
index 10e1eed5f..000000000
--- a/System.IO.Abstractions/FileWrapper.cs
+++ /dev/null
@@ -1,540 +0,0 @@
-using System.Collections.Generic;
-using System.Security.AccessControl;
-using System.Text;
-
-namespace System.IO.Abstractions
-{
- [Serializable]
- public class FileWrapper : FileBase
- {
- public override void AppendAllLines(string path, IEnumerable contents)
- {
- File.AppendAllLines(path, contents);
- }
-
- public override void AppendAllLines(string path, IEnumerable contents, Encoding encoding)
- {
- File.AppendAllLines(path, contents, encoding);
- }
-
- public override void AppendAllText(string path, string contents)
- {
- File.AppendAllText(path, contents);
- }
-
- public override void AppendAllText(string path, string contents, Encoding encoding)
- {
- File.AppendAllText(path, contents, encoding);
- }
-
- public override StreamWriter AppendText(string path)
- {
- return File.AppendText(path);
- }
-
- public override void Copy(string sourceFileName, string destFileName)
- {
- File.Copy(sourceFileName, destFileName);
- }
-
- public override void Copy(string sourceFileName, string destFileName, bool overwrite)
- {
- File.Copy(sourceFileName, destFileName, overwrite);
- }
-
- public override Stream Create(string path)
- {
- return File.Create(path);
- }
-
- public override Stream Create(string path, int bufferSize)
- {
- return File.Create(path, bufferSize);
- }
-
- public override Stream Create(string path, int bufferSize, FileOptions options)
- {
- return File.Create(path, bufferSize, options);
- }
-
- public override Stream Create(string path, int bufferSize, FileOptions options, FileSecurity fileSecurity)
- {
- return File.Create(path, bufferSize, options, fileSecurity);
- }
-
- public override StreamWriter CreateText(string path)
- {
- return File.CreateText(path);
- }
-
- public override void Decrypt(string path)
- {
- File.Decrypt(path);
- }
-
- public override void Delete(string path)
- {
- File.Delete(path);
- }
-
- public override void Encrypt(string path)
- {
- File.Encrypt(path);
- }
-
- public override bool Exists(string path)
- {
- return File.Exists(path);
- }
-
- public override FileSecurity GetAccessControl(string path)
- {
- return File.GetAccessControl(path);
- }
-
- public override FileSecurity GetAccessControl(string path, AccessControlSections includeSections)
- {
- return File.GetAccessControl(path, includeSections);
- }
-
- ///
- /// Gets the of the file on the path.
- ///
- /// The path to the file.
- /// The of the file on the path.
- /// is empty, contains only white spaces, or contains invalid characters.
- /// The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters.
- /// is in an invalid format.
- /// represents a file and is invalid, such as being on an unmapped drive, or the file cannot be found.
- /// represents a directory and is invalid, such as being on an unmapped drive, or the directory cannot be found.
- /// This file is being used by another process.
- /// The caller does not have the required permission.
- public override FileAttributes GetAttributes(string path)
- {
- return File.GetAttributes(path);
- }
-
- public override DateTime GetCreationTime(string path)
- {
- return File.GetCreationTime(path);
- }
-
- public override DateTime GetCreationTimeUtc(string path)
- {
- return File.GetCreationTimeUtc(path);
- }
-
- public override DateTime GetLastAccessTime(string path)
- {
- return File.GetLastAccessTime(path);
- }
-
- public override DateTime GetLastAccessTimeUtc(string path)
- {
- return File.GetLastAccessTimeUtc(path);
- }
-
- public override DateTime GetLastWriteTime(string path)
- {
- return File.GetLastWriteTime(path);
- }
-
- public override DateTime GetLastWriteTimeUtc(string path)
- {
- return File.GetLastWriteTimeUtc(path);
- }
-
- public override void Move(string sourceFileName, string destFileName)
- {
- File.Move(sourceFileName, destFileName);
- }
-
- public override Stream Open(string path, FileMode mode)
- {
- return File.Open(path, mode);
- }
-
- public override Stream Open(string path, FileMode mode, FileAccess access)
- {
- return File.Open(path, mode, access);
- }
-
- public override Stream Open(string path, FileMode mode, FileAccess access, FileShare share)
- {
- return File.Open(path, mode, access, share);
- }
-
- public override Stream OpenRead(string path)
- {
- return File.OpenRead(path);
- }
-
- public override StreamReader OpenText(string path)
- {
- return File.OpenText(path);
- }
-
- public override Stream OpenWrite(string path)
- {
- return File.OpenWrite(path);
- }
-
- public override byte[] ReadAllBytes(string path)
- {
- return File.ReadAllBytes(path);
- }
-
- public override string[] ReadAllLines(string path)
- {
- return File.ReadAllLines(path);
- }
-
- public override string[] ReadAllLines(string path, Encoding encoding)
- {
- return File.ReadAllLines(path, encoding);
- }
-
- public override string ReadAllText(string path)
- {
- return File.ReadAllText(path);
- }
-
- public override string ReadAllText(string path, Encoding encoding)
- {
- return File.ReadAllText(path, encoding);
- }
-
- public override IEnumerable ReadLines(string path)
- {
- return File.ReadLines(path);
- }
-
- public override IEnumerable ReadLines(string path, Encoding encoding)
- {
- return File.ReadLines(path, encoding);
- }
-
- public override void Replace(string sourceFileName, string destinationFileName, string destinationBackupFileName)
- {
- File.Replace(sourceFileName, destinationFileName, destinationBackupFileName);
- }
-
- public override void Replace(string sourceFileName, string destinationFileName, string destinationBackupFileName, bool ignoreMetadataErrors)
- {
- File.Replace(sourceFileName, destinationFileName, destinationBackupFileName, ignoreMetadataErrors);
- }
-
- public override void SetAccessControl(string path, FileSecurity fileSecurity)
- {
- File.SetAccessControl(path, fileSecurity);
- }
-
- public override void SetAttributes(string path, FileAttributes fileAttributes)
- {
- File.SetAttributes(path, fileAttributes);
- }
-
- public override void SetCreationTime(string path, DateTime creationTime)
- {
- File.SetCreationTime(path, creationTime);
- }
-
- public override void SetCreationTimeUtc(string path, DateTime creationTimeUtc)
- {
- File.SetCreationTimeUtc(path, creationTimeUtc);
- }
-
- public override void SetLastAccessTime(string path, DateTime lastAccessTime)
- {
- File.SetLastAccessTime(path, lastAccessTime);
- }
-
- public override void SetLastAccessTimeUtc(string path, DateTime lastAccessTimeUtc)
- {
- File.SetLastAccessTimeUtc(path, lastAccessTimeUtc);
- }
-
- public override void SetLastWriteTime(string path, DateTime lastWriteTime)
- {
- File.SetLastWriteTime(path, lastWriteTime);
- }
-
- public override void SetLastWriteTimeUtc(string path, DateTime lastWriteTimeUtc)
- {
- File.SetLastWriteTimeUtc(path, lastWriteTimeUtc);
- }
-
- ///
- /// Creates a new file, writes the specified byte array to the file, and then closes the file.
- /// If the target file already exists, it is overwritten.
- ///
- /// The file to write to.
- /// The bytes to write to the file.
- /// is a zero-length string, contains only white space, or contains one or more invalid characters as defined by .
- /// is or contents is empty.
- ///
- /// The specified path, file name, or both exceed the system-defined maximum length.
- /// For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters.
- ///
- /// The specified path is invalid (for example, it is on an unmapped drive).
- /// An I/O error occurred while opening the file.
- ///
- /// path specified a file that is read-only.
- /// -or-
- /// This operation is not supported on the current platform.
- /// -or-
- /// path specified a directory.
- /// -or-
- /// The caller does not have the required permission.
- ///
- /// The file specified in was not found.
- /// is in an invalid format.
- /// The caller does not have the required permission.
- ///
- /// Given a byte array and a file path, this method opens the specified file, writes the contents of the byte array to the file, and then closes the file.
- ///
- public override void WriteAllBytes(string path, byte[] bytes)
- {
- File.WriteAllBytes(path, bytes);
- }
-
- ///
- /// Creates a new file, writes a collection of strings to the file, and then closes the file.
- ///
- /// The file to write to.
- /// The lines to write to the file.
- /// is a zero-length string, contains only white space, or contains one or more invalid characters as defined by .
- /// Either or is .
- /// The specified path is invalid (for example, it is on an unmapped drive).
- /// The file specified in was not found.
- /// An I/O error occurred while opening the file.
- ///
- /// The specified path, file name, or both exceed the system-defined maximum length.
- /// For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters.
- ///
- /// is in an invalid format.
- /// The caller does not have the required permission.
- ///
- /// specified a file that is read-only.
- /// -or-
- /// This operation is not supported on the current platform.
- /// -or-
- /// specified a directory.
- /// -or-
- /// The caller does not have the required permission.
- ///
- ///
- ///
- /// If the target file already exists, it is overwritten.
- ///
- ///
- /// You can use this method to create the contents for a collection class that takes an in its constructor, such as a , , or a class.
- ///
- ///
- public override void WriteAllLines(string path, IEnumerable contents)
- {
- File.WriteAllLines(path, contents);
- }
-
- ///
- /// Creates a new file by using the specified encoding, writes a collection of strings to the file, and then closes the file.
- ///
- /// The file to write to.
- /// The lines to write to the file.
- /// The character encoding to use.
- /// is a zero-length string, contains only white space, or contains one or more invalid characters as defined by .
- /// Either , , or is .
- /// The specified path is invalid (for example, it is on an unmapped drive).
- /// The file specified in was not found.
- /// An I/O error occurred while opening the file.
- ///
- /// The specified path, file name, or both exceed the system-defined maximum length.
- /// For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters.
- ///
- /// is in an invalid format.
- /// The caller does not have the required permission.
- ///
- /// specified a file that is read-only.
- /// -or-
- /// This operation is not supported on the current platform.
- /// -or-
- /// specified a directory.
- /// -or-
- /// The caller does not have the required permission.
- ///
- ///
- ///
- /// If the target file already exists, it is overwritten.
- ///
- ///
- /// You can use this method to create a file that contains the following:
- ///
- /// -
- /// The results of a LINQ to Objects query on the lines of a file, as obtained by using the ReadLines method.
- ///
- /// -
- /// The contents of a collection that implements an of strings.
- ///
- ///
- ///
- ///
- public override void WriteAllLines(string path, IEnumerable contents, Encoding encoding)
- {
- File.WriteAllLines(path, contents, encoding);
- }
-
- ///
- /// Creates a new file, writes the specified string array to the file by using the specified encoding, and then closes the file.
- ///
- /// The file to write to.
- /// The string array to write to the file.
- /// is a zero-length string, contains only white space, or contains one or more invalid characters as defined by .
- /// Either or is .
- ///
- /// The specified path, file name, or both exceed the system-defined maximum length.
- /// For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters.
- ///
- /// The specified path is invalid (for example, it is on an unmapped drive).
- /// An I/O error occurred while opening the file.
- ///
- /// specified a file that is read-only.
- /// -or-
- /// This operation is not supported on the current platform.
- /// -or-
- /// specified a directory.
- /// -or-
- /// The caller does not have the required permission.
- ///
- /// The file specified in was not found.
- /// is in an invalid format.
- /// The caller does not have the required permission.
- ///
- ///
- /// If the target file already exists, it is overwritten.
- ///
- ///
- /// The default behavior of the WriteAllLines method is to write out data using UTF-8 encoding without a byte order mark (BOM). If it is necessary to include a UTF-8 identifier, such as a byte order mark, at the beginning of a file, use the method overload with encoding.
- ///
- ///
- /// Given a string array and a file path, this method opens the specified file, writes the string array to the file using the specified encoding,
- /// and then closes the file.
- ///
- ///
- public override void WriteAllLines(string path, string[] contents)
- {
- File.WriteAllLines(path, contents);
- }
-
- ///
- /// Creates a new file, writes the specified string array to the file by using the specified encoding, and then closes the file.
- ///
- /// The file to write to.
- /// The string array to write to the file.
- /// An object that represents the character encoding applied to the string array.
- /// is a zero-length string, contains only white space, or contains one or more invalid characters as defined by .
- /// Either or is .
- ///
- /// The specified path, file name, or both exceed the system-defined maximum length.
- /// For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters.
- ///
- /// The specified path is invalid (for example, it is on an unmapped drive).
- /// An I/O error occurred while opening the file.
- ///
- /// specified a file that is read-only.
- /// -or-
- /// This operation is not supported on the current platform.
- /// -or-
- /// specified a directory.
- /// -or-
- /// The caller does not have the required permission.
- ///
- /// The file specified in was not found.
- /// is in an invalid format.
- /// The caller does not have the required permission.
- ///
- ///
- /// If the target file already exists, it is overwritten.
- ///
- ///
- /// Given a string array and a file path, this method opens the specified file, writes the string array to the file using the specified encoding,
- /// and then closes the file.
- ///
- ///
- public override void WriteAllLines(string path, string[] contents, Encoding encoding)
- {
- File.WriteAllLines(path, contents, encoding);
- }
-
- ///
- /// Creates a new file, writes the specified string to the file using the specified encoding, and then closes the file. If the target file already exists, it is overwritten.
- ///
- /// The file to write to.
- /// The string to write to the file.
- /// is a zero-length string, contains only white space, or contains one or more invalid characters as defined by .
- /// is or contents is empty.
- ///
- /// The specified path, file name, or both exceed the system-defined maximum length.
- /// For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters.
- ///
- /// The specified path is invalid (for example, it is on an unmapped drive).
- /// An I/O error occurred while opening the file.
- ///
- /// path specified a file that is read-only.
- /// -or-
- /// This operation is not supported on the current platform.
- /// -or-
- /// path specified a directory.
- /// -or-
- /// The caller does not have the required permission.
- ///
- /// The file specified in was not found.
- /// is in an invalid format.
- /// The caller does not have the required permission.
- ///
- /// This method uses UTF-8 encoding without a Byte-Order Mark (BOM), so using the method will return an empty byte array.
- /// If it is necessary to include a UTF-8 identifier, such as a byte order mark, at the beginning of a file, use the method overload with encoding.
- ///
- /// Given a string and a file path, this method opens the specified file, writes the string to the file, and then closes the file.
- ///
- ///
- public override void WriteAllText(string path, string contents)
- {
- File.WriteAllText(path, contents);
- }
-
- ///
- /// Creates a new file, writes the specified string to the file using the specified encoding, and then closes the file. If the target file already exists, it is overwritten.
- ///
- /// The file to write to.
- /// The string to write to the file.
- /// The encoding to apply to the string.
- /// is a zero-length string, contains only white space, or contains one or more invalid characters as defined by .
- /// is or contents is empty.
- ///
- /// The specified path, file name, or both exceed the system-defined maximum length.
- /// For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters.
- ///
- /// The specified path is invalid (for example, it is on an unmapped drive).
- /// An I/O error occurred while opening the file.
- ///
- /// path specified a file that is read-only.
- /// -or-
- /// This operation is not supported on the current platform.
- /// -or-
- /// path specified a directory.
- /// -or-
- /// The caller does not have the required permission.
- ///
- /// The file specified in was not found.
- /// is in an invalid format.
- /// The caller does not have the required permission.
- ///
- /// Given a string and a file path, this method opens the specified file, writes the string to the file using the specified encoding, and then closes the file.
- /// The file handle is guaranteed to be closed by this method, even if exceptions are raised.
- ///
- public override void WriteAllText(string path, string contents, Encoding encoding)
- {
- File.WriteAllText(path, contents, encoding);
- }
- }
-}
\ No newline at end of file
diff --git a/System.IO.Abstractions/IDirectoryInfoFactory.cs b/System.IO.Abstractions/IDirectoryInfoFactory.cs
deleted file mode 100644
index 9f6e9e32e..000000000
--- a/System.IO.Abstractions/IDirectoryInfoFactory.cs
+++ /dev/null
@@ -1,11 +0,0 @@
-namespace System.IO.Abstractions
-{
- public interface IDirectoryInfoFactory
- {
- ///
- /// Initializes a new instance of the class, which acts as a wrapper for a directory path.
- ///
- /// The fully qualified name of the new directory, or the relative directory name.
- DirectoryInfoBase FromDirectoryName(string directoryName);
- }
-}
\ No newline at end of file
diff --git a/System.IO.Abstractions/IDriveInfoFactory.cs b/System.IO.Abstractions/IDriveInfoFactory.cs
deleted file mode 100644
index cd3856af2..000000000
--- a/System.IO.Abstractions/IDriveInfoFactory.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-namespace System.IO.Abstractions
-{
- ///
- /// A factory to create all for a .
- ///
- public interface IDriveInfoFactory
- {
- ///
- /// Retrieves the drive names of all logical drives on a computer.
- ///
- /// An array of type that represents the logical drives on a computer.
- DriveInfoBase[] GetDrives();
- }
-}
diff --git a/System.IO.Abstractions/IFileInfoFactory.cs b/System.IO.Abstractions/IFileInfoFactory.cs
deleted file mode 100644
index aeeeded04..000000000
--- a/System.IO.Abstractions/IFileInfoFactory.cs
+++ /dev/null
@@ -1,11 +0,0 @@
-namespace System.IO.Abstractions
-{
- public interface IFileInfoFactory
- {
- ///
- /// Initializes a new instance of the class, which acts as a wrapper for a file path.
- ///
- /// The fully qualified name of the new file, or the relative file name.
- FileInfoBase FromFileName(string fileName);
- }
-}
\ No newline at end of file
diff --git a/System.IO.Abstractions/IFileSystem.cs b/System.IO.Abstractions/IFileSystem.cs
deleted file mode 100644
index 3d875e1cc..000000000
--- a/System.IO.Abstractions/IFileSystem.cs
+++ /dev/null
@@ -1,12 +0,0 @@
-namespace System.IO.Abstractions
-{
- public interface IFileSystem
- {
- FileBase File { get; }
- DirectoryBase Directory { get; }
- IFileInfoFactory FileInfo { get; }
- PathBase Path { get; }
- IDirectoryInfoFactory DirectoryInfo { get; }
- IDriveInfoFactory DriveInfo { get; }
- }
-}
\ No newline at end of file
diff --git a/System.IO.Abstractions/PathBase.cs b/System.IO.Abstractions/PathBase.cs
deleted file mode 100644
index 9ce7d54d7..000000000
--- a/System.IO.Abstractions/PathBase.cs
+++ /dev/null
@@ -1,32 +0,0 @@
-namespace System.IO.Abstractions
-{
- [Serializable]
- public abstract class PathBase
- {
- public abstract char AltDirectorySeparatorChar { get; }
- public abstract char DirectorySeparatorChar { get; }
- [Obsolete("Please use GetInvalidPathChars or GetInvalidFileNameChars instead.")]
- public abstract char[] InvalidPathChars { get; }
- public abstract char PathSeparator { get; }
- public abstract char VolumeSeparatorChar { get; }
-
- public abstract string ChangeExtension(string path, string extension);
- public abstract string Combine(params string[] paths);
- public abstract string Combine(string path1, string path2);
- public abstract string Combine(string path1, string path2, string path3);
- public abstract string Combine(string path1, string path2, string path3, string path4);
- public abstract string GetDirectoryName(string path);
- public abstract string GetExtension(string path);
- public abstract string GetFileName(string path);
- public abstract string GetFileNameWithoutExtension(string path);
- public abstract string GetFullPath(string path);
- public abstract char[] GetInvalidFileNameChars();
- public abstract char[] GetInvalidPathChars();
- public abstract string GetPathRoot(string path);
- public abstract string GetRandomFileName();
- public abstract string GetTempFileName();
- public abstract string GetTempPath();
- public abstract bool HasExtension(string path);
- public abstract bool IsPathRooted(string path);
- }
-}
\ No newline at end of file
diff --git a/System.IO.Abstractions/PathWrapper.cs b/System.IO.Abstractions/PathWrapper.cs
deleted file mode 100644
index ba36e9b27..000000000
--- a/System.IO.Abstractions/PathWrapper.cs
+++ /dev/null
@@ -1,122 +0,0 @@
-namespace System.IO.Abstractions
-{
- [Serializable]
- public class PathWrapper : PathBase
- {
- public override char AltDirectorySeparatorChar
- {
- get { return Path.AltDirectorySeparatorChar; }
- }
-
- public override char DirectorySeparatorChar
- {
- get { return Path.DirectorySeparatorChar; }
- }
-
- [Obsolete("Please use GetInvalidPathChars or GetInvalidFileNameChars instead.")]
- public override char[] InvalidPathChars
- {
- get { return Path.InvalidPathChars; }
- }
-
- public override char PathSeparator
- {
- get { return Path.PathSeparator; }
- }
-
- public override char VolumeSeparatorChar
- {
- get { return Path.VolumeSeparatorChar; }
- }
-
- public override string ChangeExtension(string path, string extension)
- {
- return Path.ChangeExtension(path, extension);
- }
-
- public override string Combine(params string[] paths)
- {
- return Path.Combine(paths);
- }
-
- public override string Combine(string path1, string path2)
- {
- return Path.Combine(path1, path2);
- }
-
- public override string Combine(string path1, string path2, string path3)
- {
- return Path.Combine(path1, path2, path3);
- }
-
- public override string Combine(string path1, string path2, string path3, string path4)
- {
- return Path.Combine(path1, path2, path3, path4);
- }
-
- public override string GetDirectoryName(string path)
- {
- return Path.GetDirectoryName(path);
- }
-
- public override string GetExtension(string path)
- {
- return Path.GetExtension(path);
- }
-
- public override string GetFileName(string path)
- {
- return Path.GetFileName(path);
- }
-
- public override string GetFileNameWithoutExtension(string path)
- {
- return Path.GetFileNameWithoutExtension(path);
- }
-
- public override string GetFullPath(string path)
- {
- return Path.GetFullPath(path);
- }
-
- public override char[] GetInvalidFileNameChars()
- {
- return Path.GetInvalidFileNameChars();
- }
-
- public override char[] GetInvalidPathChars()
- {
- return Path.GetInvalidPathChars();
- }
-
- public override string GetPathRoot(string path)
- {
- return Path.GetPathRoot(path);
- }
-
- public override string GetRandomFileName()
- {
- return Path.GetRandomFileName();
- }
-
- public override string GetTempFileName()
- {
- return Path.GetTempFileName();
- }
-
- public override string GetTempPath()
- {
- return Path.GetTempPath();
- }
-
- public override bool HasExtension(string path)
- {
- return Path.HasExtension(path);
- }
-
- public override bool IsPathRooted(string path)
- {
- return Path.IsPathRooted(path);
- }
- }
-}
diff --git a/System.IO.Abstractions/Properties/AssemblyInfo.cs b/System.IO.Abstractions/Properties/AssemblyInfo.cs
deleted file mode 100644
index d8418bd92..000000000
--- a/System.IO.Abstractions/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-using System;
-using System.Reflection;
-using System.Runtime.InteropServices;
-
-[assembly: AssemblyVersion("0.0.0.1")]
-[assembly: AssemblyFileVersion("0.0.0.1")]
-
-[assembly: AssemblyTitle("System.IO.Abstractions")]
-[assembly: AssemblyDescription("A set of abstractions to help make file system interactions testable.")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("System.IO.Abstractions")]
-[assembly: AssemblyCopyright("Copyright © Tatham Oddie 2010")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-[assembly: ComVisible(false)]
-
-[assembly: CLSCompliant(true)]
diff --git a/System.IO.Abstractions/System.IO.Abstractions.csproj b/System.IO.Abstractions/System.IO.Abstractions.csproj
deleted file mode 100644
index 730e3540b..000000000
--- a/System.IO.Abstractions/System.IO.Abstractions.csproj
+++ /dev/null
@@ -1,126 +0,0 @@
-
-
-
- Debug
- AnyCPU
- 9.0.30729
- 2.0
- {4D398F3A-0784-4401-93CD-46CD2FBD6B92}
- Library
- Properties
- System.IO.Abstractions
- System.IO.Abstractions
- v4.0
- 512
-
-
- 3.5
-
- publish\
- true
- Disk
- false
- Foreground
- 7
- Days
- false
- false
- true
- 0
- 1.0.0.%2a
- false
- false
- true
-
-
-
- true
- full
- false
- bin\Debug\
- DEBUG;TRACE
- prompt
- 4
- AllRules.ruleset
- false
- false
- 5
-
-
- pdbonly
- true
- bin\Release\
- TRACE
- prompt
- 4
- AllRules.ruleset
- true
- false
-
-
- ..\StrongName.pfx
-
-
-
-
- 3.5
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- False
- .NET Framework 3.5 SP1 Client Profile
- false
-
-
- False
- .NET Framework 3.5 SP1
- true
-
-
- False
- Windows Installer 3.1
- true
-
-
-
-
- Designer
-
-
-
-
-
\ No newline at end of file
diff --git a/System.IO.Abstractions/System.IO.Abstractions.ncrunchproject b/System.IO.Abstractions/System.IO.Abstractions.ncrunchproject
deleted file mode 100644
index 59d3df4c1..000000000
--- a/System.IO.Abstractions/System.IO.Abstractions.ncrunchproject
+++ /dev/null
@@ -1,20 +0,0 @@
-
- false
- false
- false
- true
- false
- false
- false
- false
- true
- true
- false
- true
- true
- 60000
-
-
-
- AutoDetect
-
\ No newline at end of file
diff --git a/System.IO.Abstractions/System.IO.Abstractions.nuspec b/System.IO.Abstractions/System.IO.Abstractions.nuspec
deleted file mode 100644
index 6fa1b73ad..000000000
--- a/System.IO.Abstractions/System.IO.Abstractions.nuspec
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
- System.IO.Abstractions
- $version$
- Tatham Oddie
- Tatham Oddie
- https://github.com/tathamoddie/System.IO.Abstractions/blob/master/License.txt
- https://github.com/tathamoddie/System.IO.Abstractions
- false
- Just like System.Web.Abstractions, but for System.IO. Yay for testable IO access! Be sure to check out the System.IO.Abstractions.TestingHelpers package too.
- testing
-
-
\ No newline at end of file
diff --git a/TestHelpers.Tests/FileSystemTests.cs b/TestHelpers.Tests/FileSystemTests.cs
deleted file mode 100644
index df6577ea8..000000000
--- a/TestHelpers.Tests/FileSystemTests.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-using NUnit.Framework;
-
-namespace System.IO.Abstractions.TestingHelpers.Tests
-{
- [TestFixture]
- public class FileSystemTests
- {
- [Test]
- public void Is_Serializable()
- {
- var fileSystem = new FileSystem();
- var memoryStream = new MemoryStream();
-
- var serializer = new Runtime.Serialization.Formatters.Binary.BinaryFormatter();
- serializer.Serialize(memoryStream, fileSystem);
-
- Assert.That(memoryStream.Length > 0, "Length didn't increase after serialization task.");
- }
- }
-}
diff --git a/TestHelpers.Tests/MockDirectoryArgumentPathTests.cs b/TestHelpers.Tests/MockDirectoryArgumentPathTests.cs
deleted file mode 100644
index 342338ed3..000000000
--- a/TestHelpers.Tests/MockDirectoryArgumentPathTests.cs
+++ /dev/null
@@ -1,40 +0,0 @@
-using System.Collections.Generic;
-using System.Security.AccessControl;
-using NUnit.Framework;
-
-namespace System.IO.Abstractions.TestingHelpers.Tests
-{
- public class MockDirectoryArgumentPathTests
- {
- private static IEnumerable> GetFileSystemActionsForArgumentNullException()
- {
- yield return ds => ds.Delete(null);
- yield return ds => ds.Delete(null, true);
- yield return ds => ds.CreateDirectory(null);
- yield return ds => ds.CreateDirectory(null, new DirectorySecurity());
- yield return ds => ds.SetCreationTime(null, DateTime.Now);
- yield return ds => ds.SetCreationTimeUtc(null, DateTime.Now);
- yield return ds => ds.SetLastAccessTime(null, DateTime.Now);
- yield return ds => ds.SetLastAccessTimeUtc(null, DateTime.Now);
- yield return ds => ds.SetLastWriteTime(null, DateTime.Now);
- yield return ds => ds.SetLastWriteTimeUtc(null, DateTime.Now);
- yield return ds => ds.EnumerateDirectories(null);
- yield return ds => ds.EnumerateDirectories(null, "foo");
- yield return ds => ds.EnumerateDirectories(null, "foo", SearchOption.AllDirectories);
- }
-
- [TestCaseSource("GetFileSystemActionsForArgumentNullException")]
- public void Operations_ShouldThrowArgumentNullExceptionIfPathIsNull(Action action)
- {
- // Arrange
- var fileSystem = new MockFileSystem();
-
- // Act
- TestDelegate wrapped = () => action(fileSystem.Directory);
-
- // Assert
- var exception = Assert.Throws(wrapped);
- Assert.AreEqual("path", exception.ParamName);
- }
- }
-}
diff --git a/TestHelpers.Tests/MockDirectoryInfoTests.cs b/TestHelpers.Tests/MockDirectoryInfoTests.cs
deleted file mode 100644
index 92cbbb5d5..000000000
--- a/TestHelpers.Tests/MockDirectoryInfoTests.cs
+++ /dev/null
@@ -1,284 +0,0 @@
-using System.Collections.Generic;
-using System.Linq;
-using NUnit.Framework;
-
-namespace System.IO.Abstractions.TestingHelpers.Tests
-{
- using XFS = MockUnixSupport;
-
- [TestFixture]
- public class MockDirectoryInfoTests
- {
- public static IEnumerable