namespace IoC.Tests.UsageScenarios { using Shouldly; using Xunit; public class ConstructorChoice { [Fact] public void Run() { // $visible=true // $tag=5 Advanced // $priority=04 // $description=Constructor choice // $header=We can specify a constructor manually and all its arguments. // { using var container = Container .Create() .Bind().To() .Bind().To( // Select the constructor and inject required dependencies ctx => new Service(ctx.Container.Inject(), "some state")) .Container; var instance = container.Resolve(); // } // Check the type instance.ShouldBeOfType(); // { // Check the injected constant instance.State.ShouldBe("some state"); // } } } }