---
title: "File System Wrappers for Unit Testing in C#"
url: "https://osherove.com/blog/2012/5/16/file-system-wrappers-for-unit-testing-in-c.md"
canonical: "https://osherove.com/blog/2012/5/16/file-system-wrappers-for-unit-testing-in-c.html"
published: "2012-05-16T12:29:18"
updated: "2012-05-16T12:29:18"
tags: ["Unit Testing"]
author: "Roy Osherove"
description: "I’ve asked this on twitter, and here’s what I got: System.IO.Abstractions (looks pretty deep) SystemWrapper (I’m not crazy about the file system being used as a mock API) Something older I’d take a look at the first on…"
usage: "Licensed under CC BY 4.0 — reuse, quote and adapt with attribution (Roy Osherove, link to the original page)."
license: "https://creativecommons.org/licenses/by/4.0/"
---

# File System Wrappers for Unit Testing in C\#

By Roy Osherove May 16, 2012 In [Unit Testing](https://osherove.com/blog/category/unit-testing)

**Historical article** · Originally published May 16, 2012; technical details may be outdated.

I’ve asked this on twitter, and here’s what I got:

- [System.IO.Abstractions](https://github.com/tathamoddie/System.IO.Abstractions) (looks pretty deep)
- [SystemWrapper](http://systemwrapper.codeplex.com/) (I’m not crazy about the file system being used as a mock API)
- [Something older](http://bugsquash.blogspot.de/2008/03/injectable-file-adapters.html)

I’d take a look at the first on the list first, if only for it being on github as a sign of advancement.

## More in Unit Testing

[All posts in Unit Testing](https://osherove.com/blog/category/unit-testing)

- Jun 26, 2012

    ### [FakeItEasy or NSubstitute? Which should I use for samples in art of unit testing 2nd edition?](https://osherove.com/blog/2012/6/26/fakeiteasy-or-nsubstitute-which-should-i-use-for-samples-in.html)

- Jun 24, 2012

    ### [Video: (part 1) Building a Go Game Engine with TDD and Pair Programming](https://osherove.com/blog/2012/6/25/video-part-1-building-a-go-game-engine-with-tdd-and-pair-pro.html)

- May 16, 2012

    ### [Test Driven Validation Logic with Extract & Override](https://osherove.com/blog/2012/5/16/test-driven-validation-logic-with-extract-override.html)

- May 15, 2012

    ### [Test Naming Conventions With Unit of Work](https://osherove.com/blog/2012/5/15/test-naming-conventions-with-unit-of-work.html)


---

## About the author

**Roy Osherove**: Senior Solutions Architect at AWS working on AI for production and AI-driven development; author of The Art of Unit Testing and Elastic Leadership, with about 20 years of consulting and training on unit testing, TDD, team leadership and continuous delivery.

### Sites

- [RobotPaper](https://robotpaper.ai/): This blog: AI patterns and anti-patterns, AI and coding agents, and engineering leadership.
- [osherove.com](https://osherove.com): Roy's personal site. Author of The Art of Unit Testing and Elastic Leadership; consulting and training on unit testing, TDD, team leadership and continuous delivery, plus about 20 years of blog posts.
- [The Art of Unit Testing](https://www.artofunittesting.com): The Art of Unit Testing, 3rd Edition (Manning): readable, maintainable, trustworthy unit tests, plus TDD workshops in C#, JavaScript, Java and Kotlin.
- [5whys.com](https://www.5whys.com): Roy's writing on software team leadership: self-organizing teams, surviving chaos, learning mode and the Elastic Leadership model.
- [Pipeline Driven](https://pipelinedriven.org): Continuous delivery and DevOps practices: build patterns, pipeline-friendly testing, DevOps metrics and enterprise DevOps.
- [Elastic Leadership](https://www.elasticleadership.com): Elastic Leadership, Roy's framework for software team leaders (survival, learning and self-organizing modes).

### Social

- X: https://x.com/royosherove
- LinkedIn: https://www.linkedin.com/in/osherove/

### Contact

- Contact form: https://forms.gle/jQSx5KoXvrVA1JCK7

### License

Licensed under CC BY 4.0 — reuse, quote and adapt with attribution (Roy Osherove, link to the original page). License: https://creativecommons.org/licenses/by/4.0/
