public void LevelCrestStructureNotClosing_Always_ExpectedValues() { // Setup var random = new Random(22); var input = new ClosingStructuresInput(); var mean = (RoundedDouble)(0.01 + random.NextDouble()); var standardDeviation = (RoundedDouble)(0.01 + random.NextDouble()); var distributionToSet = new NormalDistribution(5) { Mean = mean, StandardDeviation = standardDeviation }; // Call input.LevelCrestStructureNotClosing = distributionToSet; // Assert var expectedDistribution = new NormalDistribution(2) { Mean = mean, StandardDeviation = standardDeviation }; DistributionTestHelper.AssertDistributionCorrectlySet(input.LevelCrestStructureNotClosing, distributionToSet, expectedDistribution); }
public void WidthFlowApertures_Always_ExpectedValues() { // Setup var random = new Random(22); var input = new SimpleStructuresInput(); var mean = (RoundedDouble)(0.01 + random.NextDouble()); var standardDeviation = (RoundedDouble)(0.01 + random.NextDouble()); var distributionToSet = new NormalDistribution(5) { Mean = mean, StandardDeviation = standardDeviation }; // Call input.WidthFlowApertures = distributionToSet; // Assert var expectedDistribution = new NormalDistribution(2) { Mean = mean, StandardDeviation = standardDeviation }; DistributionTestHelper.AssertDistributionCorrectlySet(input.WidthFlowApertures, distributionToSet, expectedDistribution); }
public void AreaFlowApertures_Always_ExpectedValues() { // Setup var random = new Random(22); var input = new ClosingStructuresInput(); RoundedDouble mean = random.NextRoundedDouble(0.01, 1.0); RoundedDouble standardDeviation = random.NextRoundedDouble(0.01, 1.0); var distributionToSet = new LogNormalDistribution(5) { Mean = mean, StandardDeviation = standardDeviation }; // Call input.AreaFlowApertures = distributionToSet; // Assert var expectedDistribution = new LogNormalDistribution(2) { Mean = mean, StandardDeviation = standardDeviation }; DistributionTestHelper.AssertDistributionCorrectlySet(input.AreaFlowApertures, distributionToSet, expectedDistribution); }
public void Permeability_Always_ExpectedValues() { // Setup var random = new Random(21); var layer = new PipingSoilLayer(random.NextDouble()); var distributionToSet = new VariationCoefficientLogNormalDistribution { Mean = random.NextRoundedDouble(), CoefficientOfVariation = random.NextRoundedDouble(), Shift = random.NextRoundedDouble() }; // Call layer.Permeability = distributionToSet; // Assert var expectedDistribution = new VariationCoefficientLogNormalDistribution(6) { Mean = distributionToSet.Mean, CoefficientOfVariation = distributionToSet.CoefficientOfVariation, Shift = layer.DiameterD70.Shift }; DistributionTestHelper.AssertDistributionCorrectlySet(layer.Permeability, distributionToSet, expectedDistribution); }
public void CriticalOvertoppingDischarge_Always_ExpectedValues() { // Setup var random = new Random(22); var input = new SimpleStructuresInput(); var mean = (RoundedDouble)(0.01 + random.NextDouble()); var variation = (RoundedDouble)(0.01 + random.NextDouble()); var distributionToSet = new VariationCoefficientLogNormalDistribution(5) { Mean = mean, CoefficientOfVariation = variation }; // Call input.CriticalOvertoppingDischarge = distributionToSet; // Assert var expectedDistribution = new VariationCoefficientLogNormalDistribution(2) { Mean = mean, CoefficientOfVariation = variation }; DistributionTestHelper.AssertDistributionCorrectlySet(input.CriticalOvertoppingDischarge, distributionToSet, expectedDistribution); }
public void BelowPhreaticLevel_Always_ExpectedValues() { // Setup var random = new Random(21); var layer = new PipingSoilLayer(random.NextDouble()); var distributionToSet = new LogNormalDistribution { Mean = random.NextRoundedDouble(), StandardDeviation = random.NextRoundedDouble(), Shift = random.NextRoundedDouble() }; // Call layer.BelowPhreaticLevel = distributionToSet; // Assert var expectedDistribution = new LogNormalDistribution(2) { Mean = distributionToSet.Mean, StandardDeviation = distributionToSet.StandardDeviation, Shift = distributionToSet.Shift }; DistributionTestHelper.AssertDistributionCorrectlySet(layer.BelowPhreaticLevel, distributionToSet, expectedDistribution); }
public void ShipVelocity_Always_ExpectedValues() { // Setup var random = new Random(22); var input = new StabilityPointStructuresInput(); var mean = (RoundedDouble)(0.01 + random.NextDouble()); var variation = (RoundedDouble)(0.01 + random.NextDouble()); var distributionToSet = new VariationCoefficientNormalDistribution(5) { Mean = mean, CoefficientOfVariation = variation }; // Call input.ShipVelocity = distributionToSet; // Assert var expectedDistribution = new VariationCoefficientNormalDistribution(2) { Mean = mean, CoefficientOfVariation = variation }; DistributionTestHelper.AssertDistributionCorrectlySet(input.ShipVelocity, distributionToSet, expectedDistribution); }
public void ThresholdHeightOpenWeir_Always_ExpectedValues() { // Setup var random = new Random(22); var input = new StabilityPointStructuresInput(); var mean = (RoundedDouble)(0.01 + random.NextDouble()); var standardDeviation = (RoundedDouble)(0.01 + random.NextDouble()); var distributionToSet = new NormalDistribution(5) { Mean = mean, StandardDeviation = standardDeviation }; // Call input.ThresholdHeightOpenWeir = distributionToSet; // Assert var expectedDistribution = new NormalDistribution(2) { Mean = mean, StandardDeviation = standardDeviation }; DistributionTestHelper.AssertDistributionCorrectlySet(input.ThresholdHeightOpenWeir, distributionToSet, expectedDistribution); }
public void ConstructiveStrengthQuadraticLoadModel_Always_ExpectedValues() { // Setup var random = new Random(22); var input = new StabilityPointStructuresInput(); var mean = (RoundedDouble)(0.01 + random.NextDouble()); var variation = (RoundedDouble)(0.01 + random.NextDouble()); var distributionToSet = new VariationCoefficientLogNormalDistribution(5) { Mean = mean, CoefficientOfVariation = variation }; // Call input.ConstructiveStrengthQuadraticLoadModel = distributionToSet; // Assert var expectedDistribution = new VariationCoefficientLogNormalDistribution(2) { Mean = mean, CoefficientOfVariation = variation }; DistributionTestHelper.AssertDistributionCorrectlySet(input.ConstructiveStrengthQuadraticLoadModel, distributionToSet, expectedDistribution); }
public void DrainCoefficient_Always_ExpectedValues() { // Setup var random = new Random(22); var input = new StabilityPointStructuresInput(); RoundedDouble mean = random.NextRoundedDouble(0.01, 1.0); RoundedDouble standardDeviation = random.NextRoundedDouble(0.01, 1.0); var distributionToSet = new LogNormalDistribution(5) { Mean = mean, StandardDeviation = standardDeviation }; // Call input.DrainCoefficient = distributionToSet; // Assert var expectedDistribution = new LogNormalDistribution(2) { Mean = mean, StandardDeviation = standardDeviation }; DistributionTestHelper.AssertDistributionCorrectlySet(input.DrainCoefficient, distributionToSet, expectedDistribution); }
public void InsideWaterLevelFailureConstruction_Always_ExpectedValues() { // Setup var random = new Random(22); var input = new StabilityPointStructuresInput(); var mean = (RoundedDouble)(0.01 + random.NextDouble()); var standardDeviation = (RoundedDouble)(0.01 + random.NextDouble()); var distributionToSet = new NormalDistribution(5) { Mean = mean, StandardDeviation = standardDeviation }; // Call input.InsideWaterLevelFailureConstruction = distributionToSet; // Assert var expectedDistribution = new NormalDistribution(2) { Mean = mean, StandardDeviation = standardDeviation }; DistributionTestHelper.AssertDistributionCorrectlySet(input.InsideWaterLevelFailureConstruction, distributionToSet, expectedDistribution); }
public void CriticalFlowRate_SetNewValue_GetNewValues() { // Setup var random = new Random(22); var input = new GrassCoverErosionInwardsInput(); RoundedDouble mean = random.NextRoundedDouble(0.01, double.MaxValue); RoundedDouble standardDeviation = random.NextRoundedDouble(0.01, double.MaxValue); var expectedDistribution = new LogNormalDistribution(4) { Mean = mean, StandardDeviation = standardDeviation }; var distributionToSet = new LogNormalDistribution(5) { Mean = mean, StandardDeviation = standardDeviation }; // Call input.CriticalFlowRate = distributionToSet; // Assert DistributionTestHelper.AssertDistributionCorrectlySet(input.CriticalFlowRate, distributionToSet, expectedDistribution); }
public void Pop_Always_ExpectedValues() { // Setup var random = new Random(21); var data = new MacroStabilityInwardsSoilLayerData(); var distributionToSet = new VariationCoefficientLogNormalDistribution { Mean = random.NextRoundedDouble(), CoefficientOfVariation = random.NextRoundedDouble(), Shift = random.NextRoundedDouble() }; // Call data.Pop = distributionToSet; // Assert var expectedDistribution = new VariationCoefficientLogNormalDistribution(2) { Mean = distributionToSet.Mean, CoefficientOfVariation = distributionToSet.CoefficientOfVariation, Shift = data.Pop.Shift }; DistributionTestHelper.AssertDistributionCorrectlySet(data.Pop, distributionToSet, expectedDistribution); }
public void StormDuration_Always_ExpectedValues() { // Setup var random = new Random(22); var input = new SimpleStructuresInput(); RoundedDouble mean = random.NextRoundedDouble(0.01, 1.0); var expectedDistribution = new VariationCoefficientLogNormalDistribution(2) { Mean = mean, CoefficientOfVariation = input.StormDuration.CoefficientOfVariation }; var distributionToSet = new VariationCoefficientLogNormalDistribution(5) { Mean = mean, CoefficientOfVariation = random.NextRoundedDouble() }; // Call input.StormDuration = distributionToSet; // Assert DistributionTestHelper.AssertDistributionCorrectlySet(input.StormDuration, distributionToSet, expectedDistribution); }
public void ModelFactorSuperCriticalFlow_Always_ExpectedValues() { // Setup var random = new Random(22); var input = new HeightStructuresInput(); RoundedDouble mean = random.NextRoundedDouble(0.01, 1.0); var expectedDistribution = new NormalDistribution(2) { Mean = mean, StandardDeviation = input.ModelFactorSuperCriticalFlow.StandardDeviation }; var distributionToSet = new NormalDistribution(5) { Mean = mean, StandardDeviation = random.NextRoundedDouble() }; // Call input.ModelFactorSuperCriticalFlow = distributionToSet; // Assert DistributionTestHelper.AssertDistributionCorrectlySet(input.ModelFactorSuperCriticalFlow, distributionToSet, expectedDistribution); }
public void DampingFactorExit_SetNewValue_UpdateMeanAndStandardDeviation() { // Setup var random = new Random(22); var input = new TestPipingInput(); var mean = (RoundedDouble)(0.01 + random.NextDouble()); var standardDeviation = (RoundedDouble)(0.01 + random.NextDouble()); var expectedDistribution = new LogNormalDistribution(3) { Mean = mean, StandardDeviation = standardDeviation }; var distributionToSet = new LogNormalDistribution(5) { Mean = mean, StandardDeviation = standardDeviation }; // Call input.DampingFactorExit = distributionToSet; // Assert DistributionTestHelper.AssertDistributionCorrectlySet(input.DampingFactorExit, distributionToSet, expectedDistribution); }