public void TestRecursiveResolutionWhenEnabledOkForAcyclicDependencies() { var ioc = new IocContainer(allowRecursiveResolution: true); ioc.Bind <IServiceLocator>(() => ioc); ioc.Bind <IExampleA, RecursiveNonCyclicA>(); ioc.Bind <IExampleB, RecursiveNonCyclicB>(); IExampleB resolved = ioc.Resolve <IExampleB>(); Assert.IsInstanceOfType(resolved, typeof(RecursiveNonCyclicB)); }
public ExampleA(IServiceLocator ioc) { b = ioc.GetInstance <IExampleB>(); }