Exemple #1
0
        public void Constructor_ExpectedValues()
        {
            // Call
            var properties = new ChartLineDataProperties();

            // Assert
            Assert.IsInstanceOf <ChartDataProperties <ChartLineData> >(properties);
            Assert.IsNull(properties.Data);
            Assert.AreEqual("Lijnen", properties.Type);
        }
Exemple #2
0
        public void Constructor_Always_PropertiesHaveExpectedAttributesValues(bool isStyleEditable)
        {
            // Setup
            var chartLineData = new ChartLineData("Test", new ChartLineStyle
            {
                IsEditable = isStyleEditable
            });

            // Call
            var properties = new ChartLineDataProperties
            {
                Data = chartLineData
            };

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

            Assert.AreEqual(6, dynamicProperties.Count);

            const string styleCategory = "Stijl";

            PropertyDescriptor colorProperty = dynamicProperties[colorPropertyIndex];

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

            PropertyDescriptor widthProperty = dynamicProperties[widthPropertyIndex];

            PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(widthProperty,
                                                                            styleCategory,
                                                                            "Lijndikte",
                                                                            "De dikte van de lijnen waarmee deze gegevensreeks wordt weergegeven.",
                                                                            !isStyleEditable);

            PropertyDescriptor styleProperty = dynamicProperties[stylePropertyIndex];

            Assert.IsInstanceOf <EnumTypeConverter>(styleProperty.Converter);
            PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(styleProperty,
                                                                            styleCategory,
                                                                            "Lijnstijl",
                                                                            "De stijl van de lijnen waarmee deze gegevensreeks wordt weergegeven.",
                                                                            !isStyleEditable);
        }
Exemple #3
0
        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 chartLineData = new ChartLineData("Test", new ChartLineStyle
            {
                Color     = Color.AliceBlue,
                Width     = 3,
                DashStyle = ChartLineDashStyle.Solid
            });

            chartLineData.Attach(observer);

            var properties = new ChartLineDataProperties
            {
                Data = chartLineData
            };

            Color     newColor = Color.Blue;
            const int newWidth = 6;
            const ChartLineDashStyle newDashStyle = ChartLineDashStyle.DashDot;

            // Call
            properties.Color     = newColor;
            properties.Width     = newWidth;
            properties.DashStyle = newDashStyle;

            // Assert
            Assert.AreEqual(newColor, chartLineData.Style.Color);
            Assert.AreEqual(newWidth, chartLineData.Style.Width);
            Assert.AreEqual(newDashStyle, chartLineData.Style.DashStyle);
            mocks.VerifyAll();
        }
Exemple #4
0
        public void Data_SetNewChartLineDataInstance_ReturnCorrectPropertyValues()
        {
            // Setup
            Color     color = Color.Aqua;
            const int width = 4;
            const ChartLineDashStyle dashStyle = ChartLineDashStyle.DashDot;

            var chartLineData = new ChartLineData("Test", new ChartLineStyle
            {
                Color     = color,
                Width     = width,
                DashStyle = dashStyle
            });
            var properties = new ChartLineDataProperties();

            // Call
            properties.Data = chartLineData;

            // Assert
            Assert.AreEqual(color, properties.Color);
            Assert.AreEqual(width, properties.Width);
            Assert.AreEqual(dashStyle, properties.DashStyle);
        }