Esempio n. 1
0
        public void CreatePhreaticLineChartData_NameNull_ThrowsArgumentNullException()
        {
            // Call
            TestDelegate call = () => MacroStabilityInwardsChartDataFactory.CreatePhreaticLineChartData(null, new Random(21).NextBoolean());

            // Assert
            var exception = Assert.Throws <ArgumentNullException>(call);

            Assert.AreEqual("name", exception.ParamName);
        }
Esempio n. 2
0
        public void CreatePhreaticLineChartData_WithVisibility_ReturnsEmptyChartLineDataWithExpectedStylingAndVisibility(bool isVisible)
        {
            // Setup
            const string name = "zone";

            // Call
            ChartLineData data = MacroStabilityInwardsChartDataFactory.CreatePhreaticLineChartData(name, isVisible);

            // Assert
            CollectionAssert.IsEmpty(data.Points);
            Assert.AreEqual(name, data.Name);
            Assert.AreEqual(isVisible, data.IsVisible);
            AssertEqualStyle(data.Style, Color.Blue, 2, ChartLineDashStyle.Solid);
        }
Esempio n. 3
0
        private static void SetWaternetZonesChartData(MacroStabilityInwardsWaternet waternet, MacroStabilityInwardsSurfaceLine surfaceLine,
                                                      ChartDataCollection chartData)
        {
            chartData.Clear();

            foreach (MacroStabilityInwardsPhreaticLine phreaticLine in waternet.PhreaticLines)
            {
                ChartLineData phreaticLineChartData = MacroStabilityInwardsChartDataFactory.CreatePhreaticLineChartData(phreaticLine.Name, true);
                phreaticLineChartData.Points = MacroStabilityInwardsChartDataPointsFactory.CreatePhreaticLinePoints(phreaticLine);
                chartData.Add(phreaticLineChartData);
            }

            foreach (MacroStabilityInwardsWaternetLine waternetLine in waternet.WaternetLines)
            {
                ChartMultipleAreaData waternetLineChartData = MacroStabilityInwardsChartDataFactory.CreateWaternetZoneChartData(waternetLine.Name, true);
                waternetLineChartData.Areas = MacroStabilityInwardsChartDataPointsFactory.CreateWaternetZonePoints(waternetLine, surfaceLine);
                chartData.Add(waternetLineChartData);
            }
        }
Esempio n. 4
0
        private static void SetWaternetZonesChartData(MacroStabilityInwardsWaternet waternet, ChartDataCollection chartData,
                                                      IDictionary <MacroStabilityInwardsPhreaticLine, ChartLineData> phreaticLineLookup,
                                                      IDictionary <MacroStabilityInwardsWaternetLine, ChartMultipleAreaData> waternetLineLookup)
        {
            chartData.Clear();
            phreaticLineLookup.Clear();
            waternetLineLookup.Clear();

            foreach (MacroStabilityInwardsPhreaticLine phreaticLine in waternet.PhreaticLines)
            {
                ChartLineData phreaticLineChartData = MacroStabilityInwardsChartDataFactory.CreatePhreaticLineChartData(phreaticLine.Name, false);
                chartData.Add(phreaticLineChartData);
                phreaticLineLookup.Add(phreaticLine, phreaticLineChartData);
            }

            foreach (MacroStabilityInwardsWaternetLine waternetLine in waternet.WaternetLines)
            {
                ChartMultipleAreaData waternetLineChartData = MacroStabilityInwardsChartDataFactory.CreateWaternetZoneChartData(waternetLine.Name, false);
                chartData.Add(waternetLineChartData);
                waternetLineLookup.Add(waternetLine, waternetLineChartData);
            }
        }