public void Container_Instance_ShouldNotChange() { IInterface_1 instance = new Implementation_1_No_Dep(); Container.Instance(instance); Assert.AreSame(instance, Container.CreateChild().Get <IInterface_1>(QueryModes.ThrowOnError).Instances.Single().Value); }
public void Injector_Instantiate_ShouldAcceptExplicitArguments() { var dep = new Implementation_1_No_Dep(); using (IInjector injector = Container.CreateInjector()) { Implementation_2_IInterface_1_Dependant obj = injector.Instantiate <Implementation_2_IInterface_1_Dependant>(new Dictionary <string, object> { { "interface1", dep } }); Assert.That(obj.Interface1, Is.SameAs(dep)); } }