Index: Application/Ringtoets/src/Application.Ringtoets.Storage/Read/FailureMechanismEntityReadExtensions.cs
===================================================================
diff -u -r36d4b4090a4169cc8d25ede0029a3244df8fe74d -r899d227631395ebeb5154719f7b92a42ddbc6f96
--- Application/Ringtoets/src/Application.Ringtoets.Storage/Read/FailureMechanismEntityReadExtensions.cs (.../FailureMechanismEntityReadExtensions.cs) (revision 36d4b4090a4169cc8d25ede0029a3244df8fe74d)
+++ Application/Ringtoets/src/Application.Ringtoets.Storage/Read/FailureMechanismEntityReadExtensions.cs (.../FailureMechanismEntityReadExtensions.cs) (revision 899d227631395ebeb5154719f7b92a42ddbc6f96)
@@ -35,6 +35,7 @@
using Application.Ringtoets.Storage.Read.StabilityPointStructures;
using Application.Ringtoets.Storage.Read.StabilityStoneCover;
using Application.Ringtoets.Storage.Read.WaveImpactAsphaltCover;
+using Core.Common.Base.Data;
using Ringtoets.ClosingStructures.Data;
using Ringtoets.Common.Data;
using Ringtoets.Common.Data.Calculation;
@@ -590,10 +591,26 @@
/// The to create for.
/// The target of the read operation.
/// The object keeping track of read operations.
+ /// Thrown when any input parameter is null.
internal static void ReadAsMacroStabilityOutwardsFailureMechanism(this FailureMechanismEntity entity,
MacroStabilityOutwardsFailureMechanism failureMechanism,
ReadConversionCollector collector)
{
+ if (entity == null)
+ {
+ throw new ArgumentNullException(nameof(entity));
+ }
+
+ if (failureMechanism == null)
+ {
+ throw new ArgumentNullException(nameof(failureMechanism));
+ }
+
+ if (collector == null)
+ {
+ throw new ArgumentNullException(nameof(collector));
+ }
+
entity.ReadCommonFailureMechanismProperties(failureMechanism, collector);
entity.ReadMacroStabilityOutwardsMechanismSectionResults(failureMechanism, collector);
MacroStabilityOutwardsFailureMechanismMetaEntity metaEntity = entity.MacroStabilityOutwardsFailureMechanismMetaEntities.Single();
@@ -835,12 +852,30 @@
/// The to create for.
/// The target of the read operation.
/// The object keeping track of read operations.
+ /// Thrown when any input parameter is null.
internal static void ReadAsPipingStructureFailureMechanism(this FailureMechanismEntity entity,
PipingStructureFailureMechanism failureMechanism,
ReadConversionCollector collector)
{
+ if (entity == null)
+ {
+ throw new ArgumentNullException(nameof(entity));
+ }
+
+ if (failureMechanism == null)
+ {
+ throw new ArgumentNullException(nameof(failureMechanism));
+ }
+
+ if (collector == null)
+ {
+ throw new ArgumentNullException(nameof(collector));
+ }
+
entity.ReadCommonFailureMechanismProperties(failureMechanism, collector);
entity.ReadPipingStructureMechanismSectionResults(failureMechanism, collector);
+
+ failureMechanism.N = (RoundedDouble) entity.PipingStructureFailureMechanismMetaEntities.Single().N;
}
private static void ReadPipingStructureMechanismSectionResults(this FailureMechanismEntity entity,