Exemplo n.º 1
0
        public ConstructorInjectionDirectiveBenchmark()
        {
            _zeroArgumentConstructor = typeof(NinjaBarracks).GetConstructor(new Type[0]);
            _twoArgumentConstructor  = typeof(NinjaBarracks).GetConstructor(new[] { typeof(IWarrior), typeof(IWeapon) });

            var injectorFactory = new ExpressionInjectorFactory();

            _zeroArgumentIinjector = injectorFactory.Create(_zeroArgumentConstructor);
            _twoArgumentIinjector  = injectorFactory.Create(_twoArgumentConstructor);
        }
        public ExpressionInjectorFactoryBenchmark()
        {
            _injectorFactory = new ExpressionInjectorFactory();

            _constructorWarriorAndWeapon = typeof(NinjaBarracks).GetConstructor(new[] { typeof(IWarrior), typeof(IWeapon) });
            _argumentsWarriorAndWeapon   = new object[] { new FootSoldier(), new Sword() };
            _injector = _injectorFactory.Create(_constructorWarriorAndWeapon);
        }
 public void Create_ConstructorInfo()
 {
     _injectorFactory.Create(_constructorWarriorAndWeapon);
 }