Index: Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/HydraRingConfiguration.cs =================================================================== diff -u -r78bf55af8849866f8a6d1636508db4a8142ae69d -r4f65e684123e5d1a3ba8716d99752311dbbb67e2 --- Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/HydraRingConfiguration.cs (.../HydraRingConfiguration.cs) (revision 78bf55af8849866f8a6d1636508db4a8142ae69d) +++ Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/HydraRingConfiguration.cs (.../HydraRingConfiguration.cs) (revision 4f65e684123e5d1a3ba8716d99752311dbbb67e2) @@ -48,14 +48,20 @@ public HydraulicBoundaryLocation HydraulicBoundaryLocation { get; set; } /// + /// Gets or sets the . + /// + public HydraRingFailureMechanismType? HydraRingFailureMechanismType { get; set; } + + /// /// Generates a database creation script that can be used to perform a Hydra-Ring calculation. /// /// The database creation script. + /// Thrown when one of the relevant input properties is not set. public string GenerateDataBaseCreationScript() { var configurationDictionary = new Dictionary>(); - ValidateInput(); + ValidateDataBaseCreationScriptInput(); InitializeHydraulicModelsConfiguration(configurationDictionary); InitializeSectionsConfiguration(configurationDictionary); @@ -66,7 +72,7 @@ return GenerateDataBaseCreationScript(configurationDictionary); } - private void ValidateInput() + private void ValidateDataBaseCreationScriptInput() { var formattedExceptionMessage = "Cannot generate database creation script: {0} unspecified."; @@ -79,6 +85,16 @@ { throw new InvalidOperationException(string.Format(formattedExceptionMessage, "HydraRingUncertaintiesType")); } + + if (HydraulicBoundaryLocation == null) + { + throw new InvalidOperationException(string.Format(formattedExceptionMessage, "HydraulicBoundaryLocation")); + } + + if (HydraRingFailureMechanismType == null) + { + throw new InvalidOperationException(string.Format(formattedExceptionMessage, "HydraRingFailureMechanismType")); + } } private void InitializeHydraulicModelsConfiguration(Dictionary> configurationDictionary) @@ -134,10 +150,10 @@ "YCoordinate", null // TODO: Dike cross section integration }, { - "StationId1", HydraulicBoundaryLocation != null ? (long?) HydraulicBoundaryLocation.Id : null + "StationId1", HydraulicBoundaryLocation.Id }, { - "StationId2", HydraulicBoundaryLocation != null ? (long?) HydraulicBoundaryLocation.Id : null // Same as "StationId1": no support for coupling two stations + "StationId2", HydraulicBoundaryLocation.Id // Same as "StationId1": no support for coupling two stations }, { "Relative", 100.0 // Fixed: no support for coupling two stations