public void Constructor_ExpectedValues()
        {
            // Call
            var properties = new ChartMultipleAreaDataProperties();

            // Assert
            Assert.IsInstanceOf <ChartDataProperties <ChartMultipleAreaData> >(properties);
            Assert.IsNull(properties.Data);
            Assert.AreEqual("Vlakken", properties.Type);
        }
        public void Constructor_Always_PropertiesHaveExpectedAttributesValues(bool isStyleEditable)
        {
            // Setup
            var chartAreaData = new ChartMultipleAreaData("Test", new ChartAreaStyle
            {
                IsEditable = isStyleEditable
            });

            // Call
            var properties = new ChartMultipleAreaDataProperties
            {
                Data = chartAreaData
            };

            // Assert
            PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties);

            Assert.AreEqual(6, dynamicProperties.Count);

            const string styleCategory = "Stijl";

            PropertyDescriptor fillColorProperty = dynamicProperties[fillColorPropertyIndex];

            Assert.IsInstanceOf <ColorTypeConverter>(fillColorProperty.Converter);
            PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(fillColorProperty,
                                                                            styleCategory,
                                                                            "Kleur",
                                                                            "De kleur van de vlakken waarmee deze gegevensreeks wordt weergegeven.",
                                                                            !isStyleEditable);

            PropertyDescriptor strokeColorProperty = dynamicProperties[strokeColorPropertyIndex];

            Assert.IsInstanceOf <ColorTypeConverter>(strokeColorProperty.Converter);
            PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(strokeColorProperty,
                                                                            styleCategory,
                                                                            "Lijnkleur",
                                                                            "De kleur van de lijn van de vlakken waarmee deze gegevensreeks wordt weergegeven.",
                                                                            !isStyleEditable);

            PropertyDescriptor strokeThicknessProperty = dynamicProperties[strokeThicknessPropertyIndex];

            PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(strokeThicknessProperty,
                                                                            styleCategory,
                                                                            "Lijndikte",
                                                                            "De dikte van de lijn van de vlakken waarmee deze gegevensreeks wordt weergegeven.",
                                                                            !isStyleEditable);
        }
        public void SetProperties_IndividualProperties_UpdateDataAndNotifyObservers()
        {
            // Setup
            const int numberOfChangedProperties = 3;
            var       mocks    = new MockRepository();
            var       observer = mocks.StrictMock <IObserver>();

            observer.Expect(o => o.UpdateObserver()).Repeat.Times(numberOfChangedProperties);
            mocks.ReplayAll();

            var chartAreaData = new ChartMultipleAreaData("Test", new ChartAreaStyle
            {
                FillColor       = Color.AliceBlue,
                StrokeColor     = Color.Blue,
                StrokeThickness = 3
            });

            chartAreaData.Attach(observer);

            var properties = new ChartMultipleAreaDataProperties
            {
                Data = chartAreaData
            };

            Color     newFillColor       = Color.Blue;
            Color     newStrokeColor     = Color.Red;
            const int newStrokeThickness = 6;

            // Call
            properties.FillColor       = newFillColor;
            properties.StrokeColor     = newStrokeColor;
            properties.StrokeThickness = newStrokeThickness;

            // Assert
            Assert.AreEqual(newFillColor, chartAreaData.Style.FillColor);
            Assert.AreEqual(newStrokeColor, chartAreaData.Style.StrokeColor);
            Assert.AreEqual(newStrokeThickness, chartAreaData.Style.StrokeThickness);
            mocks.VerifyAll();
        }
        public void Data_SetNewChartAreaDataInstance_ReturnCorrectPropertyValues()
        {
            // Setup
            Color     fillColor       = Color.Aqua;
            Color     strokeColor     = Color.Bisque;
            const int strokeThickness = 4;

            var chartAreaData = new ChartMultipleAreaData("Test", new ChartAreaStyle
            {
                FillColor       = fillColor,
                StrokeColor     = strokeColor,
                StrokeThickness = strokeThickness
            });
            var properties = new ChartMultipleAreaDataProperties();

            // Call
            properties.Data = chartAreaData;

            // Assert
            Assert.AreEqual(fillColor, properties.FillColor);
            Assert.AreEqual(strokeColor, properties.StrokeColor);
            Assert.AreEqual(strokeThickness, properties.StrokeThickness);
        }