This repository contains the Fluent Assertions extensions for Autofac. It is maintained by @mkoertgen.
- See www.fluentassertions.com for more information about the main library.
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.
Install the NuGet 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.
Clone and build using Rider, Code, Visual Studio, ... or the command line using nuke.build.