示例#1
0
        private ParameterInfo param(string name)
        {
            var ctor = new Constructor(typeof (LotsOfStuff));
            foreach (ParameterInfo parameterInfo in ctor.Ctor.GetParameters())
            {
                if (parameterInfo.Name == name)
                {
                    return parameterInfo;
                }
            }

            throw new NotImplementedException();
        }
示例#2
0
        public void GetGreediestConstructor()
        {
            var ctor = new Constructor(typeof (GreaterThanRule));
            ConstructorInfo constructor = ctor.Ctor;

            Assert.IsNotNull(constructor);
            Assert.AreEqual(2, constructor.GetParameters().Length, "Should have 2 inputs");
        }
示例#3
0
        public void GetFirstMarkedConstructor()
        {
            var ctor = new Constructor(typeof (ComplexRule));
            ConstructorInfo constructor = ctor.Ctor;

            Assert.IsNotNull(constructor);
            Assert.AreEqual(7, constructor.GetParameters().Length, "Should have 7 inputs, not 8");
        }
示例#4
0
 public void CanBeAutoFilled_with_child_array_in_ctor()
 {
     var ctor = new Constructor(typeof (CanBeAutoFilledWithArray));
     Assert.IsTrue(ctor.CanBeAutoFilled());
 }
示例#5
0
 public bool CanBeCreated()
 {
     return(Constructor.HasConstructors(_pluggedType));
 }
示例#6
0
 public Plugin(Type pluggedType)
 {
     _pluggedType = pluggedType;
     _setters     = new SetterPropertyCollection(this);
     _constructor = new Constructor(pluggedType);
 }