public void GetProperties_should_return_property_with_only_set_method()
        {
            ClassSource classSource = new ClassSource(typeof(IOnlySet));

            var result = classSource.GetProperties();
            Assert.AreEqual(1, result.Count());
            result.ShouldContainsKeyAndValue("Text", typeof(string));
        }
        public void GetProperties_should_return_all_properties_from_simple_class()
        {
            ClassSource classSource = new ClassSource(typeof(SimpleClass));

            var result = classSource.GetProperties();
            Assert.AreEqual(2, result.Count());
            result.ShouldContainsKeyAndValue("Number", typeof(int));
            result.ShouldContainsKeyAndValue("Text", typeof(string));
        }
예제 #3
0
 private static TypeDescription GetTypeDescription(Type sourceClass)
 {
     var propertySource = new ClassSource(sourceClass);
     var typeDesctiption = new TypeDescription(sourceClass.FullName, propertySource.GetProperties());
     return typeDesctiption;
 }
 public void Ctor_should_throw_exception_when_value_is_null()
 {
     ClassSource classSource = new ClassSource(null);
 }