private static TestCaseData[] StochasticProfileVariousCombinations() { var stochasticSoilProfile = new MacroStabilityInwardsStochasticSoilProfile(1.0, CreateRandomProfile(22)); var otherStochasticSoilProfileA = new MacroStabilityInwardsStochasticSoilProfile(0.5, CreateRandomProfile(22)); var otherStochasticSoilProfileB = new MacroStabilityInwardsStochasticSoilProfile(1.0, CreateRandomProfile(23)); const double probability = 1.0; TestSoilProfile profile = CreateRandomProfile(22); var stochasticProfileSameProperties = new MacroStabilityInwardsStochasticSoilProfile(probability, profile); var otherStochasticProfileSameProperties = new MacroStabilityInwardsStochasticSoilProfile(probability, profile); return(new[] { new TestCaseData(stochasticSoilProfile, otherStochasticSoilProfileA) { TestName = "Update_ProfileWithProfileADifferentProbability_UpdatesProperties" }, new TestCaseData(stochasticSoilProfile, otherStochasticSoilProfileB) { TestName = "Update_ProfileWithProfileBDifferentSoilProfile_UpdatesProperties" }, new TestCaseData(stochasticProfileSameProperties, otherStochasticProfileSameProperties) { TestName = "Update_ProfileWithProfileSameProperties_PropertiesRemainSame" } }); }
public void Transform_InvalidSoilProfile_ThrowsImportedDataTransformException() { // Setup var invalidType = new TestSoilProfile(); // Call TestDelegate test = () => PipingSoilProfileTransformer.Transform(invalidType); // Assert var exception = Assert.Throws <ImportedDataTransformException>(test); const string message = "De ondergrondschematisatie van het type 'TestSoilProfile' is niet ondersteund. " + "Alleen ondergrondschematisaties van het type 'SoilProfile1D' of 'SoilProfile2D' zijn ondersteund."; Assert.AreEqual(message, exception.Message); }
public void Constructor_EmptyConstructionProperties_ExpectedValues() { // Setup var surfaceLine = new MacroStabilityInwardsSurfaceLine(string.Empty); var soilProfile = new TestSoilProfile(); var drainageConstruction = new DrainageConstruction(); var phreaticLineOffsets = new PhreaticLineOffsets(); var slipPlane = new UpliftVanSlipPlane(); var slipPlaneConstraints = new UpliftVanSlipPlaneConstraints(double.NaN, double.NaN); // Call var input = new UpliftVanCalculatorInput( new UpliftVanCalculatorInput.ConstructionProperties { SurfaceLine = surfaceLine, SoilProfile = soilProfile, DrainageConstruction = drainageConstruction, PhreaticLineOffsetsExtreme = phreaticLineOffsets, PhreaticLineOffsetsDaily = phreaticLineOffsets, SlipPlane = slipPlane, SlipPlaneConstraints = slipPlaneConstraints }); // Assert Assert.IsNaN(input.AssessmentLevel); Assert.IsNaN(input.WaterLevelRiverAverage); Assert.IsNaN(input.WaterLevelPolderExtreme); Assert.IsNaN(input.WaterLevelPolderDaily); Assert.IsNaN(input.MinimumLevelPhreaticLineAtDikeTopRiver); Assert.IsNaN(input.MinimumLevelPhreaticLineAtDikeTopPolder); Assert.IsNaN(input.LeakageLengthOutwardsPhreaticLine3); Assert.IsNaN(input.LeakageLengthInwardsPhreaticLine3); Assert.IsNaN(input.LeakageLengthOutwardsPhreaticLine4); Assert.IsNaN(input.LeakageLengthInwardsPhreaticLine4); Assert.IsNaN(input.PiezometricHeadPhreaticLine2Outwards); Assert.IsNaN(input.PiezometricHeadPhreaticLine2Inwards); Assert.IsNaN(input.PenetrationLengthDaily); Assert.IsNaN(input.PenetrationLengthExtreme); Assert.IsNaN(input.MaximumSliceWidth); Assert.IsNaN(input.WaterVolumetricWeight); Assert.IsFalse(input.AdjustPhreaticLine3And4ForUplift); Assert.IsFalse(input.MoveGrid); Assert.AreEqual(MacroStabilityInwardsDikeSoilScenario.ClayDikeOnClay, input.DikeSoilScenario); }
public void Constructor_WithConstructionProperties_PropertiesAreSet() { // Setup var random = new Random(11); double assessmentLevel = random.NextDouble(); var surfaceLine = new MacroStabilityInwardsSurfaceLine(string.Empty); var soilProfile = new TestSoilProfile(); var drainageConstruction = new DrainageConstruction(); var phreaticLineOffsets = new PhreaticLineOffsets(); double waterLevelRiverAverage = random.NextDouble(); double waterLevelPolder = random.NextDouble(); double minimumLevelPhreaticLineAtDikeTopRiver = random.NextDouble(); double minimumLevelPhreaticLineAtDikeTopPolder = random.NextDouble(); double leakageLengthOutwardsPhreaticLine3 = random.NextDouble(); double leakageLengthInwardsPhreaticLine3 = random.NextDouble(); double leakageLengthOutwardsPhreaticLine4 = random.NextDouble(); double leakageLengthInwardsPhreaticLine4 = random.NextDouble(); double piezometricHeadPhreaticLine2Outwards = random.NextDouble(); double piezometricHeadPhreaticLine2Inwards = random.NextDouble(); double penetrationLength = random.NextDouble(); bool adjustPhreaticLine3And4ForUplift = random.NextBoolean(); var dikeSoilScenario = random.NextEnumValue <MacroStabilityInwardsDikeSoilScenario>(); double waterVolumetricWeight = random.NextDouble(); // Call var input = new WaternetCalculatorInput( new WaternetCalculatorInput.ConstructionProperties { AssessmentLevel = assessmentLevel, SurfaceLine = surfaceLine, SoilProfile = soilProfile, DrainageConstruction = drainageConstruction, PhreaticLineOffsets = phreaticLineOffsets, WaterLevelRiverAverage = waterLevelRiverAverage, WaterLevelPolder = waterLevelPolder, MinimumLevelPhreaticLineAtDikeTopRiver = minimumLevelPhreaticLineAtDikeTopRiver, MinimumLevelPhreaticLineAtDikeTopPolder = minimumLevelPhreaticLineAtDikeTopPolder, LeakageLengthOutwardsPhreaticLine3 = leakageLengthOutwardsPhreaticLine3, LeakageLengthInwardsPhreaticLine3 = leakageLengthInwardsPhreaticLine3, LeakageLengthOutwardsPhreaticLine4 = leakageLengthOutwardsPhreaticLine4, LeakageLengthInwardsPhreaticLine4 = leakageLengthInwardsPhreaticLine4, PiezometricHeadPhreaticLine2Outwards = piezometricHeadPhreaticLine2Outwards, PiezometricHeadPhreaticLine2Inwards = piezometricHeadPhreaticLine2Inwards, PenetrationLength = penetrationLength, AdjustPhreaticLine3And4ForUplift = adjustPhreaticLine3And4ForUplift, DikeSoilScenario = dikeSoilScenario, WaterVolumetricWeight = waterVolumetricWeight }); // Assert Assert.AreEqual(assessmentLevel, input.AssessmentLevel); Assert.AreSame(surfaceLine, input.SurfaceLine); Assert.AreSame(soilProfile, input.SoilProfile); Assert.AreSame(drainageConstruction, input.DrainageConstruction); Assert.AreSame(phreaticLineOffsets, input.PhreaticLineOffsets); Assert.AreEqual(waterLevelRiverAverage, input.WaterLevelRiverAverage); Assert.AreEqual(waterLevelPolder, input.WaterLevelPolder); Assert.AreEqual(minimumLevelPhreaticLineAtDikeTopRiver, input.MinimumLevelPhreaticLineAtDikeTopRiver); Assert.AreEqual(minimumLevelPhreaticLineAtDikeTopPolder, input.MinimumLevelPhreaticLineAtDikeTopPolder); Assert.AreEqual(leakageLengthOutwardsPhreaticLine3, input.LeakageLengthOutwardsPhreaticLine3); Assert.AreEqual(leakageLengthInwardsPhreaticLine3, input.LeakageLengthInwardsPhreaticLine3); Assert.AreEqual(leakageLengthOutwardsPhreaticLine4, input.LeakageLengthOutwardsPhreaticLine4); Assert.AreEqual(leakageLengthInwardsPhreaticLine4, input.LeakageLengthInwardsPhreaticLine4); Assert.AreEqual(piezometricHeadPhreaticLine2Outwards, input.PiezometricHeadPhreaticLine2Outwards); Assert.AreEqual(piezometricHeadPhreaticLine2Inwards, input.PiezometricHeadPhreaticLine2Inwards); Assert.AreEqual(penetrationLength, input.PenetrationLength); Assert.AreEqual(adjustPhreaticLine3And4ForUplift, input.AdjustPhreaticLine3And4ForUplift); Assert.AreEqual(dikeSoilScenario, input.DikeSoilScenario); Assert.AreEqual(waterVolumetricWeight, input.WaterVolumetricWeight); }
private bool Equals(TestSoilProfile other) { return(string.Equals(Name, other.Name)); }