public void entityItemViewCustomPropertyDescriptor_ctor_customDisplayName_propertyType_valueGetter_should_correctly_set_default_values()
        {
            var customPropertyName = "Foo";
            EntityItemViewValueGetter<GenericParameterHelper, Int32> getter = ( obj ) => { return null; };

            var target = new EntityItemViewCustomPropertyDescriptor<GenericParameterHelper, Int32>( customPropertyName, getter );

            target.Category.Should().Be.EqualTo( "Misc" );
            target.Attributes.OfType<Attribute>().Should().Have.SameSequenceAs( new Attribute[ 0 ] );
            target.ComponentType.Should().Be.EqualTo( typeof( IEntityItemView<GenericParameterHelper> ) );
            target.Converter.GetType().Should().Be.EqualTo( typeof( Int32Converter ) );
            target.Description.Should().Be.EqualTo( String.Empty );
            target.DesignTimeOnly.Should().Be.False();
            target.DisplayName.Should().Be.EqualTo( customPropertyName );
            target.IsBrowsable.Should().Be.True();
            target.IsLocalizable.Should().Be.False();
            target.IsReadOnly.Should().Be.True();
            target.Name.Should().Be.EqualTo( customPropertyName );
            target.PropertyType.Should().Be.EqualTo( typeof( Int32 ) );
        }
示例#2
0
        public void entityItemViewCustomPropertyDescriptor_ctor_customDisplayName_propertyType_valueGetter_should_correctly_set_default_values()
        {
            var customPropertyName = "Foo";
            EntityItemViewValueGetter <GenericParameterHelper, int> getter = (obj) => { return(null); };

            var target = new EntityItemViewCustomPropertyDescriptor <GenericParameterHelper, int>(customPropertyName, getter);

            target.Category.Should().Be.EqualTo("Misc");
            target.Attributes.OfType <Attribute>().Should().Have.SameSequenceAs(new Attribute[0]);
            target.ComponentType.Should().Be.EqualTo(typeof(IEntityItemView <GenericParameterHelper>));
            target.Converter.GetType().Should().Be.EqualTo(typeof(Int32Converter));
            target.Description.Should().Be.EqualTo(string.Empty);
            target.DesignTimeOnly.Should().Be.False();
            target.DisplayName.Should().Be.EqualTo(customPropertyName);
            target.IsBrowsable.Should().Be.True();
            target.IsLocalizable.Should().Be.False();
            target.IsReadOnly.Should().Be.True();
            target.Name.Should().Be.EqualTo(customPropertyName);
            target.PropertyType.Should().Be.EqualTo(typeof(int));
        }