public void Instance_Registration_Returns_Given_Instance_Every_Resolve() { var target = new Container(); var instance = new SimpleTestService(); target.RegisterInstance <ISimpleTestService>("Name", instance); var resolvedFirst = target.Resolve <ISimpleTestService>("Name"); var resolvedSecond = target.Resolve <ISimpleTestService>("Name"); Assert.AreSame(instance, resolvedFirst); Assert.AreSame(instance, resolvedSecond); }
public void Instance_Registration_Returns_Given_Instance_Every_Resolve() { var target = new Container(); var instance = new SimpleTestService(); target.RegisterInstance<ISimpleTestService>("Name", instance); var resolvedFirst = target.Resolve<ISimpleTestService>("Name"); var resolvedSecond = target.Resolve<ISimpleTestService>("Name"); Assert.AreSame(instance, resolvedFirst); Assert.AreSame(instance, resolvedSecond); }