public void CreateUpperBoundaryRevetmentGeometryPoints_WithForeshoreProfile_ReturnsUpperBoundaryRevetmentGeometryPointsCollection( IEnumerable <Point2D> foreshoreProfileGeometry) { // Setup var input = new WaveConditionsInput { UpperBoundaryRevetment = (RoundedDouble)8, ForeshoreProfile = new TestForeshoreProfile(foreshoreProfileGeometry) }; // Call IEnumerable <Point2D> points = WaveConditionsChartDataPointsFactory.CreateUpperBoundaryRevetmentGeometryPoints(input); // Assert Point2D lastGeometryPoint = foreshoreProfileGeometry.Last(); double endPointX = (input.UpperBoundaryRevetment - lastGeometryPoint.Y) / 3; var expectedPoints = new[] { new Point2D(foreshoreProfileGeometry.First().X, 8), new Point2D(endPointX + lastGeometryPoint.X, 8) }; CollectionAssert.AreEqual(expectedPoints, points); }
public void CreateUpperBoundaryRevetmentGeometryPoints_UseForeshoreProfileFalse_ReturnsUpperBoundaryRevetmentGeometryPointsCollection() { // Setup var input = new WaveConditionsInput { UpperBoundaryRevetment = (RoundedDouble)9, ForeshoreProfile = new TestForeshoreProfile(new[] { new Point2D(0, 0), new Point2D(3, 4) }), UseForeshore = false }; // Call IEnumerable <Point2D> points = WaveConditionsChartDataPointsFactory.CreateUpperBoundaryRevetmentGeometryPoints(input); // Assert var expectedPoints = new[] { new Point2D(-10, 9), new Point2D(3, 9) }; CollectionAssert.AreEqual(expectedPoints, points); }
public void CreateUpperBoundaryRevetmentGeometryPoints_UpperBoundaryRevetmentNaN_ReturnsEmptyPointsCollection() { // Call IEnumerable <Point2D> points = WaveConditionsChartDataPointsFactory.CreateUpperBoundaryRevetmentGeometryPoints(new WaveConditionsInput()); // Assert CollectionAssert.IsEmpty(points); }
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); }