/// <summary>
        /// Creates a new instance of <see cref="WaveConditionsInputView"/>.
        /// </summary>
        /// <param name="calculation">The calculation to show in the view.</param>
        /// <param name="getHydraulicBoundaryLocationCalculationFunc">The <see cref="Func{TResult}"/> for obtaining the <see cref="HydraulicBoundaryLocationCalculation"/>.</param>
        /// <param name="inputViewStyle">The style which should be applied to the <see cref="ChartLineData"/>.</param>
        /// <exception cref="ArgumentNullException">Thrown when any input parameter is <c>null</c>.</exception>
        public WaveConditionsInputView(ICalculation <WaveConditionsInput> calculation,
                                       Func <HydraulicBoundaryLocationCalculation> getHydraulicBoundaryLocationCalculationFunc,
                                       IWaveConditionsInputViewStyle inputViewStyle)
        {
            if (calculation == null)
            {
                throw new ArgumentNullException(nameof(calculation));
            }

            if (getHydraulicBoundaryLocationCalculationFunc == null)
            {
                throw new ArgumentNullException(nameof(getHydraulicBoundaryLocationCalculationFunc));
            }

            if (inputViewStyle == null)
            {
                throw new ArgumentNullException(nameof(inputViewStyle));
            }

            InitializeComponent();

            this.getHydraulicBoundaryLocationCalculationFunc = getHydraulicBoundaryLocationCalculationFunc;

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

            this.calculation = calculation;

            calculationObserver.Observable      = calculation;
            calculationInputObserver.Observable = calculation.InputParameters;
            hydraulicBoundaryLocationCalculationObserver.Observable = getHydraulicBoundaryLocationCalculationFunc();

            chartDataCollection               = new ChartDataCollection(RiskeerCommonFormsResources.Calculation_Input);
            foreshoreChartData                = RiskeerChartDataFactory.CreateForeshoreGeometryChartData();
            lowerBoundaryRevetmentChartData   = WaveConditionsChartDataFactory.CreateLowerRevetmentBoundaryChartData(inputViewStyle.RevetmentLineColor);
            upperBoundaryRevetmentChartData   = WaveConditionsChartDataFactory.CreateUpperRevetmentBoundaryChartData(inputViewStyle.RevetmentLineColor);
            lowerBoundaryWaterLevelsChartData = WaveConditionsChartDataFactory.CreateLowerWaterLevelsBoundaryChartData();
            upperBoundaryWaterLevelsChartData = WaveConditionsChartDataFactory.CreateUpperWaterLevelsBoundaryChartData();
            assessmentLevelChartData          = WaveConditionsChartDataFactory.CreateAssessmentLevelChartData();
            waterLevelsChartData              = WaveConditionsChartDataFactory.CreateWaterLevelsChartData();
            revetmentBaseChartData            = WaveConditionsChartDataFactory.CreateRevetmentBaseChartData(inputViewStyle.RevetmentLineColor);
            revetmentChartData                = WaveConditionsChartDataFactory.CreateRevetmentChartData(inputViewStyle.RevetmentLineColor);

            chartDataCollection.Add(foreshoreChartData);
            chartDataCollection.Add(lowerBoundaryRevetmentChartData);
            chartDataCollection.Add(upperBoundaryRevetmentChartData);
            chartDataCollection.Add(lowerBoundaryWaterLevelsChartData);
            chartDataCollection.Add(upperBoundaryWaterLevelsChartData);
            chartDataCollection.Add(assessmentLevelChartData);
            chartDataCollection.Add(waterLevelsChartData);
            chartDataCollection.Add(revetmentBaseChartData);
            chartDataCollection.Add(revetmentChartData);

            SetChartData();

            chartControl.Data = chartDataCollection;
            UpdateChartTitle();
        }
        public void CreateLowerWaterLevelsBoundaryChartData_ReturnsEmptyChartLineDataWithExpectedStyling()
        {
            // Call
            ChartLineData data = WaveConditionsChartDataFactory.CreateLowerWaterLevelsBoundaryChartData();

            // Assert
            CollectionAssert.IsEmpty(data.Points);
            Assert.AreEqual("Ondergrens waterstanden", data.Name);
            AssertEqualStyle(data.Style, Color.MediumBlue, 3, ChartLineDashStyle.Solid);
        }
        public void CreateWaterLevelsChartData_ReturnsEmptyChartMultipleLineDataWithExpectedStyling()
        {
            // Call
            ChartMultipleLineData data = WaveConditionsChartDataFactory.CreateWaterLevelsChartData();

            // Assert
            CollectionAssert.IsEmpty(data.Lines);
            Assert.AreEqual("Waterstanden in berekening", data.Name);
            AssertEqualStyle(data.Style, Color.DarkTurquoise, 3, ChartLineDashStyle.DashDotDot);
        }
        public void CreateAssessmentLevelChartData_ReturnsEmptyChartLineDataWithExpectedStyling()
        {
            // Call
            ChartLineData data = WaveConditionsChartDataFactory.CreateAssessmentLevelChartData();

            // Assert
            CollectionAssert.IsEmpty(data.Points);
            Assert.AreEqual("Waterstand bij doelkans", data.Name);
            AssertEqualStyle(data.Style, Color.LightCoral, 3, ChartLineDashStyle.Solid);
        }
        public void UpdateForeshoreGeometryChartDataName_InputNull_NameSetToDefaultName()
        {
            // Setup
            var chartData = new ChartLineData("test name");

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

            // Assert
            Assert.AreEqual("Voorlandprofiel", chartData.Name);
        }
        public void CreateRevetmentBaseChartData_ReturnsEmptyChartLineDataWithExpectedStyling()
        {
            // Setup
            Color lineColor = Color.FromArgb(120, Color.Gray);

            // Call
            ChartLineData data = WaveConditionsChartDataFactory.CreateRevetmentBaseChartData(lineColor);

            // Assert
            CollectionAssert.IsEmpty(data.Points);
            Assert.AreEqual("Hulplijn bekleding", data.Name);
            AssertEqualStyle(data.Style, lineColor, 8, ChartLineDashStyle.Dash);
        }
        public void CreateUpperRevetmentBoundaryChartData_ReturnsEmptyChartLineDataWithExpectedStyling()
        {
            // Setup
            Color lineColor = Color.Gray;

            // Call
            ChartLineData data = WaveConditionsChartDataFactory.CreateUpperRevetmentBoundaryChartData(lineColor);

            // Assert
            CollectionAssert.IsEmpty(data.Points);
            Assert.AreEqual("Bovengrens bekleding", data.Name);
            AssertEqualStyle(data.Style, lineColor, 3, ChartLineDashStyle.Solid);
        }
        public void UpdateForeshoreGeometryChartDataName_DikeProfileNull_NameSetToDefaultName()
        {
            // Setup
            var chartData = new ChartLineData("test name");
            var input     = new WaveConditionsInput
            {
                UseForeshore = true
            };

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

            // Assert
            Assert.AreEqual("Voorlandprofiel", chartData.Name);
        }
        public void UpdateForeshoreGeometryChartDataName_DikeProfileSetUseForeshoreTrue_NameSetToForeshoreProfileName()
        {
            // Setup
            var chartData = new ChartLineData("test name");
            var input     = new WaveConditionsInput
            {
                ForeshoreProfile = new TestForeshoreProfile("profile name"),
                UseForeshore     = true
            };

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

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

            Assert.AreEqual(expectedName, chartData.Name);
        }
        private void SetChartData()
        {
            WaveConditionsInput input = calculation.InputParameters;

            WaveConditionsChartDataFactory.UpdateForeshoreGeometryChartDataName(foreshoreChartData, input);

            foreshoreChartData.Points = WaveConditionsChartDataPointsFactory.CreateForeshoreGeometryPoints(input);
            lowerBoundaryRevetmentChartData.Points   = WaveConditionsChartDataPointsFactory.CreateLowerBoundaryRevetmentGeometryPoints(input);
            upperBoundaryRevetmentChartData.Points   = WaveConditionsChartDataPointsFactory.CreateUpperBoundaryRevetmentGeometryPoints(input);
            lowerBoundaryWaterLevelsChartData.Points = WaveConditionsChartDataPointsFactory.CreateLowerBoundaryWaterLevelsGeometryPoints(input);
            upperBoundaryWaterLevelsChartData.Points = WaveConditionsChartDataPointsFactory.CreateUpperBoundaryWaterLevelsGeometryPoints(input);

            RoundedDouble assessmentLevel = getHydraulicBoundaryLocationCalculationFunc()?.Output?.Result ?? RoundedDouble.NaN;

            assessmentLevelChartData.Points = WaveConditionsChartDataPointsFactory.CreateAssessmentLevelGeometryPoints(input, assessmentLevel);
            waterLevelsChartData.Lines      = WaveConditionsChartDataPointsFactory.CreateWaterLevelsGeometryPoints(input, assessmentLevel);

            revetmentBaseChartData.Points = WaveConditionsChartDataPointsFactory.CreateRevetmentBaseGeometryPoints(input);
            revetmentChartData.Points     = WaveConditionsChartDataPointsFactory.CreateRevetmentGeometryPoints(input);
        }