public static ReflectedPropertyTreeFactoryDefinition FromListAddMethod(MethodInfo method, bool naturalName = false)
 {
     if (naturalName)
     {
         if (string.IsNullOrEmpty(AddAttribute.GetNaturalName(method.DeclaringType)))
         {
             return(null);
         }
         else
         {
             return(new ListAddMethod(method, AddAttribute.Natural));
         }
     }
     else
     {
         return(new ListAddMethod(method, null));
     }
 }
Exemplo n.º 2
0
        public void GetNaturalName_should_consider_derived_argument_types(Type type, string expected)
        {
            string name = AddAttribute.GetNaturalName(type);

            Assert.Equal(expected, name);
        }