public void RubyConditionalRegistration() { locator.Register(Install.From("Installers\\ConditionalRegistrationTest.rb")); Assert.IsInstanceOf <TestCase2>(locator.GetInstance <ITestInterface>(new ContextArgument(new TestClasses.TestContext(TestEnum.Case2)))); }
public void RubyIConditionRegistration() { locator.Register(Install.From("Installers\\ConditionalGenericRegistrationTest.rb")); locator.AddContext(CreateContext(TestEnum.Case2)); Assert.IsInstanceOf <TestCase2>(locator.GetInstance <ITestInterface>()); }
public void RubyDefaultInstanceRegistration() { locator.Register(Install.From("Installers\\DefaultInstanceRegistrationTest.rb")); var instance = locator.GetInstance <ITestInterface>(); Assert.IsInstanceOf <TestCase1>(instance); }
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); }
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); }
public void RubyConventionInstanceRegistration() { locator.Register(Install.From("Installers\\ConventionInstanceRegistrationTest.rb")); Assert.IsInstanceOf <AutoScannedType>(locator.GetInstance <IAutoScannedInterface>()); }