示例#1
0
        public void String_type_should_apply()
        {
            var          person       = new { Name = "stringvalue" };
            PropertyInfo propertyInfo = person.GetType().GetProperty("Name");

            LambdaConvention convention = Convention.ByType <string>(p => ARandom.String(10));

            convention.AppliesTo(propertyInfo).should_be_true();
        }
示例#2
0
        public void String_type_should_return_provided_default_string()
        {
            var          person       = new { Name = "stringvalue" };
            PropertyInfo propertyInfo = person.GetType().GetProperty("Name");

            LambdaConvention convention = Convention.ByType <string>(p => "test");

            convention.DefaultValue(propertyInfo).should_be_equal_to("test");
        }
示例#3
0
        public void Incorrect_type_should_not_apply()
        {
            var          person       = new { BoolVal = false };
            PropertyInfo propertyInfo = person.GetType().GetProperty("BoolVal");

            LambdaConvention convention = Convention.ByType <string>(p => ARandom.String(10));

            convention.AppliesTo(propertyInfo).should_be_false();
        }