explaingit

autofac/autofac.extras.fakeiteasy

Analysis updated 2026-07-15 · repo last pushed 2026-07-09

8C#Audience · developerComplexity · 2/5ActiveSetup · easy

TLDR

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.

Mindmap

mindmap
  root((repo))
    What it does
      Creates fake objects
      Fills dependencies automatically
      Allows custom configuration
    Tech stack
      C-Sharp language
      Autofac container
      FakeItEasy library
    Use cases
      Unit test setup
      Test complex services
      Verify interactions
    Audience
      C-Sharp developers
      Test writers
      Engineers using Autofac
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Automatically generate fake dependencies when unit testing a C# service that uses Autofac.

USE CASE 2

Instantly create fakes for multiple dependencies like databases or APIs to focus on testing one component's logic.

USE CASE 3

Configure specific behaviors on generated fakes and verify your component interacted with them correctly.

USE CASE 4

Provide a real dependency for a specific test while keeping all other dependencies as automatic fakes.

What is it built with?

C#AutofacFakeItEasy.NET

How does it compare?

autofac/autofac.extras.fakeiteasyd2phap/happlaboxautofac/autofac.extras.nhibernate
Stars876
LanguageC#C#C#
Last pushed2026-07-092023-03-142026-05-20
MaintenanceActiveDormantMaintained
Setup difficultyeasyeasymoderate
Complexity2/52/52/5
Audiencedevelopergeneraldeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 5min

Requires an existing C# project that already uses Autofac and FakeItEasy packages.

In plain English

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.

Copy-paste prompts

Prompt 1
Show me how to use Autofac.Extras.FakeItEasy to create an AutoFake container that automatically resolves fakes for an order processor with payment gateway, inventory, and email dependencies in a C# unit test.
Prompt 2
Write a C# unit test using AutoFake where I provide a real dependency instance but let the rest be auto-faked, then verify a method was called on one of the fakes.
Prompt 3
Generate an example of using Autofac.Extras.FakeItEasy to configure a fake dependency to return a specific value when resolved in a unit test.

Frequently asked questions

What is autofac.extras.fakeiteasy?

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.

What language is autofac.extras.fakeiteasy written in?

Mainly C#. The stack also includes C#, Autofac, FakeItEasy.

Is autofac.extras.fakeiteasy actively maintained?

Active — commit in last 30 days (last push 2026-07-09).

How hard is autofac.extras.fakeiteasy to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is autofac.extras.fakeiteasy for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.