Index: Ringtoets/Integration/src/Ringtoets.Integration.IO/Factories/ExportableAssessmentSectionFactory.cs =================================================================== diff -u -r0021d57d71421c62a6475e9c5be470babd7463ec -r9ef3756cb01fc3a3cf9e6504f550ffe6080429c1 --- Ringtoets/Integration/src/Ringtoets.Integration.IO/Factories/ExportableAssessmentSectionFactory.cs (.../ExportableAssessmentSectionFactory.cs) (revision 0021d57d71421c62a6475e9c5be470babd7463ec) +++ Ringtoets/Integration/src/Ringtoets.Integration.IO/Factories/ExportableAssessmentSectionFactory.cs (.../ExportableAssessmentSectionFactory.cs) (revision 9ef3756cb01fc3a3cf9e6504f550ffe6080429c1) @@ -1,13 +1,10 @@ using System; using System.Collections.Generic; using System.Linq; -using Ringtoets.AssemblyTool.Data; using Ringtoets.Common.Data.Exceptions; -using Ringtoets.Common.Data.FailureMechanism; using Ringtoets.Integration.Data; using Ringtoets.Integration.Data.Assembly; using Ringtoets.Integration.IO.Assembly; -using Ringtoets.Piping.Data; namespace Ringtoets.Integration.IO.Factories { @@ -61,10 +58,11 @@ private static IEnumerable> CreateExportableFailureMechanismsWithProbability(AssessmentSection assessmentSection) { - var exportableFailureMechanisms = new List>(); - exportableFailureMechanisms.Add(ExportablePipingFailureMechanismFactory.CreateExportablePipingFailureMechanism(assessmentSection.Piping, assessmentSection)); - - return exportableFailureMechanisms; + return new [] + { + ExportablePipingFailureMechanismFactory.CreateExportablePipingFailureMechanism(assessmentSection.Piping, assessmentSection), + ExportableMacroStabilityInwardsFailureMechanismFactory.CreateExportableMacroStabilityInwardsFailureMechanism(assessmentSection.MacroStabilityInwards, assessmentSection) + }; } } } \ No newline at end of file Index: Ringtoets/Integration/test/Ringtoets.Integration.IO.Test/Factories/ExportableAssessmentSectionFactoryTest.cs =================================================================== diff -u -rc2e9a5e79df79b62d9b56f851fcbe3166fe96507 -r9ef3756cb01fc3a3cf9e6504f550ffe6080429c1 --- Ringtoets/Integration/test/Ringtoets.Integration.IO.Test/Factories/ExportableAssessmentSectionFactoryTest.cs (.../ExportableAssessmentSectionFactoryTest.cs) (revision c2e9a5e79df79b62d9b56f851fcbe3166fe96507) +++ Ringtoets/Integration/test/Ringtoets.Integration.IO.Test/Factories/ExportableAssessmentSectionFactoryTest.cs (.../ExportableAssessmentSectionFactoryTest.cs) (revision 9ef3756cb01fc3a3cf9e6504f550ffe6080429c1) @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using System.Linq; using Core.Common.Base.Geometry; using Core.Common.TestUtil; @@ -49,6 +50,7 @@ }; FailureMechanismTestHelper.AddSections(assessmentSection.Piping, random.Next(1, 10)); + FailureMechanismTestHelper.AddSections(assessmentSection.MacroStabilityInwards, random.Next(1, 10)); using (new AssemblyToolCalculatorFactoryConfig()) { @@ -67,18 +69,36 @@ Assert.AreEqual(assessmentSectionAssemblyCalculator.AssembleAssessmentSectionCategoryGroupOutput, exportableAssessmentSectionAssemblyResult.AssemblyCategory); Assert.AreEqual(ExportableAssemblyMethod.WBI2C1, exportableAssessmentSectionAssemblyResult.AssemblyMethod); - Assert.AreEqual(1, exportableAssessmentSection.FailureMechanismsWithProbability.Count()); - ExportableFailureMechanism piping = exportableAssessmentSection.FailureMechanismsWithProbability.First(); - Assert.AreEqual(failureMechanismAssemblyCalculator.FailureMechanismAssemblyOutput.Group, piping.FailureMechanismAssembly.AssemblyCategory); - Assert.AreEqual(failureMechanismAssemblyCalculator.FailureMechanismAssemblyOutput.Probability, piping.FailureMechanismAssembly.Probability); - Assert.AreEqual(ExportableFailureMechanismType.STPH, piping.Code); - Assert.AreEqual(ExportableFailureMechanismGroup.Group2, piping.Group); - Assert.AreEqual(assessmentSection.Piping.Sections.Count(), piping.Sections.Count()); - Assert.AreEqual(assessmentSection.Piping.SectionResults.Count(), piping.SectionAssemblyResults.Count()); + AssertExportableFailureMechanismsWithProbability(exportableAssessmentSection.FailureMechanismsWithProbability, + failureMechanismAssemblyCalculator, + assessmentSection); CollectionAssert.IsEmpty(exportableAssessmentSection.FailureMechanismsWithoutProbability); Assert.IsNotNull(exportableAssessmentSection.CombinedSectionAssemblyResults); } } + + private static void AssertExportableFailureMechanismsWithProbability( + IEnumerable> exportableFailureMechanisms, + FailureMechanismAssemblyCalculatorStub failureMechanismAssemblyCalculator, + AssessmentSection assessmentSection) + { + Assert.AreEqual(2, exportableFailureMechanisms.Count()); + ExportableFailureMechanism piping = exportableFailureMechanisms.First(); + Assert.AreEqual(failureMechanismAssemblyCalculator.FailureMechanismAssemblyOutput.Group, piping.FailureMechanismAssembly.AssemblyCategory); + Assert.AreEqual(failureMechanismAssemblyCalculator.FailureMechanismAssemblyOutput.Probability, piping.FailureMechanismAssembly.Probability); + Assert.AreEqual(ExportableFailureMechanismType.STPH, piping.Code); + Assert.AreEqual(ExportableFailureMechanismGroup.Group2, piping.Group); + Assert.AreEqual(assessmentSection.Piping.Sections.Count(), piping.Sections.Count()); + Assert.AreEqual(assessmentSection.Piping.SectionResults.Count(), piping.SectionAssemblyResults.Count()); + + ExportableFailureMechanism macroStabilityInwards = exportableFailureMechanisms.ElementAt(1); + Assert.AreEqual(failureMechanismAssemblyCalculator.FailureMechanismAssemblyOutput.Group, macroStabilityInwards.FailureMechanismAssembly.AssemblyCategory); + Assert.AreEqual(failureMechanismAssemblyCalculator.FailureMechanismAssemblyOutput.Probability, macroStabilityInwards.FailureMechanismAssembly.Probability); + Assert.AreEqual(ExportableFailureMechanismType.STBI, macroStabilityInwards.Code); + Assert.AreEqual(ExportableFailureMechanismGroup.Group2, macroStabilityInwards.Group); + Assert.AreEqual(assessmentSection.MacroStabilityInwards.Sections.Count(), macroStabilityInwards.Sections.Count()); + Assert.AreEqual(assessmentSection.MacroStabilityInwards.SectionResults.Count(), macroStabilityInwards.SectionAssemblyResults.Count()); + } } } \ No newline at end of file