public void CreateRevetmentBaseGeometryPoints_InputWithForeshoreProfileAndLowerBoundaryWaterLevelsBelowForeshoreProfile_ReturnRevetmentBaseGeometryPointsCollection( IEnumerable <Point2D> foreshoreProfileGeometry) { // Setup const double lowerBoundaryRevetment = 2; const double upperBoundaryRevetment = 8; const double lowerBoundaryWaterLevels = -3; var input = new WaveConditionsInput { LowerBoundaryWaterLevels = (RoundedDouble)lowerBoundaryWaterLevels, LowerBoundaryRevetment = (RoundedDouble)lowerBoundaryRevetment, UpperBoundaryRevetment = (RoundedDouble)upperBoundaryRevetment, ForeshoreProfile = new TestForeshoreProfile(foreshoreProfileGeometry) }; // Call IEnumerable <Point2D> points = WaveConditionsChartDataPointsFactory.CreateRevetmentBaseGeometryPoints(input); // Assert Point2D lastGeometryPoint = foreshoreProfileGeometry.Last(); var expectedGeometry = new[] { new Point2D((lowerBoundaryWaterLevels - lastGeometryPoint.Y) / 3 + lastGeometryPoint.X, lowerBoundaryWaterLevels), new Point2D(lastGeometryPoint), new Point2D((lowerBoundaryRevetment - lastGeometryPoint.Y) / 3 + lastGeometryPoint.X, lowerBoundaryRevetment) }; CollectionAssert.AreEqual(expectedGeometry, points); }
public void CreateRevetmentBaseGeometryPoints_InputUseForeshoreProfileFalse_ReturnRevetmentBaseGeometryPointsCollection() { // Setup const double lowerBoundaryRevetment = 2; const double upperBoundaryRevetment = 8; var input = new WaveConditionsInput { LowerBoundaryRevetment = (RoundedDouble)lowerBoundaryRevetment, UpperBoundaryRevetment = (RoundedDouble)upperBoundaryRevetment, ForeshoreProfile = new TestForeshoreProfile(new[] { new Point2D(1, 1), new Point2D(3, 5), new Point2D(10, 7) }), UseForeshore = false }; // Call IEnumerable <Point2D> points = WaveConditionsChartDataPointsFactory.CreateRevetmentBaseGeometryPoints(input); // Assert CollectionAssert.AreEqual(new[] { new Point2D(0, 0), new Point2D(lowerBoundaryRevetment / 3, 2) }, points); }
public void CreateRevetmentBaseGeometryPoints_InputNull_ReturnsEmptyPointsCollection() { // Call IEnumerable <Point2D> points = WaveConditionsChartDataPointsFactory.CreateRevetmentBaseGeometryPoints(null); // 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); }