Index: Riskeer/Integration/src/Riskeer.Integration.IO/Factories/ExportableAssemblyFactory.cs
===================================================================
diff -u -rb7414e083e86a5b6e91294ed7c38477ed119b042 -r22862b0450a931d23bb13ab79874e54a05df5772
--- Riskeer/Integration/src/Riskeer.Integration.IO/Factories/ExportableAssemblyFactory.cs (.../ExportableAssemblyFactory.cs) (revision b7414e083e86a5b6e91294ed7c38477ed119b042)
+++ Riskeer/Integration/src/Riskeer.Integration.IO/Factories/ExportableAssemblyFactory.cs (.../ExportableAssemblyFactory.cs) (revision 22862b0450a931d23bb13ab79874e54a05df5772)
@@ -40,8 +40,7 @@
/// The to create
/// an for.
/// An with assembly results.
- /// Thrown when
- /// is null.
+ /// Thrown when is null.
/// Thrown when no reference line is set for .
/// Thrown when assembly results cannot be created for .
/// Thrown when assembly results are invalid and cannot be exported.
@@ -54,15 +53,14 @@
var idGenerator = new IdentifierGenerator();
- ExportableAssessmentSection exportableAssessmentSection = ExportableAssessmentSectionFactory.CreateExportableAssessmentSection(idGenerator, assessmentSection);
- ExportableAssessmentProcess exportableAssessmentProcess = CreateAssessmentProcess(idGenerator);
+ ExportableAssessmentSection exportableAssessmentSection = ExportableAssessmentSectionFactory.CreateExportableAssessmentSection(
+ idGenerator, assessmentSection);
- return new ExportableAssembly(idGenerator.GetNewId(Resources.ExportableAssembly_IdPrefix), exportableAssessmentSection, exportableAssessmentProcess);
- }
+ var exportableAssessmentProcess = new ExportableAssessmentProcess(idGenerator.GetNewId(Resources.ExportableAssessmentProcess_IdPrefix),
+ 2023, 2035);
- private static ExportableAssessmentProcess CreateAssessmentProcess(IdentifierGenerator idGenerator)
- {
- return new ExportableAssessmentProcess(idGenerator.GetNewId(Resources.ExportableAssessmentProcess_IdPrefix), 2023, 2035);
+ return new ExportableAssembly(idGenerator.GetNewId(Resources.ExportableAssembly_IdPrefix),
+ exportableAssessmentSection, exportableAssessmentProcess);
}
}
}
\ No newline at end of file
Index: Riskeer/Integration/test/Riskeer.Integration.IO.Test/Factories/ExportableAssemblyFactoryTest.cs
===================================================================
diff -u -r30d63f2cf5c708feb8ea4b0a74ac29d65658e685 -r22862b0450a931d23bb13ab79874e54a05df5772
--- Riskeer/Integration/test/Riskeer.Integration.IO.Test/Factories/ExportableAssemblyFactoryTest.cs (.../ExportableAssemblyFactoryTest.cs) (revision 30d63f2cf5c708feb8ea4b0a74ac29d65658e685)
+++ Riskeer/Integration/test/Riskeer.Integration.IO.Test/Factories/ExportableAssemblyFactoryTest.cs (.../ExportableAssemblyFactoryTest.cs) (revision 22862b0450a931d23bb13ab79874e54a05df5772)
@@ -26,6 +26,7 @@
using Riskeer.AssemblyTool.IO.Model;
using Riskeer.AssemblyTool.KernelWrapper.TestUtil.Calculators;
using Riskeer.Common.Data.AssessmentSection;
+using Riskeer.Common.Data.FailureMechanism;
using Riskeer.Common.Data.TestUtil;
using Riskeer.Integration.Data;
using Riskeer.Integration.IO.Factories;
@@ -55,8 +56,13 @@
var random = new Random(21);
var assessmentSection = new AssessmentSection(random.NextEnumValue())
{
- Id = id
+ Id = id,
+ SpecificFailureMechanisms =
+ {
+ new SpecificFailureMechanism()
+ }
};
+
ReferenceLineTestFactory.SetReferenceLineGeometry(assessmentSection.ReferenceLine);
AddFailureMechanismSections(assessmentSection);
@@ -92,6 +98,8 @@
FailureMechanismTestHelper.AddSections(assessmentSection.GrassCoverSlipOffInwards, random.Next(1, 10));
FailureMechanismTestHelper.AddSections(assessmentSection.PipingStructure, random.Next(1, 10));
FailureMechanismTestHelper.AddSections(assessmentSection.WaterPressureAsphaltCover, random.Next(1, 10));
+
+ FailureMechanismTestHelper.AddSections(assessmentSection.SpecificFailureMechanisms.First(), random.Next(1, 10));
}
private static void AssertExportableAssessmentSection(
@@ -103,7 +111,7 @@
int nrOfFailureMechanisms = assessmentSection.GetFailureMechanisms()
.Concat(assessmentSection.SpecificFailureMechanisms.Select(fm => fm))
- .Count(fm => fm.InAssembly);
+ .Count();
Assert.AreEqual(nrOfFailureMechanisms, exportableAssessmentSection.FailureMechanisms.Count());
Assert.AreEqual(1, exportableAssessmentSection.CombinedSectionAssemblies.Count());
}