public void throw_exception_when_passing_wrong_qualified_name() { var container = new WindsorContainer(); var bytecode = new EnhancedBytecode(container); const string qualifiedName = "kkdlkdsa"; new Action(() => bytecode.SetProxyFactoryFactory(qualifiedName)) .Should().Throw <TypeLoadException>(); }
public void can_inject_through_fully_qualified_name() { var container = new WindsorContainer(); var bytecode = new EnhancedBytecode(container); Type proxyFactory = typeof(ProxyFactoryFactory2); bytecode.SetProxyFactoryFactory(proxyFactory.AssemblyQualifiedName); bytecode.ProxyFactoryFactory.GetType() .Should().Be.EqualTo(proxyFactory); }
public void can_inject_and_resolve_from_container() { var container = new WindsorContainer(); var bytecode = new EnhancedBytecode(container); Type proxyFactoryType = typeof(ProxyFactoryFactory2); var proxyFactory = new ProxyFactoryFactory2(); container.Register(Component.For <ProxyFactoryFactory2>() .Instance(proxyFactory)); bytecode.SetProxyFactoryFactory(proxyFactoryType.AssemblyQualifiedName); bytecode.ProxyFactoryFactory .Should().Be.SameInstanceAs(proxyFactory); }