Exemple #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();
        }
Exemple #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");
        }
Exemple #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();
        }