public void CreateWaterLevelsGeometryPoints_NoForeshoreProfile_ReturnsWaterLevelsGeometryPointsCollection() { // Setup var input = new WaveConditionsInput { LowerBoundaryRevetment = (RoundedDouble)5, UpperBoundaryRevetment = (RoundedDouble)7, StepSize = WaveConditionsInputStepSize.One }; // Call IEnumerable <IEnumerable <Point2D> > lines = WaveConditionsChartDataPointsFactory.CreateWaterLevelsGeometryPoints(input, (RoundedDouble)6.01); // Assert var expectedLines = new[] { new[] { new Point2D(-10, 6), new Point2D(2, 6) }, new[] { new Point2D(-10, 5), new Point2D(1.666667, 5) } }; AssertWaterLevelGeometries(expectedLines, lines); }
public void CreateWaterLevelsGeometryPoints_InputNull_ReturnsEmptyLinesList() { // Call IEnumerable <IEnumerable <Point2D> > lines = WaveConditionsChartDataPointsFactory.CreateWaterLevelsGeometryPoints(null, RoundedDouble.NaN); // Assert CollectionAssert.IsEmpty(lines); }
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); }
public void CreateWaterLevelsGeometryPoints_WithForeshoreProfile_ReturnsWaterLevelsGeometryPointsCollection( IEnumerable <Point2D> foreshoreProfileGeometry) { // Setup RoundedDouble assessmentLevel = GetValidAssessmentLevel(); var input = new WaveConditionsInput { ForeshoreProfile = new TestForeshoreProfile(foreshoreProfileGeometry), LowerBoundaryRevetment = (RoundedDouble)5, UpperBoundaryRevetment = (RoundedDouble)7, StepSize = WaveConditionsInputStepSize.One }; // Call IEnumerable <IEnumerable <Point2D> > lines = WaveConditionsChartDataPointsFactory.CreateWaterLevelsGeometryPoints(input, assessmentLevel); // Assert Point2D lastGeometryPoint = foreshoreProfileGeometry.Last(); IEnumerable <RoundedDouble> waterLevels = input.GetWaterLevels(assessmentLevel); var expectedLines = new[] { new[] { new Point2D(foreshoreProfileGeometry.First().X, 6), new Point2D(((waterLevels.ElementAt(0) - lastGeometryPoint.Y) / 3) + lastGeometryPoint.X, 6) }, new[] { new Point2D(foreshoreProfileGeometry.First().X, 5), new Point2D(((waterLevels.ElementAt(1) - lastGeometryPoint.Y) / 3) + lastGeometryPoint.X, 5) } }; AssertWaterLevelGeometries(expectedLines, lines); }