Exemplo n.º 1
0
        public void RubyConditionalRegistration()
        {
            locator.Register(Install.From("Installers\\ConditionalRegistrationTest.rb"));


            Assert.IsInstanceOf <TestCase2>(locator.GetInstance <ITestInterface>(new ContextArgument(new TestClasses.TestContext(TestEnum.Case2))));
        }
Exemplo n.º 2
0
        public void RubyIConditionRegistration()
        {
            locator.Register(Install.From("Installers\\ConditionalGenericRegistrationTest.rb"));

            locator.AddContext(CreateContext(TestEnum.Case2));

            Assert.IsInstanceOf <TestCase2>(locator.GetInstance <ITestInterface>());
        }
Exemplo n.º 3
0
        public void RubyDefaultInstanceRegistration()
        {
            locator.Register(Install.From("Installers\\DefaultInstanceRegistrationTest.rb"));

            var instance = locator.GetInstance <ITestInterface>();

            Assert.IsInstanceOf <TestCase1>(instance);
        }
Exemplo n.º 4
0
        public void RubySingletonRegistration()
        {
            locator.Register(Install.From("Installers\\SingletonRegistrationTest.rb"));

            var instance  = locator.GetInstance <ITestInterface>();
            var instance2 = locator.GetInstance <ITestInterface>();

            Assert.IsInstanceOf <TestCase1>(instance);
            Assert.AreSame(instance, instance2);
        }
Exemplo n.º 5
0
        public void RubyNamedInstanceRegistration()
        {
            locator.Register(Install.From("Installers\\NamedInstanceRegistrationTest.rb"));

            var instance = locator.GetInstance <ITestInterface>("Test");

            Assert.IsInstanceOf <TestCase2>(instance);

            instance = locator.GetInstance <ITestInterface>("Test1");

            Assert.IsInstanceOf <TestCase1>(instance);
        }
Exemplo n.º 6
0
        public void RubyConventionInstanceRegistration()
        {
            locator.Register(Install.From("Installers\\ConventionInstanceRegistrationTest.rb"));

            Assert.IsInstanceOf <AutoScannedType>(locator.GetInstance <IAutoScannedInterface>());
        }