public void entityItemViewPropertyDescriptor_shouldSerializeValue_normal_return_false() { var target = new EntityItemViewPropertyDescriptor <GenericParameterHelper>("Data"); bool actual = target.ShouldSerializeValue(new GenericParameterHelper()); actual.Should().Be.False(); }
public void entityItemViewPropertyDescriptor_canResetValue_normal_should_return_always_false() { var target = new EntityItemViewPropertyDescriptor <GenericParameterHelper>("Data"); bool actual = target.CanResetValue(null); actual.Should().Be.False(); }
public void entityItemViewPropertyDescriptor_getValue_using_default_ctor_should_return_expected_value() { var expected = 100; var component = A.Fake <IEntityItemView <GenericParameterHelper> >(); A.CallTo(() => component.EntityItem) .Returns(new GenericParameterHelper(expected)) .NumberOfTimes(1); var target = new EntityItemViewPropertyDescriptor <GenericParameterHelper>("Data"); int actual = (int)target.GetValue(component); actual.Should().Be.EqualTo(expected); A.CallTo(() => component.EntityItem).MustHaveHappened(); }
public void entityItemViewPropertyDescriptor_ctor_default_should_correctly_set_default_values() { var expected = "Data"; var target = new EntityItemViewPropertyDescriptor<GenericParameterHelper>( expected ); 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( expected ); target.IsBrowsable.Should().Be.True(); target.IsLocalizable.Should().Be.False(); target.IsReadOnly.Should().Be.False(); target.Name.Should().Be.EqualTo( expected ); target.PropertyType.Should().Be.EqualTo( typeof( Int32 ) ); }
public void entityItemViewPropertyDescriptor_ctor_default_should_correctly_set_default_values() { var expected = "Data"; var target = new EntityItemViewPropertyDescriptor <GenericParameterHelper>(expected); 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(expected); target.IsBrowsable.Should().Be.True(); target.IsLocalizable.Should().Be.False(); target.IsReadOnly.Should().Be.False(); target.Name.Should().Be.EqualTo(expected); target.PropertyType.Should().Be.EqualTo(typeof(int)); }
public void entityItemViewPropertyDescriptor_setValue_using_invalid_reference_component_should_raise_ArgumentException() { var target = new EntityItemViewPropertyDescriptor<GenericParameterHelper>( "Data" ); target.SetValue( new Object(), 100 ); }
public void entityItemViewPropertyDescriptor_getValue_using_null_reference_component_should_raise_ArgumentNullException() { var target = new EntityItemViewPropertyDescriptor<GenericParameterHelper>( "Data" ); target.GetValue( null ); }
public void entityItemViewPropertyDescriptor_setValue_using_default_ctor_should_set_expected_value() { var expected = 100; var entityItem = new GenericParameterHelper( 0 ); var component = MockRepository.GenerateMock<IEntityItemView<GenericParameterHelper>>(); component.Expect( mock => mock.EntityItem ) .Return( entityItem ) .Repeat.Once(); var target = new EntityItemViewPropertyDescriptor<GenericParameterHelper>( "Data" ); target.SetValue( component, expected ); entityItem.Data.Should().Be.EqualTo( expected ); component.VerifyAllExpectations(); }
public void entityItemViewPropertyDescriptor_shouldSerializeValue_normal_return_false() { var target = new EntityItemViewPropertyDescriptor<GenericParameterHelper>( "Data" ); Boolean actual = target.ShouldSerializeValue( new GenericParameterHelper() ); actual.Should().Be.False(); }
public void entityItemViewPropertyDescriptor_resetValue_normal_should_do_nothing() { var target = new EntityItemViewPropertyDescriptor<GenericParameterHelper>( "Data" ); target.ResetValue( new GenericParameterHelper() ); }
public void entityItemViewPropertyDescriptor_canResetValue_normal_should_return_always_false() { var target = new EntityItemViewPropertyDescriptor<GenericParameterHelper>( "Data" ); Boolean actual = target.CanResetValue( null ); actual.Should().Be.False(); }
public void entityItemViewPropertyDescriptor_setValue_using_invalid_reference_component_should_raise_ArgumentException() { var target = new EntityItemViewPropertyDescriptor <GenericParameterHelper>("Data"); target.SetValue(new Object(), 100); }
public void entityItemViewPropertyDescriptor_getValue_using_null_reference_component_should_raise_ArgumentNullException() { var target = new EntityItemViewPropertyDescriptor <GenericParameterHelper>("Data"); target.GetValue(null); }
public void entityItemViewPropertyDescriptor_resetValue_normal_should_do_nothing() { var target = new EntityItemViewPropertyDescriptor <GenericParameterHelper>("Data"); target.ResetValue(new GenericParameterHelper()); }