public void CreateAssessmentLevelGeometryPoints_WithForeshoreProfile_ReturnsAssessmentLevelGeometryPointsCollection( IEnumerable <Point2D> foreshoreProfileGeometry) { // Setup RoundedDouble assessmentLevel = GetValidAssessmentLevel(); var input = new WaveConditionsInput { ForeshoreProfile = new TestForeshoreProfile(foreshoreProfileGeometry) }; // Call IEnumerable <Point2D> points = WaveConditionsChartDataPointsFactory.CreateAssessmentLevelGeometryPoints(input, assessmentLevel); // Assert Point2D lastGeometryPoint = foreshoreProfileGeometry.Last(); double endPointX = (assessmentLevel - lastGeometryPoint.Y) / 3; var expectedPoints = new[] { new Point2D(foreshoreProfileGeometry.First().X, 6), new Point2D(endPointX + lastGeometryPoint.X, 6) }; CollectionAssert.AreEqual(expectedPoints, points); }
public void CreateAssessmentLevelGeometryPoints_UseForeshoreProfileFalse_ReturnsAssessmentLevelGeometryPointsCollection() { // Setup var input = new WaveConditionsInput { ForeshoreProfile = new TestForeshoreProfile(new[] { new Point2D(0, 0), new Point2D(3, 4) }), UseForeshore = false }; // Call IEnumerable <Point2D> points = WaveConditionsChartDataPointsFactory.CreateAssessmentLevelGeometryPoints(input, GetValidAssessmentLevel()); // Assert var expectedPoints = new[] { new Point2D(-10, 6), new Point2D(2, 6) }; CollectionAssert.AreEqual(expectedPoints, points); }
public void CreateAssessmentLevelGeometryPoints_InputNull_ReturnsEmptyPointsCollection() { // Call IEnumerable <Point2D> points = WaveConditionsChartDataPointsFactory.CreateAssessmentLevelGeometryPoints(null, RoundedDouble.NaN); // Assert CollectionAssert.IsEmpty(points); }
public void CreateAssessmentLevelGeometryPoints_AssessmentLevelNaN_ReturnsEmptyPointsCollection() { // Setup var input = new WaveConditionsInput(); // Call IEnumerable <Point2D> points = WaveConditionsChartDataPointsFactory.CreateAssessmentLevelGeometryPoints(input, RoundedDouble.NaN); // 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); }