public void CreateDikeHeightChartData_ReturnsChartDataWithExpectedStyling()
        {
            // Call
            ChartLineData data = GrassCoverErosionInwardsChartDataFactory.CreateDikeHeightChartData();

            // Assert
            Assert.AreEqual("Dijkhoogte", data.Name);
            AssertEqualStyle(data.Style, Color.MediumSeaGreen, 2, ChartLineDashStyle.Dash);
        }
        public void CreateDikeGeometryChartData_ReturnsChartDataWithExpectedStyling()
        {
            // Call
            ChartLineData data = GrassCoverErosionInwardsChartDataFactory.CreateDikeGeometryChartData();

            // Assert
            Assert.AreEqual("Dijkprofiel", data.Name);
            AssertEqualStyle(data.Style, Color.SaddleBrown, 2, ChartLineDashStyle.Solid);
        }
        public void UpdateForeshoreGeometryChartDataName_InputNull_NameSetToDefaultName()
        {
            // Setup
            var chartData = new ChartLineData("test name");

            // Call
            GrassCoverErosionInwardsChartDataFactory.UpdateForeshoreGeometryChartDataName(chartData, null);

            // Assert
            Assert.AreEqual("Voorlandprofiel", chartData.Name);
        }
        public void UpdateDikeGeometryChartDataName_DikeProfileNull_NameSetToDefaultName()
        {
            // Setup
            var chartData = new ChartLineData("test name");

            // Call
            GrassCoverErosionInwardsChartDataFactory.UpdateDikeGeometryChartDataName(chartData, null);

            // Assert
            Assert.AreEqual("Dijkprofiel", chartData.Name);
        }
        private void SetChartData()
        {
            GrassCoverErosionInwardsInput input = data.InputParameters;
            DikeProfile dikeProfile             = input.DikeProfile;

            GrassCoverErosionInwardsChartDataFactory.UpdateForeshoreGeometryChartDataName(foreshoreChartData, input);
            GrassCoverErosionInwardsChartDataFactory.UpdateDikeGeometryChartDataName(dikeGeometryChartData, dikeProfile);

            foreshoreChartData.Points    = GrassCoverErosionInwardsChartDataPointsFactory.CreateForeshoreGeometryPoints(input);
            dikeGeometryChartData.Points = GrassCoverErosionInwardsChartDataPointsFactory.CreateDikeGeometryPoints(dikeProfile);
            dikeHeightChartData.Points   = GrassCoverErosionInwardsChartDataPointsFactory.CreateDikeHeightPoints(input);
        }
        public void UpdateDikeGeometryChartDataName_DikeProfile_NameSetToDikeProfileName()
        {
            // Setup
            var         chartData   = new ChartLineData("test name");
            DikeProfile dikeProfile = DikeProfileTestFactory.CreateDikeProfile("dike profile name");

            // Call
            GrassCoverErosionInwardsChartDataFactory.UpdateDikeGeometryChartDataName(chartData, dikeProfile);

            // Assert
            string expectedName = $"{dikeProfile.Name} - Dijkprofiel";

            Assert.AreEqual(expectedName, chartData.Name);
        }
        /// <summary>
        /// Creates a new instance of <see cref="GrassCoverErosionInwardsInputView"/>.
        /// </summary>
        public GrassCoverErosionInwardsInputView()
        {
            InitializeComponent();

            calculationObserver      = new Observer(UpdateChartTitle);
            calculationInputObserver = new Observer(UpdateChartData);

            chartDataCollection   = new ChartDataCollection(RiskeerCommonFormsResources.Calculation_Input);
            foreshoreChartData    = RiskeerChartDataFactory.CreateForeshoreGeometryChartData();
            dikeGeometryChartData = GrassCoverErosionInwardsChartDataFactory.CreateDikeGeometryChartData();
            dikeHeightChartData   = GrassCoverErosionInwardsChartDataFactory.CreateDikeHeightChartData();

            chartDataCollection.Add(foreshoreChartData);
            chartDataCollection.Add(dikeGeometryChartData);
            chartDataCollection.Add(dikeHeightChartData);
        }
        public void UpdateForeshoreGeometryChartDataName_DikeProfileSetUseForeshoreFalse_NameSetToDefaultName()
        {
            // Setup
            var chartData = new ChartLineData("test name");
            var input     = new GrassCoverErosionInwardsInput
            {
                DikeProfile  = DikeProfileTestFactory.CreateDikeProfile("dike profile name"),
                UseForeshore = false
            };

            // Call
            GrassCoverErosionInwardsChartDataFactory.UpdateForeshoreGeometryChartDataName(chartData, input);

            // Assert
            Assert.AreEqual("Voorlandprofiel", chartData.Name);
        }
        public void UpdateForeshoreGeometryChartDataName_DikeProfileSetUseForeshoreTrue_NameSetToDikeProfileName()
        {
            // Setup
            var chartData = new ChartLineData("test name");
            var input     = new GrassCoverErosionInwardsInput
            {
                DikeProfile  = DikeProfileTestFactory.CreateDikeProfile("dike profile name"),
                UseForeshore = true
            };

            // Call
            GrassCoverErosionInwardsChartDataFactory.UpdateForeshoreGeometryChartDataName(chartData, input);

            // Assert
            string expectedName = $"{input.DikeProfile.Name} - Voorlandprofiel";

            Assert.AreEqual(expectedName, chartData.Name);
        }