Skip to content

An example of how IoC configuration can be tested.

Notifications You must be signed in to change notification settings

gerrited/IocTests

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

IocTests

.NET

Hey, how do you test your IoC config? You don't? Maybe you can use this solution as inspiration or template.

Find out more in my german blog article "Unit-Tests für IoC Container"

Overview

class diagram

When the program (see Program.cs) starts, the interface ITextWriter is resolved. The registered implementation ConsoleTextWriter with all its dependencies (in this case ITextGenerator) must be registered in the IoC container. You can find the IoC configuration in the file IocConfig.cs.

Build, run, and test

Prerequisites: .NET 6

You can easily build and test the solution with dotnet test.

About

An example of how IoC configuration can be tested.

Resources

Stars

Watchers

Forks

Languages