autofac/autofac.extras.fakeiteasy — explained in plain English
Analysis updated 2026-07-15 · repo last pushed 2026-07-09
Automatically generate fake dependencies when unit testing a C# service that uses Autofac.
Instantly create fakes for multiple dependencies like databases or APIs to focus on testing one component's logic.
Configure specific behaviors on generated fakes and verify your component interacted with them correctly.
Provide a real dependency for a specific test while keeping all other dependencies as automatic fakes.
| autofac/autofac.extras.fakeiteasy | d2phap/happlabox | autofac/autofac.extras.nhibernate | |
|---|---|---|---|
| Stars | 8 | 7 | 6 |
| Language | C# | C# | C# |
| Last pushed | 2026-07-09 | 2023-03-14 | 2026-05-20 |
| Maintenance | Active | Dormant | Maintained |
| Setup difficulty | easy | easy | moderate |
| Complexity | 2/5 | 2/5 | 2/5 |
| Audience | developer | general | developer |
Figures from each repo's GitHub metadata at analysis time.
Requires an existing C# project that already uses Autofac and FakeItEasy packages.
When you're writing automated tests for a piece of software, you often need to test one component that depends on several others. Instead of connecting to real databases or live services during tests, developers create "fakes", stand-in objects that mimic the real ones. This project, Autofac.Extras.FakeItEasy, automates the process of creating those fakes for C# developers using Autofac, a tool that manages how different parts of an application are wired together. Normally, setting up a test means manually creating a fake object for every single dependency your component needs. This library does that work for you. You create a single "AutoFake" helper, and when you ask it for the component you want to test, it automatically fills in all the required dependencies with fakes. You can then configure specific behaviors on those fakes, like telling a fake data source to return a specific value, and verify that your component interacted with them correctly. If you need a real dependency instead of a fake for a specific test, you can provide your own. This is designed for C# developers who use Autofac to manage their application's components and FakeItEasy to create test doubles. A typical user is an engineer writing unit tests for a complex service like an order processor. If the processor depends on a payment gateway, an inventory database, and an email notification service, the developer can use this library to instantly generate fakes for all three, letting them focus purely on testing the processor's logic without setting up extensive test infrastructure. A notable design choice in recent versions is how the library handles dependency registration. In earlier versions, a method called Provide was used to inject specific dependencies, but it created isolated scopes. This caused a subtle bug where a developer might configure a fake object, only for that configuration to silently disappear because the actual injected dependency was a different instance. The project now requires all dependencies to be registered upfront in a single step, ensuring the objects you configure are always the ones that get injected.
A C# library that automatically creates fake dependencies for unit testing. It works with Autofac and FakeItEasy so developers can test components without manually setting up each fake object.
Mainly C#. The stack also includes C#, Autofac, FakeItEasy.
Active — commit in last 30 days (last push 2026-07-09).
Setup difficulty is rated easy, with roughly 5min to a first successful run.
Mainly developer.
This repo across BitVibe Labs
Verify against the repo before relying on details.