public void SimpleProperties_SetNewValues_NewValuesSet() { // Setup const string calculationName = "Name of the calculation"; const string hydraulicBoundaryLocation = "Name of the hydraulic boundary location"; const double targetProbability = 1.1; const double upperBoundaryRevetment = 2.2; const double lowerBoundaryRevetment = 3.3; const double upperBoundaryWaterLevels = 4.4; const double lowerBoundaryWaterLevels = 5.5; const ConfigurationWaveConditionsInputStepSize stepSize = ConfigurationWaveConditionsInputStepSize.Half; const string foreshoreProfileName = "Name of the foreshore profile"; const double orientation = 6.6; const bool useBreakWater = true; const ConfigurationBreakWaterType breakWaterType = ConfigurationBreakWaterType.Caisson; const double breakWaterHeight = 7.7; const bool useForeshore = false; // Call var readWaveConditionsCalculation = new WaveConditionsCalculationConfiguration(calculationName) { HydraulicBoundaryLocationName = hydraulicBoundaryLocation, TargetProbability = targetProbability, UpperBoundaryRevetment = upperBoundaryRevetment, LowerBoundaryRevetment = lowerBoundaryRevetment, UpperBoundaryWaterLevels = upperBoundaryWaterLevels, LowerBoundaryWaterLevels = lowerBoundaryWaterLevels, StepSize = stepSize, ForeshoreProfileId = foreshoreProfileName, Orientation = orientation, WaveReduction = new WaveReductionConfiguration { UseBreakWater = useBreakWater, BreakWaterType = breakWaterType, BreakWaterHeight = breakWaterHeight, UseForeshoreProfile = useForeshore } }; // Assert Assert.AreEqual(calculationName, readWaveConditionsCalculation.Name); Assert.AreEqual(hydraulicBoundaryLocation, readWaveConditionsCalculation.HydraulicBoundaryLocationName); Assert.AreEqual(targetProbability, readWaveConditionsCalculation.TargetProbability); Assert.AreEqual(upperBoundaryRevetment, readWaveConditionsCalculation.UpperBoundaryRevetment); Assert.AreEqual(lowerBoundaryRevetment, readWaveConditionsCalculation.LowerBoundaryRevetment); Assert.AreEqual(upperBoundaryWaterLevels, readWaveConditionsCalculation.UpperBoundaryWaterLevels); Assert.AreEqual(lowerBoundaryWaterLevels, readWaveConditionsCalculation.LowerBoundaryWaterLevels); Assert.AreEqual(stepSize, readWaveConditionsCalculation.StepSize); Assert.AreEqual(foreshoreProfileName, readWaveConditionsCalculation.ForeshoreProfileId); Assert.AreEqual(orientation, readWaveConditionsCalculation.Orientation); Assert.AreEqual(useBreakWater, readWaveConditionsCalculation.WaveReduction.UseBreakWater); Assert.AreEqual(breakWaterType, readWaveConditionsCalculation.WaveReduction.BreakWaterType); Assert.AreEqual(breakWaterHeight, readWaveConditionsCalculation.WaveReduction.BreakWaterHeight); Assert.AreEqual(useForeshore, readWaveConditionsCalculation.WaveReduction.UseForeshoreProfile); }
private static void AssertConfiguration(WaveConditionsCalculationConfiguration configuration) { Assert.IsNotNull(configuration); Assert.AreEqual("Locatie", configuration.HydraulicBoundaryLocationName); Assert.AreEqual(1.1, configuration.UpperBoundaryRevetment); Assert.AreEqual(2.2, configuration.LowerBoundaryRevetment); Assert.AreEqual(3.3, configuration.UpperBoundaryWaterLevels); Assert.AreEqual(4.4, configuration.LowerBoundaryWaterLevels); Assert.AreEqual(ConfigurationWaveConditionsInputStepSize.Half, configuration.StepSize); Assert.AreEqual("Voorlandprofiel", configuration.ForeshoreProfileId); Assert.AreEqual(5.5, configuration.Orientation); Assert.IsTrue(configuration.WaveReduction.UseBreakWater); Assert.AreEqual(ConfigurationBreakWaterType.Caisson, configuration.WaveReduction.BreakWaterType); Assert.AreEqual(6.6, configuration.WaveReduction.BreakWaterHeight); Assert.IsFalse(configuration.WaveReduction.UseForeshoreProfile); }
public void Constructor_WithName_ExpectedValues() { // Setup const string name = "some name"; // Call var readCalculation = new WaveConditionsCalculationConfiguration(name); // Assert Assert.IsInstanceOf <IConfigurationItem>(readCalculation); Assert.AreEqual(name, readCalculation.Name); Assert.IsNull(readCalculation.HydraulicBoundaryLocationName); Assert.IsNull(readCalculation.TargetProbability); Assert.IsNull(readCalculation.UpperBoundaryRevetment); Assert.IsNull(readCalculation.LowerBoundaryRevetment); Assert.IsNull(readCalculation.UpperBoundaryWaterLevels); Assert.IsNull(readCalculation.LowerBoundaryWaterLevels); Assert.IsNull(readCalculation.StepSize); Assert.IsNull(readCalculation.ForeshoreProfileId); Assert.IsNull(readCalculation.Orientation); Assert.IsNull(readCalculation.WaveReduction); }