Example #1
0
        public static void TestSet17_Method5()
        {
            //TestSet7
            var container = new Container();

            container.RegisterType <Type>();
            var typeActivator = new TypeActivator();
            var runtimeType   = new RuntimeType(typeActivator, new InjectionAttribute("Build.Tests.TestSet17.Type"), typeof(Type), true);

            runtimeType.SetRuntimeInstance(RuntimeInstance.CreateInstance);
            runtimeType.AddConstructorParameter(((TypeBuilder)container.Builder).CanRegister(runtimeType.ActivatorType), new RuntimeType(typeActivator, new InjectionAttribute(typeof(Type)), typeof(Type), true));
            Assert.Throws <TypeInstantiationException>(() => runtimeType.CreateInstance((string[])null));
        }