Beispiel #1
0
 /// <summary>
 ///
 /// </summary>
 public void Ninject()
 {
     var ninjectLoader     = new ModuleLoader(null);
     var resolver          = new StandardBindingResolver();
     var bindingResolver   = new OpenGenericBindingResolver();
     var cache             = new Cache(null, null);
     var pipeline          = new Pipeline(null, null);
     var activationCache   = new ActivationCache(null);
     var gccp              = new GarbageCollectionCachePruner();
     var acs               = new ActivationCacheStrategy(null);
     var pis               = new PropertyInjectionStrategy(null);
     var rif               = new ReflectionInjectorFactory();
     var mis               = new MethodInjectionStrategy();
     var initStrategy      = new InitializableStrategy();
     var startableStrategy = new StartableStrategy();
     var bas               = new BindingActionStrategy();
     var ds                        = new DisposableStrategy();
     var planner                   = new Planner(null);
     var crs                       = new ConstructorReflectionStrategy(null, null);
     var selector                  = new Selector(null, null);
     var scs                       = new StandardConstructorScorer();
     var sih                       = new StandardInjectionHeuristic();
     var prs                       = new PropertyReflectionStrategy(null, null);
     var mrs                       = new MethodReflectionStrategy(null, null);
     var dvbr                      = new DefaultValueBindingResolver();
     var selfBindingResolver       = new SelfBindingResolver(null);
     var bindingPrecedenceComparer = new BindingPrecedenceComparer();
 }
        public void NoDecoratedProperties()
        {
            MockBuilderContext context = new MockBuilderContext();
            PropertyReflectionStrategy <DependencyAttribute> strategy =
                new PropertyReflectionStrategy <DependencyAttribute>();

            context.Strategies.Add(strategy);

            context.ExecuteBuildUp(typeof(object), null);

            IPropertySetterPolicy policy = context.Policies.Get <IPropertySetterPolicy>(typeof(object));

            Assert.IsNull(policy);
        }
        public void DecoratedProperty()
        {
            MockBuilderContext context = new MockBuilderContext();
            PropertyReflectionStrategy <DependencyAttribute> strategy =
                new PropertyReflectionStrategy <DependencyAttribute>();

            context.Strategies.Add(strategy);

            context.ExecuteBuildUp(typeof(Decorated), null);

            IPropertySetterPolicy policy = context.Policies.Get <IPropertySetterPolicy>(typeof(Decorated));

            Assert.IsNotNull(policy);
            AssertHelper.NotEmpty(policy.Properties);
            foreach (ReflectionPropertySetterInfo property in policy.Properties)
            {
                Assert.AreEqual(typeof(Decorated).GetProperty("Property"), property.Property);
            }
        }