public void GetValidColor_ColorEmpty_ReturnColorWhite() { // Call Color validColor = SoilLayerDataHelper.GetValidColor(Color.Empty); // Assert Assert.AreEqual(Color.White, validColor); }
public void GetValidColor_ValidColor_ReturnColor() { // Setup var random = new Random(21); Color color = Color.FromKnownColor(random.NextEnumValue <KnownColor>()); // Call Color validColor = SoilLayerDataHelper.GetValidColor(color); // Assert Assert.AreEqual(color, validColor); }
public FormattedPipingSoilLayerRow(PipingSoilLayer layer) { MaterialName = SoilLayerDataHelper.GetValidName(layer.MaterialName); Color = SoilLayerDataHelper.GetValidColor(layer.Color); Top = new RoundedDouble(2, layer.Top); IsAquifer = layer.IsAquifer; PermeabilityMean = layer.Permeability.Mean; PermeabilityCoefficientOfVariation = layer.Permeability.CoefficientOfVariation; DiameterD70Mean = layer.DiameterD70.Mean; DiameterD70CoefficientOfVariation = layer.DiameterD70.CoefficientOfVariation; BelowPhreaticLevelMean = layer.BelowPhreaticLevel.Mean; BelowPhreaticLevelDeviation = layer.BelowPhreaticLevel.StandardDeviation; BelowPhreaticLevelShift = layer.BelowPhreaticLevel.Shift; }
/// <summary> /// Create <see cref="ChartMultipleAreaData"/> for a <see cref="PipingSoilLayer"/> based /// on its name and fill color. /// </summary> /// <param name="layer">The layer to create the <see cref="ChartMultipleAreaData"/> for.</param> /// <returns>The created <see cref="ChartMultipleAreaData"/>.</returns> /// <exception cref="ArgumentNullException">Thrown when <paramref name="layer"/> is <c>null</c>.</exception> public static ChartMultipleAreaData CreateSoilLayerChartData(PipingSoilLayer layer) { if (layer == null) { throw new ArgumentNullException(nameof(layer)); } return(new ChartMultipleAreaData(SoilLayerDataHelper.GetValidName(layer.MaterialName), new ChartAreaStyle { FillColor = SoilLayerDataHelper.GetValidColor(layer.Color), StrokeColor = Color.Black, StrokeThickness = 1 })); }
/// <summary> /// Create <see cref="ChartMultipleAreaData"/> for a <see cref="MacroStabilityInwardsSoilLayer2D"/>. /// </summary> /// <param name="layer">The layer to create the <see cref="ChartMultipleAreaData"/> for.</param> /// <returns>The created <see cref="ChartMultipleAreaData"/>.</returns> /// <exception cref="ArgumentNullException">Thrown when <paramref name="layer"/> is <c>null</c>.</exception> public static ChartMultipleAreaData CreateSoilLayerChartData(MacroStabilityInwardsSoilLayer2D layer) { if (layer == null) { throw new ArgumentNullException(nameof(layer)); } MacroStabilityInwardsSoilLayerData data = layer.Data; return(new ChartMultipleAreaData(SoilLayerDataHelper.GetValidName(data.MaterialName), new ChartAreaStyle { FillColor = SoilLayerDataHelper.GetValidColor(data.Color), StrokeColor = Color.Black, StrokeThickness = 1 })); }
/// <summary> /// Creates a new instance of <see cref="MacroStabilityInwardsFormattedSoilLayerDataRow"/>. /// </summary> /// <param name="layerData">The <see cref="MacroStabilityInwardsSoilLayerData"/> to format.</param> /// <exception cref="ArgumentNullException">Thrown when <paramref name="layerData"/> /// is <c>null</c>.</exception> public MacroStabilityInwardsFormattedSoilLayerDataRow(MacroStabilityInwardsSoilLayerData layerData) { if (layerData == null) { throw new ArgumentNullException(nameof(layerData)); } MaterialName = SoilLayerDataHelper.GetValidName(layerData.MaterialName); Color = SoilLayerDataHelper.GetValidColor(layerData.Color); IsAquifer = layerData.IsAquifer; AbovePhreaticLevel = FormatVariationCoefficientDesignVariableWithShift(MacroStabilityInwardsSemiProbabilisticDesignVariableFactory.GetAbovePhreaticLevel(layerData)); BelowPhreaticLevel = FormatVariationCoefficientDesignVariableWithShift(MacroStabilityInwardsSemiProbabilisticDesignVariableFactory.GetBelowPhreaticLevel(layerData)); ShearStrengthModel = layerData.ShearStrengthModel; Cohesion = FormatVariationCoefficientDesignVariable(MacroStabilityInwardsSemiProbabilisticDesignVariableFactory.GetCohesion(layerData)); FrictionAngle = FormatVariationCoefficientDesignVariable(MacroStabilityInwardsSemiProbabilisticDesignVariableFactory.GetFrictionAngle(layerData)); ShearStrengthRatio = FormatVariationCoefficientDesignVariable(MacroStabilityInwardsSemiProbabilisticDesignVariableFactory.GetShearStrengthRatio(layerData)); StrengthIncreaseExponent = FormatVariationCoefficientDesignVariable(MacroStabilityInwardsSemiProbabilisticDesignVariableFactory.GetStrengthIncreaseExponent(layerData)); UsePop = layerData.UsePop; Pop = FormatVariationCoefficientDesignVariable(MacroStabilityInwardsSemiProbabilisticDesignVariableFactory.GetPop(layerData)); }