Example #1
0
        public TestObjectVariationBuilder <TTestValue> KeepingConstant <TParam>(
            Expression <Func <TTestValue, TParam> > keepConstant)
        {
            var propertyName = MemberUtility.GetMemberInfo(keepConstant).Name;

            _constantProperties.Add(propertyName.ToLower());
            return(this);
        }
Example #2
0
        /// <summary>
        /// Sets an argument based on an expression to the Property name being set.
        /// Depends on the argument to the constructor being named consistently
        /// eg. string MyProperty { get; set; } => public MyClass(string myProperty)
        /// MyProperty => myProperty
        /// </summary>
        public TestObjectBuilder <T> SetArgument <TParam>(Expression <Func <T, TParam> > expr, TParam value)
        {
            var propertyName = MemberUtility.GetMemberInfo(expr).Name;
            var paramName    = string.Format("{0}{1}",
                                             Char.ToLower(propertyName[0]),
                                             propertyName.Substring(1));

            return(SetArgument(paramName, value));
        }
 public static void MapComponentWithPrefix <T, TComponent>(this ClassMap <T> map,
                                                           Expression <Func <T, TComponent> > f)
 {
     map.Component(f).ColumnPrefix(MemberUtility.GetMemberInfo(f).Name);
 }