Fluent Assertions extensions for Autofac
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
FluentAssertions.Autofac.Dotnet
FluentAssertions.Autofac.Net45
FluentAssertions.Autofac.NuGet
SampleLib
Shared
docs
.editorconfig
.gitattributes
.gitignore
CONTRIBUTING.md
FluentAssertions.Autofac.sln
FluentAssertions.Autofac.v2.ncrunchsolution
FluentAssertions.Autofac.v3.ncrunchsolution
GitVersion.yml
LICENSE
README.md
SolutionInfo.cs
appveyor.yml
before.FluentAssertions.Autofac.sln.targets
build.bat
empty.targets
mkdocs.yml
solution.targets

README.md

FluentAssertions.AutoFac

Build status NuGet NuGet Coverage Status Documentation Status

This repository contains the Fluent Assertions extensions for AutoFac. It is maintained by @mkoertgen.

Why?

In general, the more you apply Dependency Injection (DI) the easier becomes unit testing and Test-driven Development (TDD).

This is because the complexity of constructing all dependencies is shifted to the so called Composition Root, i.e. the place where you "wire up" and configure all your dependencies. Undoubtedly, the best way to do this is by using some Inversion of Control (IoC) container.

With an application growing in complexity, there is also growing need to organize and test the IoC configuration.

Quickstart

Usage

Install the NuGet package

PM> Install-Package FluentAssertions.AutoFac

and start writing tests for your AutoFac configuration.

container.Should().Have().Registered<SuperCoolService>()
    .AsSelf()
    .As<ICoolService>()
    .Singleton();

Find more examples in the documentation or the tests.

How to build

Clone and build using Visual Studio or the command line using OneClickBuild

git clone https://github.com/fluentassertions/fluentassertions.autofac.git
cd fluentassertions.autofac
build

Links