예제 #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();
        }