| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Test filesystem code without touching the real disk — fast, deterministic, and disposable.
When writing .NET applications, you often need to read or write files. The standard System.IO namespace handles this well at runtime, but testing becomes painful. Unit tests that depend on the real filesystem are slow, brittle, leave temp files behind, and break in CI when paths differ across machines. Mocking System.IO is verbose and error-prone — you end up testing mock wiring instead of actual logic.
Virtual File System provides a complete in-memory filesystem that's fast, deterministic, and disposable. Create files and directories, read and write content, subscribe to change events, and even undo/redo operations — all without touching the real disk.
// Create a virtual file system and add some files
IVirtualFileSystem vfs = new VFS()
.CreateFile("src/Program.cs", "Console.WriteLine(\"Hello!\");")
.CreateFile("src/Utils.cs")
.CreateFile("tests/ProgramTests.cs");
// Print the tree
Console.WriteLine(vfs.GetTree());
// vfs://
// ├── src
// │ ├── Program.cs
// │ └── Utils.cs
// └── tests
// └── ProgramTests.cs| Layer | Technology |
|---|---|
| Language | C# 13 |
| Runtime | .NET 9.0 / .NET 10.0 |
| UI (Demo) | Blazor Server + Tailwind CSS |
| GitHub Integration | Octokit 14.x |
| DI | Microsoft.Extensions.DependencyInjection |
| CLI (Demo) | Spectre.Console |
| Testing | xUnit |
| Build | dotnet CLI / Nuke |
Option 1 — NuGet (recommended)
dotnet add package Atypical.VirtualFileSystemOr add a package reference to your project file:
<PackageReference Include="Atypical.VirtualFileSystem" Version="0.5.0" />Option 2 — From Source
git clone https://github.com/Atypical-Consulting/VirtualFileSystem.git
cd VirtualFileSystem
dotnet build// Create a virtual file system and populate it
IVirtualFileSystem vfs = new VFS()
.CreateFile("superheroes/batman.txt")
.CreateFile("superheroes/superman.txt")
.CreateFile("superheroes/wonderwoman.txt")
.CreateFile("villains/joker.txt")
.CreateFile("villains/lexluthor.txt")
.CreateFile("villains/penguin.txt")
.CreateFile("world/gotham.txt")
.CreateFile("world/metropolis.txt")
.CreateFile("world/themyscira.txt");
// Get the string representation of the virtual file system
string tree = vfs.GetTree();Expected output:
vfs://
├── superheroes
│ ├── batman.txt
│ ├── superman.txt
│ └── wonderwoman.txt
├── villains
│ ├── joker.txt
│ ├── lexluthor.txt
│ └── penguin.txt
└── world
├── gotham.txt
├── metropolis.txt
└── themyscira.txt
The library includes comprehensive demo applications that showcase its capabilities.
A full-featured web application built with Blazor Server and Tailwind CSS providing an interactive demonstration of all VFS features.
cd src/Atypical.VirtualFileSystem.DemoBlazorApp
dotnet run
# Open your browser to https://localhost:5040Demo features: Dashboard with file system overview, file operations with real-time feedback, advanced multi-criteria search, full-featured file editor, analytics and insights, undo/redo history management, real-time event monitoring, and responsive design.
A command-line demonstration showcasing basic VFS operations:
cd src/Atypical.VirtualFileSystem.DemoCli
dotnet run┌─────────────────────────────────────────────────────┐
│ Consumer Code │
│ (Your app / tests / demos) │
└──────────────────────┬──────────────────────────────┘
│
┌─────────────▼─────────────┐
│ IVirtualFileSystem │
│ (Core Interface) │
└─────────────┬─────────────┘
│
┌─────────────▼─────────────┐
│ VFS (Implementation) │
│ │
│ ┌─────────────────────┐ │
│ │ VirtualDirectory │ │
│ │ VirtualFile │ │
│ │ (Node Tree) │ │
│ └─────────────────────┘ │
│ │
│ ┌─────────────────────┐ │
│ │ UndoRedo Manager │ │
│ │ (Change History) │ │
│ └─────────────────────┘ │
│ │
│ ┌─────────────────────┐ │
│ │ Event System │ │
│ │ (Change Notifications)│
│ └─────────────────────┘ │
└─────────────┬─────────────┘
│
┌──────────────────▼──────────────────┐
│ Extensions │
│ ┌──────────────────────────────┐ │
│ │ VirtualFileSystem.GitHub │ │
│ │ (Load repos into VFS) │ │
│ └──────────────────────────────┘ │
└─────────────────────────────────────┘
VirtualFileSystem/ ├── src/ │ ├── Atypical.VirtualFileSystem.Core/ # Core library (IVirtualFileSystem, VFS, models) │ │ ├── Contracts/ # Interfaces and abstractions │ │ ├── Models/ # VirtualFile, VirtualDirectory, paths │ │ ├── Services/ # Search, analytics services │ │ ├── SystemOperations/ # File system operations │ │ ├── UndoRedo/ # Undo/redo infrastructure │ │ └── Extensions/ # Extension methods │ ├── Atypical.VirtualFileSystem.GitHub/ # GitHub repo loader extension │ ├── Atypical.VirtualFileSystem.DemoBlazorApp/ # Blazor Server demo │ └── Atypical.VirtualFileSystem.DemoCli/ # Console demo ├── tests/ │ ├── Atypical.VirtualFileSystem.UnitTests/ # Unit tests │ ├── Atypical.VirtualFileSystem.GitHub.Tests/ # GitHub extension tests │ └── Atypical.VirtualFileSystem.Benchmarks/ # Performance benchmarks ├── docs/ # Auto-generated API documentation ├── build/ # Build scripts └── .github/workflows/ # CI/CD pipelines
Virtual File System provides complete API documentation generated automatically using DefaultDocumentation.
Want to contribute? Pick any roadmap item and open a PR!
Contributions are welcome! Please read CONTRIBUTING.md first.
BSD-3-Clause © 2022-2025 Atypical Consulting
Built with care by Atypical Consulting — opinionated, production-grade open source.
| Back | FazBrowse Home | New Git URL |