Exemple #1
0
        public void CreateSoilLayerChartData_LayerNull_ThrowsArgumentNullException()
        {
            // Call
            TestDelegate call = () => MacroStabilityInwardsChartDataFactory.CreateSoilLayerChartData(null);

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

            Assert.AreEqual("layer", exception.ParamName);
        }
Exemple #2
0
        public void CreateSoilLayerChartData_LayerWithEmptyNameAndColor_ReturnsEmptyChartDataCollectionWithExpectedStyling()
        {
            // Setup
            MacroStabilityInwardsSoilLayer2D layer = MacroStabilityInwardsSoilLayer2DTestFactory.CreateMacroStabilityInwardsSoilLayer2D();

            layer.Data.MaterialName = string.Empty;
            layer.Data.Color        = Color.Empty;

            // Call
            ChartMultipleAreaData data = MacroStabilityInwardsChartDataFactory.CreateSoilLayerChartData(layer);

            // Assert
            CollectionAssert.IsEmpty(data.Areas);
            Assert.AreEqual("Onbekend", data.Name);
            AssertEqualStyle(data.Style, Color.White, Color.Black, 1, false);
        }
Exemple #3
0
        public void CreateSoilLayerChartData_WithLayer_ReturnsEmptyChartDataCollectionWithExpectedStyling()
        {
            // Setup
            const string name      = "Soil layer test name";
            Color        fillColor = Color.Firebrick;

            MacroStabilityInwardsSoilLayer2D layer = MacroStabilityInwardsSoilLayer2DTestFactory.CreateMacroStabilityInwardsSoilLayer2D();

            layer.Data.MaterialName = name;
            layer.Data.Color        = fillColor;

            // Call
            ChartMultipleAreaData data = MacroStabilityInwardsChartDataFactory.CreateSoilLayerChartData(layer);

            // Assert
            CollectionAssert.IsEmpty(data.Areas);
            Assert.AreEqual(name, data.Name);
            AssertEqualStyle(data.Style, fillColor, Color.Black, 1, false);
        }