public void Constructor_CalculationWithoutOutputAndWithWaternet_ChartDataEmpty() { // Setup MacroStabilityInwardsSurfaceLine surfaceLine = GetSurfaceLineWithGeometry(); MacroStabilityInwardsStochasticSoilProfile stochasticSoilProfile = MacroStabilityInwardsStochasticSoilProfileTestFactory.CreateMacroStabilityInwardsStochasticSoilProfile2D(); var calculation = new MacroStabilityInwardsCalculationScenario { InputParameters = { SurfaceLine = surfaceLine, StochasticSoilProfile = stochasticSoilProfile } }; // Call using (new MacroStabilityInwardsCalculatorFactoryConfig()) using (var control = new MacroStabilityInwardsOutputChartControl(calculation, new GeneralMacroStabilityInwardsInput(), AssessmentSectionTestHelper.GetTestAssessmentLevel)) { // Assert IChartControl chartControl = GetChartControl(control); ChartDataCollection chartData = chartControl.Data; MacroStabilityInwardsOutputViewChartDataAssert.AssertEmptyChartDataWithEmptySoilLayerAndWithWaternetChartData(chartData); MacroStabilityInwardsOutputViewChartDataAssert.AssertEmptyOutputChartData(chartData); Assert.AreEqual(calculation.Name, chartControl.ChartTitle); } }
public void UpdateChartData_CalculationWithoutOutputWithoutWaternet_ChartDataUpdated() { // Setup MacroStabilityInwardsSurfaceLine surfaceLine = GetSurfaceLineWithGeometry(); MacroStabilityInwardsStochasticSoilProfile stochasticSoilProfile = MacroStabilityInwardsStochasticSoilProfileTestFactory.CreateMacroStabilityInwardsStochasticSoilProfile2D(); var calculation = new MacroStabilityInwardsCalculationScenario { InputParameters = { SurfaceLine = surfaceLine, StochasticSoilProfile = stochasticSoilProfile }, Output = MacroStabilityInwardsOutputTestFactory.CreateOutput() }; using (new MacroStabilityInwardsCalculatorFactoryConfig()) using (var control = new MacroStabilityInwardsOutputChartControl(calculation, new GeneralMacroStabilityInwardsInput(), AssessmentSectionTestHelper.GetTestAssessmentLevel)) { ChartDataCollection chartData = GetChartControl(control).Data; // Precondition MacroStabilityInwardsOutputViewChartDataAssert.AssertInputChartData(calculation, chartData); MacroStabilityInwardsOutputViewChartDataAssert.AssertOutputChartData(calculation, chartData); calculation.ClearOutput(); // Call control.UpdateChartData(); // Assert MacroStabilityInwardsOutputViewChartDataAssert.AssertEmptyChartDataWithEmptySoilLayerAndWithWaternetChartData(chartData); MacroStabilityInwardsOutputViewChartDataAssert.AssertEmptyOutputChartData(chartData); } }