Index: Riskeer/Integration/src/Riskeer.Integration.IO/Factories/ExportableAssessmentSectionFactory.cs =================================================================== diff -u -rbcf0420076bfeba700c32ead5237bc1acff06b18 -r5845c5ccca1cf904694a71f51492fdf596b3c0eb --- Riskeer/Integration/src/Riskeer.Integration.IO/Factories/ExportableAssessmentSectionFactory.cs (.../ExportableAssessmentSectionFactory.cs) (revision bcf0420076bfeba700c32ead5237bc1acff06b18) +++ Riskeer/Integration/src/Riskeer.Integration.IO/Factories/ExportableAssessmentSectionFactory.cs (.../ExportableAssessmentSectionFactory.cs) (revision 5845c5ccca1cf904694a71f51492fdf596b3c0eb) @@ -92,7 +92,7 @@ failureMechanismSectionCollections, CreateExportableAssessmentSectionAssemblyResult(idGenerator, assessmentSection), CreateExportableFailureMechanisms(idGenerator, registry, assessmentSection), - CreateExportableCombinedSectionAssemblyCollection(idGenerator, registry, assessmentSection, failureMechanismSectionCollections)); + Enumerable.Empty()); } /// @@ -298,41 +298,5 @@ idGenerator, registry, fm.Sections)) .ToList(); } - - /// - /// Creates a collection of based on . - /// - /// The generator to generate ids for the exportable components. - /// The to keep track of the created items. - /// The assessment section to create a collection of - /// for. - /// The of - /// . - /// An of . - /// Thrown when assembly results cannot be created for . - /// Thrown when assembly results are invalid and cannot be exported. - private static IEnumerable CreateExportableCombinedSectionAssemblyCollection( - IdentifierGenerator idGenerator, ExportableModelRegistry registry, AssessmentSection assessmentSection, - List failureMechanismSectionCollections) - { - IEnumerable combinedSectionAssemblyResults = - AssessmentSectionAssemblyFactory.AssembleCombinedPerFailureMechanismSection(assessmentSection) - .ToArray(); - - var exportableCombinedSectionAssemblyCollection = new List(); - - if (combinedSectionAssemblyResults.Any()) - { - failureMechanismSectionCollections.Add( - ExportableFailureMechanismSectionCollectionFactory.CreateExportableFailureMechanismSectionCollection( - idGenerator, registry, assessmentSection.ReferenceLine, combinedSectionAssemblyResults)); - - exportableCombinedSectionAssemblyCollection.AddRange( - ExportableCombinedSectionAssemblyFactory.CreateExportableCombinedSectionAssemblyCollection( - idGenerator, registry, combinedSectionAssemblyResults, assessmentSection)); - } - - return exportableCombinedSectionAssemblyCollection; - } } } \ No newline at end of file Fisheye: Tag 5845c5ccca1cf904694a71f51492fdf596b3c0eb refers to a dead (removed) revision in file `Riskeer/Integration/src/Riskeer.Integration.IO/Factories/ExportableCombinedSectionAssemblyFactory.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Riskeer/Integration/src/Riskeer.Integration.IO/Factories/ExportableFailureMechanismSectionCollectionFactory.cs =================================================================== diff -u -r64fc75f87a85b4f20e9c5a8438cee659371d1efd -r5845c5ccca1cf904694a71f51492fdf596b3c0eb --- Riskeer/Integration/src/Riskeer.Integration.IO/Factories/ExportableFailureMechanismSectionCollectionFactory.cs (.../ExportableFailureMechanismSectionCollectionFactory.cs) (revision 64fc75f87a85b4f20e9c5a8438cee659371d1efd) +++ Riskeer/Integration/src/Riskeer.Integration.IO/Factories/ExportableFailureMechanismSectionCollectionFactory.cs (.../ExportableFailureMechanismSectionCollectionFactory.cs) (revision 5845c5ccca1cf904694a71f51492fdf596b3c0eb) @@ -79,48 +79,5 @@ idGenerator.GetUniqueId(Resources.ExportableFailureMechanismSectionCollection_IdPrefix), exportableSections); } - - /// - /// Creates an based on a collection of - /// . - /// - /// The generator to generate ids for the exportable components. - /// The to keep track of the created items. - /// The to create the - /// with. - /// The collection of to create the - /// with. - /// An . - /// Thrown when any parameter is null. - public static ExportableFailureMechanismSectionCollection CreateExportableFailureMechanismSectionCollection( - IdentifierGenerator idGenerator, ExportableModelRegistry registry, - ReferenceLine referenceLine, IEnumerable assemblyResults) - { - if (idGenerator == null) - { - throw new ArgumentNullException(nameof(idGenerator)); - } - - if (registry == null) - { - throw new ArgumentNullException(nameof(registry)); - } - - if (referenceLine == null) - { - throw new ArgumentNullException(nameof(referenceLine)); - } - - if (assemblyResults == null) - { - throw new ArgumentNullException(nameof(assemblyResults)); - } - - return new ExportableFailureMechanismSectionCollection( - idGenerator.GetUniqueId(Resources.ExportableFailureMechanismSectionCollection_IdPrefix), - assemblyResults.Select(assemblyResult => ExportableFailureMechanismSectionFactory.CreateExportableCombinedFailureMechanismSection( - idGenerator, registry, referenceLine, assemblyResult)) - .ToArray()); - } } } \ No newline at end of file Index: Riskeer/Integration/test/Riskeer.Integration.IO.Test/Factories/ExportableAssemblyFactoryTest.cs =================================================================== diff -u -r80a56581e3ae390973d398e93f1cc9ac07782941 -r5845c5ccca1cf904694a71f51492fdf596b3c0eb --- Riskeer/Integration/test/Riskeer.Integration.IO.Test/Factories/ExportableAssemblyFactoryTest.cs (.../ExportableAssemblyFactoryTest.cs) (revision 80a56581e3ae390973d398e93f1cc9ac07782941) +++ Riskeer/Integration/test/Riskeer.Integration.IO.Test/Factories/ExportableAssemblyFactoryTest.cs (.../ExportableAssemblyFactoryTest.cs) (revision 5845c5ccca1cf904694a71f51492fdf596b3c0eb) @@ -86,11 +86,6 @@ .Count(); Assert.AreEqual(nrOfFailureMechanisms, result.AssessmentSection.FailureMechanisms.Count()); - var factory = (TestAssemblyToolCalculatorFactory) AssemblyToolCalculatorFactory.Instance; - AssessmentSectionAssemblyCalculatorStub calculator = factory.LastCreatedAssessmentSectionAssemblyCalculator; - Assert.AreEqual(calculator.CombinedFailureMechanismSectionAssemblyOutput.AssemblyResults.Count(), - result.AssessmentSection.CombinedSectionAssemblies.Count()); - Assert.AreEqual("Bp.0", result.AssessmentProcess.Id); Assert.AreEqual(2023, result.AssessmentProcess.StartYear); Assert.AreEqual(2035, result.AssessmentProcess.EndYear); Index: Riskeer/Integration/test/Riskeer.Integration.IO.Test/Factories/ExportableAssessmentSectionFactoryTest.cs =================================================================== diff -u -r80a56581e3ae390973d398e93f1cc9ac07782941 -r5845c5ccca1cf904694a71f51492fdf596b3c0eb --- Riskeer/Integration/test/Riskeer.Integration.IO.Test/Factories/ExportableAssessmentSectionFactoryTest.cs (.../ExportableAssessmentSectionFactoryTest.cs) (revision 80a56581e3ae390973d398e93f1cc9ac07782941) +++ Riskeer/Integration/test/Riskeer.Integration.IO.Test/Factories/ExportableAssessmentSectionFactoryTest.cs (.../ExportableAssessmentSectionFactoryTest.cs) (revision 5845c5ccca1cf904694a71f51492fdf596b3c0eb) @@ -109,13 +109,6 @@ .Cast>(), failureMechanismCalculator.AssemblyResultOutput, exportableAssessmentSection.FailureMechanisms); - - CombinedFailureMechanismSectionAssemblyResultWrapper combinedFailureMechanismAssemblyResult = assessmentSectionCalculator.CombinedFailureMechanismSectionAssemblyOutput; - AssertExportableFailureMechanismSectionCollections(assessmentSection, combinedFailureMechanismAssemblyResult.AssemblyResults.Count(), - exportableAssessmentSection.FailureMechanismSectionCollections); - AssertExportableCombinedFailureMechanismSectionAssemblyOutput( - combinedFailureMechanismAssemblyResult, exportableAssessmentSection.FailureMechanisms, - exportableAssessmentSection.CombinedSectionAssemblies); } } Fisheye: Tag 5845c5ccca1cf904694a71f51492fdf596b3c0eb refers to a dead (removed) revision in file `Riskeer/Integration/test/Riskeer.Integration.IO.Test/Factories/ExportableCombinedSectionAssemblyFactoryTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Riskeer/Integration/test/Riskeer.Integration.IO.Test/Factories/ExportableFailureMechanismSectionCollectionFactoryTest.cs =================================================================== diff -u -r17efbc2697a98e22b078162cef888e2608b17944 -r5845c5ccca1cf904694a71f51492fdf596b3c0eb --- Riskeer/Integration/test/Riskeer.Integration.IO.Test/Factories/ExportableFailureMechanismSectionCollectionFactoryTest.cs (.../ExportableFailureMechanismSectionCollectionFactoryTest.cs) (revision 17efbc2697a98e22b078162cef888e2608b17944) +++ Riskeer/Integration/test/Riskeer.Integration.IO.Test/Factories/ExportableFailureMechanismSectionCollectionFactoryTest.cs (.../ExportableFailureMechanismSectionCollectionFactoryTest.cs) (revision 5845c5ccca1cf904694a71f51492fdf596b3c0eb) @@ -129,110 +129,5 @@ Assert.AreEqual(20, thirdExportableSection.StartDistance); Assert.AreEqual(40, thirdExportableSection.EndDistance); } - - [Test] - public void CreateExportableFailureMechanismSectionCollectionWithCombinedAssemblyResults_IdGeneratorNull_ThrowsArgumentNullException() - { - // Call - void Call() => ExportableFailureMechanismSectionCollectionFactory.CreateExportableFailureMechanismSectionCollection( - null, new ExportableModelRegistry(), ReferenceLineTestFactory.CreateReferenceLineWithGeometry(), - Enumerable.Empty()); - - // Assert - var exception = Assert.Throws(Call); - Assert.AreEqual("idGenerator", exception.ParamName); - } - - [Test] - public void CreateExportableFailureMechanismSectionCollectionWithCombinedAssemblyResults_RegistryNull_ThrowsArgumentNullException() - { - // Call - void Call() => ExportableFailureMechanismSectionCollectionFactory.CreateExportableFailureMechanismSectionCollection( - new IdentifierGenerator(), null, ReferenceLineTestFactory.CreateReferenceLineWithGeometry(), - Enumerable.Empty()); - - // Assert - var exception = Assert.Throws(Call); - Assert.AreEqual("registry", exception.ParamName); - } - - [Test] - public void CreateExportableFailureMechanismSectionCollectionWithCombinedAssemblyResults_ReferenceLineNull_ThrowsArgumentNullException() - { - // Call - void Call() => ExportableFailureMechanismSectionCollectionFactory.CreateExportableFailureMechanismSectionCollection( - new IdentifierGenerator(), new ExportableModelRegistry(), null, - Enumerable.Empty()); - - // Assert - var exception = Assert.Throws(Call); - Assert.AreEqual("referenceLine", exception.ParamName); - } - - [Test] - public void CreateExportableFailureMechanismSectionCollectionWithCombinedAssemblyResults_AssemblyResultsNull_ThrowsArgumentNullException() - { - // Call - void Call() => ExportableFailureMechanismSectionCollectionFactory.CreateExportableFailureMechanismSectionCollection( - new IdentifierGenerator(), new ExportableModelRegistry(), ReferenceLineTestFactory.CreateReferenceLineWithGeometry(), null); - - // Assert - var exception = Assert.Throws(Call); - Assert.AreEqual("assemblyResults", exception.ParamName); - } - - [Test] - public void CreateExportableFailureMechanismSectionCollectionWithCombinedAssemblyResults_WithValidArguments_ReturnsExpectedExportableFailureMechanismSectionCollection() - { - // Setup - var idGenerator = new IdentifierGenerator(); - var registry = new ExportableModelRegistry(); - - CombinedFailureMechanismSectionAssemblyResult[] assemblyResults = - { - CombinedFailureMechanismSectionAssemblyResultTestFactory.Create(0, 5), - CombinedFailureMechanismSectionAssemblyResultTestFactory.Create(5, 10), - CombinedFailureMechanismSectionAssemblyResultTestFactory.Create(10, 15) - }; - - var referenceLine = new ReferenceLine(); - referenceLine.SetGeometry(new[] - { - new Point2D(0, 0), - new Point2D(10, 10) - }); - - // Call - ExportableFailureMechanismSectionCollection collection = - ExportableFailureMechanismSectionCollectionFactory.CreateExportableFailureMechanismSectionCollection( - idGenerator, registry, referenceLine, assemblyResults); - - // Assert - Assert.AreEqual("Vi.0", collection.Id); - Assert.AreEqual(assemblyResults.Length, collection.Sections.Count()); - CollectionAssert.AllItemsAreInstancesOfType(collection.Sections, typeof(ExportableCombinedFailureMechanismSection)); - - IEnumerable exportableSections = - collection.Sections.Cast(); - - for (var i = 0; i < assemblyResults.Length; i++) - { - AssertExportableCombinedFailureMechanismSection(i, referenceLine, assemblyResults[i], exportableSections.ElementAt(i)); - } - } - - private static void AssertExportableCombinedFailureMechanismSection(int index, ReferenceLine referenceLine, - CombinedFailureMechanismSectionAssemblyResult assemblyResult, - ExportableCombinedFailureMechanismSection exportableCombinedFailureMechanismSection) - { - Assert.AreEqual($"Bv.{index}", exportableCombinedFailureMechanismSection.Id); - Assert.AreEqual(assemblyResult.SectionStart, exportableCombinedFailureMechanismSection.StartDistance); - Assert.AreEqual(assemblyResult.SectionEnd, exportableCombinedFailureMechanismSection.EndDistance); - CollectionAssert.AreEqual(FailureMechanismSectionHelper.GetFailureMechanismSectionGeometry( - referenceLine, assemblyResult.SectionStart, assemblyResult.SectionEnd), - exportableCombinedFailureMechanismSection.Geometry); - Assert.AreEqual(ExportableAssemblyMethodConverter.ConvertTo(assemblyResult.CommonSectionAssemblyMethod), - exportableCombinedFailureMechanismSection.AssemblyMethod); - } } } \ No newline at end of file Index: Riskeer/Integration/test/Riskeer.Integration.IO.Test/test-data/AssemblyExporter/ExpectedGml.gml =================================================================== diff -u -r2422ed59260df5a807ee022943dd4329840db76b -r5845c5ccca1cf904694a71f51492fdf596b3c0eb --- Riskeer/Integration/test/Riskeer.Integration.IO.Test/test-data/AssemblyExporter/ExpectedGml.gml (.../ExpectedGml.gml) (revision 2422ed59260df5a807ee022943dd4329840db76b) +++ Riskeer/Integration/test/Riskeer.Integration.IO.Test/test-data/AssemblyExporter/ExpectedGml.gml (.../ExpectedGml.gml) (revision 5845c5ccca1cf904694a71f51492fdf596b3c0eb) @@ -526,312 +526,6 @@ - - +II - BOI-3C-1 - VOLLDG - - - - - - - +II - BOI-3B-1 - VOLLDG - - - - - - - +II - BOI-3B-1 - VOLLDG - - - - - - - +II - BOI-3B-1 - VOLLDG - - - - - - - +II - BOI-3B-1 - VOLLDG - - - - - - - +II - BOI-3B-1 - VOLLDG - - - - - - - +II - BOI-3B-1 - VOLLDG - - - - - - - +II - BOI-3B-1 - VOLLDG - - - - - - - +II - BOI-3B-1 - VOLLDG - - - - - - - +II - BOI-3B-1 - VOLLDG - - - - - - - +II - BOI-3B-1 - VOLLDG - - - - - - - +II - BOI-3B-1 - VOLLDG - - - - - - - +II - BOI-3B-1 - VOLLDG - - - - - - - +II - BOI-3B-1 - VOLLDG - - - - - - - +II - BOI-3B-1 - VOLLDG - - - - - - - +II - BOI-3B-1 - VOLLDG - - - - - - - +II - BOI-3B-1 - VOLLDG - - - - - - - +III - BOI-3C-1 - VOLLDG - - - - - - - +III - BOI-3B-1 - VOLLDG - - - - - - - +III - BOI-3B-1 - VOLLDG - - - - - - - +III - BOI-3B-1 - VOLLDG - - - - - - - +III - BOI-3B-1 - VOLLDG - - - - - - - +III - BOI-3B-1 - VOLLDG - - - - - - - +III - BOI-3B-1 - VOLLDG - - - - - - - +III - BOI-3B-1 - VOLLDG - - - - - - - +III - BOI-3B-1 - VOLLDG - - - - - - - +III - BOI-3B-1 - VOLLDG - - - - - - - +III - BOI-3B-1 - VOLLDG - - - - - - - +III - BOI-3B-1 - VOLLDG - - - - - - - +III - BOI-3B-1 - VOLLDG - - - - - - - +III - BOI-3B-1 - VOLLDG - - - - - - - +III - BOI-3B-1 - VOLLDG - - - - - - - +III - BOI-3B-1 - VOLLDG - - - - - - - +III - BOI-3B-1 - VOLLDG - - - - - @@ -1327,37 +1021,4 @@ - - - - - - - - 0 0 1.5 2 - - - DEELVK - 0 - 2.5 - 2.5 - - BOI-3A-1 - - - - - - - 1.5 2 3 4 - - - DEELVK - 2.5 - 5 - 2.5 - - BOI-3A-1 - - \ No newline at end of file