/// <summary>
        /// Asserts whether <paramref name="actual"/> corresponds to the output of <paramref name="calculationScenario"/>.
        /// </summary>
        /// <param name="calculationScenario">The original <see cref="MacroStabilityInwardsCalculationScenario"/>.</param>
        /// <param name="actual">The actual <see cref="ChartDataCollection"/>.</param>
        /// <exception cref="AssertionException">Thrown when <paramref name="actual"/>
        /// does not correspond to <paramref name="calculationScenario"/>.</exception>
        public static void AssertOutputChartData(MacroStabilityInwardsCalculationScenario calculationScenario, ChartDataCollection actual)
        {
            Assert.AreEqual(nrOfChartData, actual.Collection.Count());

            MacroStabilityInwardsViewChartDataAssert.AssertGridChartData(calculationScenario.Output.SlipPlane.LeftGrid,
                                                                         (ChartPointData)actual.Collection.ElementAt(leftGridIndex));
            MacroStabilityInwardsViewChartDataAssert.AssertGridChartData(calculationScenario.Output.SlipPlane.RightGrid,
                                                                         (ChartPointData)actual.Collection.ElementAt(rightGridIndex));

            AssertTangentLinesChartData(calculationScenario.Output.SlipPlane.TangentLines, calculationScenario.InputParameters.SurfaceLine,
                                        (ChartMultipleLineData)actual.Collection.ElementAt(tangentLinesIndex));

            AssertSlicesChartData(calculationScenario.Output.SlidingCurve.Slices,
                                  (ChartMultipleAreaData)actual.Collection.ElementAt(slicesIndex));

            AssertSliceParametersChartData(calculationScenario.Output.SlidingCurve.Slices,
                                           (ChartDataCollection)actual.Collection.ElementAt(sliceParameterIndex));

            AssertSlipPlaneChartData(calculationScenario.Output.SlidingCurve,
                                     (ChartLineData)actual.Collection.ElementAt(slipPlaneIndex));

            AssertCircleRadiusChartData(calculationScenario.Output.SlidingCurve.Slices.First().TopLeftPoint,
                                        calculationScenario.Output.SlidingCurve.LeftCircle,
                                        (ChartLineData)actual.Collection.ElementAt(activeCircleRadiusIndex));
            AssertCircleRadiusChartData(calculationScenario.Output.SlidingCurve.Slices.Last().TopRightPoint,
                                        calculationScenario.Output.SlidingCurve.RightCircle,
                                        (ChartLineData)actual.Collection.ElementAt(passiveCircleRadiusIndex));
        }
Пример #2
0
 /// <summary>
 /// Asserts whether <paramref name="actual"/> corresponds to <paramref name="calculationScenario"/>.
 /// </summary>
 /// <param name="calculationScenario">The original <see cref="MacroStabilityInwardsCalculationScenario"/>.</param>
 /// <param name="actual">The actual <see cref="ChartDataCollection"/>.</param>
 /// <exception cref="AssertionException">Thrown when <paramref name="actual"/>
 /// does not correspond to <paramref name="calculationScenario"/>.</exception>
 public static void AssertChartData(MacroStabilityInwardsCalculationScenario calculationScenario, ChartDataCollection actual)
 {
     Assert.AreEqual(nrOfChartData, actual.Collection.Count());
     MacroStabilityInwardsViewChartDataAssert.AssertSurfaceLineChartData(calculationScenario.InputParameters.SurfaceLine,
                                                                         actual.Collection.ElementAt(surfaceLineIndex));
     MacroStabilityInwardsViewChartDataAssert.AssertSoilProfileChartData(calculationScenario.InputParameters.SoilProfileUnderSurfaceLine,
                                                                         calculationScenario.InputParameters.StochasticSoilProfile.SoilProfile.Name,
                                                                         true,
                                                                         actual.Collection.ElementAt(soilProfileIndex));
 }
        /// <summary>
        /// Asserts whether <paramref name="actual"/> corresponds to the input of <paramref name="calculationScenario"/>.
        /// </summary>
        /// <param name="calculationScenario">The original <see cref="MacroStabilityInwardsCalculationScenario"/>.</param>
        /// <param name="actual">The actual <see cref="ChartDataCollection"/>.</param>
        /// <exception cref="AssertionException">Thrown when <paramref name="actual"/>
        /// does not correspond to <paramref name="calculationScenario"/>.</exception>
        public static void AssertInputChartData(MacroStabilityInwardsCalculationScenario calculationScenario, ChartDataCollection actual)
        {
            Assert.AreEqual(nrOfChartData, actual.Collection.Count());
            MacroStabilityInwardsViewChartDataAssert.AssertSurfaceLineChartData(calculationScenario.InputParameters.SurfaceLine, actual.Collection.ElementAt(surfaceLineIndex));
            MacroStabilityInwardsViewChartDataAssert.AssertSoilProfileChartData(calculationScenario.InputParameters.SoilProfileUnderSurfaceLine,
                                                                                calculationScenario.InputParameters.StochasticSoilProfile.SoilProfile.Name,
                                                                                true,
                                                                                actual.Collection.ElementAt(soilProfileIndex));

            AssertWaternetChartData(DerivedMacroStabilityInwardsInput.GetWaternetExtreme(calculationScenario.InputParameters, new GeneralMacroStabilityInwardsInput(), RoundedDouble.NaN),
                                    (ChartDataCollection)actual.Collection.ElementAt(waternetZonesExtremeIndex));
            AssertWaternetChartData(DerivedMacroStabilityInwardsInput.GetWaternetDaily(calculationScenario.InputParameters, new GeneralMacroStabilityInwardsInput()),
                                    (ChartDataCollection)actual.Collection.ElementAt(waternetZonesDailyIndex));
        }
 /// <summary>
 /// Asserts whether <paramref name="chartDataCollection"/> contains no Waternet chart data.
 /// </summary>
 /// <param name="chartDataCollection">The actual <see cref="ChartData"/>.</param>
 /// <exception cref="AssertionException">Thrown when a Waternet layer is present.</exception>
 public static void AssertEmptyWaternetChartData(ChartDataCollection chartDataCollection)
 {
     MacroStabilityInwardsViewChartDataAssert.AssertEmptyWaternetChartData(chartDataCollection,
                                                                           waternetZonesExtremeIndex,
                                                                           waternetZonesDailyIndex);
 }
 /// <summary>
 /// Asserts whether <paramref name="chartDataCollection"/> contains no Waternet chart data.
 /// </summary>
 /// <param name="waternet">The original <see cref="MacroStabilityInwardsWaternet"/>.</param>
 /// <param name="chartDataCollection">The actual <see cref="ChartData"/>.</param>
 /// <exception cref="AssertionException">Thrown when a Waternet layer is present.</exception>
 public static void AssertWaternetChartData(MacroStabilityInwardsWaternet waternet, ChartDataCollection chartDataCollection)
 {
     MacroStabilityInwardsViewChartDataAssert.AssertWaternetChartData(waternet,
                                                                      false,
                                                                      chartDataCollection);
 }