Inheritance: ISimpleTestService
Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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);
        }