Index: Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Data/ClosingStructuresFailureMechanismSectionResultAssemblyFactory.cs =================================================================== diff -u -r6caa18ed981739a891762c1dab4e97c0593aedbb -r344e4eb60e8d9343ad55ad44291d2452bb9c3ae7 --- Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Data/ClosingStructuresFailureMechanismSectionResultAssemblyFactory.cs (.../ClosingStructuresFailureMechanismSectionResultAssemblyFactory.cs) (revision 6caa18ed981739a891762c1dab4e97c0593aedbb) +++ Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Data/ClosingStructuresFailureMechanismSectionResultAssemblyFactory.cs (.../ClosingStructuresFailureMechanismSectionResultAssemblyFactory.cs) (revision 344e4eb60e8d9343ad55ad44291d2452bb9c3ae7) @@ -176,5 +176,53 @@ throw new AssemblyException(e.Message, e); } } + + /// + /// Assembles the combined assembly. + /// + /// The failure mechanism section result to + /// combine the assemblies for. + /// The failure mechanism belonging to this section. + /// The belonging to this section. + /// A . + /// Thrown when any parameter is null. + /// Thrown when the + /// could not be created. + public static FailureMechanismSectionAssembly AssembleCombinedAssembly(ClosingStructuresFailureMechanismSectionResult failureMechanismSectionResult, + ClosingStructuresFailureMechanism failureMechanism, + IAssessmentSection assessmentSection) + { + if (failureMechanismSectionResult == null) + { + throw new ArgumentNullException(nameof(failureMechanismSectionResult)); + } + + if (failureMechanism == null) + { + throw new ArgumentNullException(nameof(failureMechanism)); + } + + if (assessmentSection == null) + { + throw new ArgumentNullException(nameof(assessmentSection)); + } + + FailureMechanismSectionAssembly simpleAssembly = AssembleSimpleAssessment(failureMechanismSectionResult); + FailureMechanismSectionAssembly detailedAssembly = AssembleDetailedAssembly(failureMechanismSectionResult, failureMechanism, assessmentSection); + FailureMechanismSectionAssembly tailorMadeAssembly = AssembleTailorMadeAssembly(failureMechanismSectionResult, failureMechanism, assessmentSection); + + IAssemblyToolCalculatorFactory calculatorFactory = AssemblyToolCalculatorFactory.Instance; + IFailureMechanismSectionAssemblyCalculator calculator = + calculatorFactory.CreateFailureMechanismSectionAssemblyCalculator(AssemblyToolKernelFactory.Instance); + + try + { + return calculator.AssembleCombined(simpleAssembly, detailedAssembly, tailorMadeAssembly); + } + catch (FailureMechanismSectionAssemblyCalculatorException e) + { + throw new AssemblyException(e.Message, e); + } + } } } \ No newline at end of file