Index: Riskeer/Common/src/Riskeer.Common.Forms/Factories/AssemblyMapDataFactory.cs =================================================================== diff -u -rda5b19a569a21677e10b2efc7c424e64d920907c -r9512b50e132cb9836f8a2c2a5276161ddfd4cebb --- Riskeer/Common/src/Riskeer.Common.Forms/Factories/AssemblyMapDataFactory.cs (.../AssemblyMapDataFactory.cs) (revision da5b19a569a21677e10b2efc7c424e64d920907c) +++ Riskeer/Common/src/Riskeer.Common.Forms/Factories/AssemblyMapDataFactory.cs (.../AssemblyMapDataFactory.cs) (revision 9512b50e132cb9836f8a2c2a5276161ddfd4cebb) @@ -34,51 +34,6 @@ private const LineDashStyle lineDashStyle = LineDashStyle.Solid; /// - /// Creates a for assembly results. - /// - /// The created . - public static MapDataCollection CreateAssemblyMapDataCollection() - { - return new MapDataCollection(Resources.AssemblyResult_DisplayName); - } - - /// - /// Creates a with default styling for a simple assembly. - /// - /// The created . - public static MapLineData CreateSimpleAssemblyMapData() - { - return CreateAssemblyMapLineData(Resources.AssemblyMapDataFactory_SimpleAssemblyMapData, false); - } - - /// - /// Creates a with default styling for a detailed assembly. - /// - /// The created . - public static MapLineData CreateDetailedAssemblyMapData() - { - return CreateAssemblyMapLineData(Resources.AssemblyMapDataFactory_DetailedAssemblyMapData, false); - } - - /// - /// Creates a with default styling for a tailor made assembly. - /// - /// The created . - public static MapLineData CreateTailorMadeAssemblyMapData() - { - return CreateAssemblyMapLineData(Resources.AssemblyMapDataFactory_TailorMadeAssemblyMapData, false); - } - - /// - /// Creates a with default styling for a combined assembly. - /// - /// The created . - public static MapLineData CreateCombinedAssemblyMapData() - { - return CreateAssemblyMapLineData(Resources.CombinedAssembly_DisplayName, true); - } - - /// /// Creates a with default styling for assembly results. /// /// The created . Index: Riskeer/Common/src/Riskeer.Common.Forms/Factories/AssemblyMapDataFeaturesFactory.cs =================================================================== diff -u -r95147b7e1bd2639b32375f945514686fab6e23eb -r9512b50e132cb9836f8a2c2a5276161ddfd4cebb --- Riskeer/Common/src/Riskeer.Common.Forms/Factories/AssemblyMapDataFeaturesFactory.cs (.../AssemblyMapDataFeaturesFactory.cs) (revision 95147b7e1bd2639b32375f945514686fab6e23eb) +++ Riskeer/Common/src/Riskeer.Common.Forms/Factories/AssemblyMapDataFeaturesFactory.cs (.../AssemblyMapDataFeaturesFactory.cs) (revision 9512b50e132cb9836f8a2c2a5276161ddfd4cebb) @@ -29,7 +29,6 @@ using Riskeer.Common.Data.Exceptions; using Riskeer.Common.Data.FailureMechanism; using Riskeer.Common.Forms.Properties; -using Riskeer.Common.Forms.TypeConverters; using RiskeerCommonPrimitivesResources = Riskeer.Common.Primitives.Properties.Resources; namespace Riskeer.Common.Forms.Factories @@ -40,60 +39,6 @@ public static class AssemblyMapDataFeaturesFactory { /// - /// Creates a collection of for instances of . - /// - /// The type of failure mechanism to create the features for. - /// The type of section result to create the features for. - /// The failure mechanism to create the features for. - /// The used to assemble the result of a section result. - /// A collection of . - /// Thrown when any parameter is null. - public static IEnumerable CreateAssemblyFeatures( - TFailureMechanism failureMechanism, Func getAssemblyFunc) - where TFailureMechanism : IHasSectionResults - where TSectionResult : FailureMechanismSectionResultOld - { - if (failureMechanism == null) - { - throw new ArgumentNullException(nameof(failureMechanism)); - } - - if (getAssemblyFunc == null) - { - throw new ArgumentNullException(nameof(getAssemblyFunc)); - } - - return CreateFeatures(failureMechanism, getAssemblyFunc).ToArray(); - } - - /// - /// Creates a collection of for instances of . - /// - /// The type of failure mechanism to create the features for. - /// The type of section result to create the features for. - /// The failure mechanism to create the features for. - /// The used to assemble the result of a section result. - /// A collection of . - /// Thrown when any parameter is null. - public static IEnumerable CreateAssemblyCategoryGroupFeatures( - TFailureMechanism failureMechanism, Func getAssemblyCategoryGroupFunc) - where TFailureMechanism : IHasSectionResults - where TSectionResult : FailureMechanismSectionResultOld - { - if (failureMechanism == null) - { - throw new ArgumentNullException(nameof(failureMechanism)); - } - - if (getAssemblyCategoryGroupFunc == null) - { - throw new ArgumentNullException(nameof(getAssemblyCategoryGroupFunc)); - } - - return CreateCategoryGroupFeatures(failureMechanism, getAssemblyCategoryGroupFunc).ToArray(); - } - - /// /// Creates a collection of for instances of . /// /// The type of section result to create the features for. @@ -144,60 +89,5 @@ yield return feature; } } - - private static IEnumerable CreateFeatures( - TFailureMechanism failureMechanism, Func getAssemblyFunc) - where TFailureMechanism : IHasSectionResults where TSectionResult : FailureMechanismSectionResultOld - { - foreach (TSectionResult sectionResult in failureMechanism.SectionResultsOld) - { - MapFeature feature = RiskeerMapDataFeaturesFactory.CreateSingleLineMapFeature(sectionResult.Section.Points); - - FailureMechanismSectionAssemblyOld assemblyResult; - try - { - assemblyResult = getAssemblyFunc(sectionResult); - } - catch (AssemblyException) - { - continue; - } - - feature.MetaData[Resources.AssemblyCategory_Group_DisplayName] = - new EnumDisplayWrapper( - DisplayFailureMechanismSectionAssemblyCategoryGroupConverter.Convert(assemblyResult.Group)).DisplayName; - - feature.MetaData[RiskeerCommonPrimitivesResources.Probability_DisplayName] = - new NoProbabilityValueDoubleConverter().ConvertToString(assemblyResult.Probability); - - yield return feature; - } - } - - private static IEnumerable CreateCategoryGroupFeatures( - TFailureMechanism failureMechanism, Func getAssemblyCategoryGroupFunc) - where TFailureMechanism : IHasSectionResults where TSectionResult : FailureMechanismSectionResultOld - { - foreach (TSectionResult sectionResult in failureMechanism.SectionResultsOld) - { - MapFeature feature = RiskeerMapDataFeaturesFactory.CreateSingleLineMapFeature(sectionResult.Section.Points); - - FailureMechanismSectionAssemblyCategoryGroup categoryGroup; - try - { - categoryGroup = getAssemblyCategoryGroupFunc(sectionResult); - } - catch (AssemblyException) - { - continue; - } - - feature.MetaData[Resources.AssemblyCategory_Group_DisplayName] = - new EnumDisplayWrapper( - DisplayFailureMechanismSectionAssemblyCategoryGroupConverter.Convert(categoryGroup)).DisplayName; - - yield return feature; - } - } } } \ No newline at end of file Index: Riskeer/Common/src/Riskeer.Common.Forms/Properties/Resources.Designer.cs =================================================================== diff -u -rda5b19a569a21677e10b2efc7c424e64d920907c -r9512b50e132cb9836f8a2c2a5276161ddfd4cebb --- Riskeer/Common/src/Riskeer.Common.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision da5b19a569a21677e10b2efc7c424e64d920907c) +++ Riskeer/Common/src/Riskeer.Common.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 9512b50e132cb9836f8a2c2a5276161ddfd4cebb) @@ -1,4 +1,4 @@ -// Copyright (C) Stichting Deltares 2021. All rights reserved. +// Copyright (C) Stichting Deltares 2021. All rights reserved. // // This file is part of Riskeer. // @@ -146,33 +146,6 @@ } /// - /// Looks up a localized string similar to Toetsoordeel gedetailleerde toets. - /// - public static string AssemblyMapDataFactory_DetailedAssemblyMapData { - get { - return ResourceManager.GetString("AssemblyMapDataFactory_DetailedAssemblyMapData", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Toetsoordeel eenvoudige toets. - /// - public static string AssemblyMapDataFactory_SimpleAssemblyMapData { - get { - return ResourceManager.GetString("AssemblyMapDataFactory_SimpleAssemblyMapData", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Toetsoordeel toets op maat. - /// - public static string AssemblyMapDataFactory_TailorMadeAssemblyMapData { - get { - return ResourceManager.GetString("AssemblyMapDataFactory_TailorMadeAssemblyMapData", resourceCulture); - } - } - - /// /// Looks up a localized string similar to Toetsoordeel. /// public static string AssemblyResult_DisplayName { Index: Riskeer/Common/src/Riskeer.Common.Forms/Properties/Resources.resx =================================================================== diff -u -rda5b19a569a21677e10b2efc7c424e64d920907c -r9512b50e132cb9836f8a2c2a5276161ddfd4cebb --- Riskeer/Common/src/Riskeer.Common.Forms/Properties/Resources.resx (.../Resources.resx) (revision da5b19a569a21677e10b2efc7c424e64d920907c) +++ Riskeer/Common/src/Riskeer.Common.Forms/Properties/Resources.resx (.../Resources.resx) (revision 9512b50e132cb9836f8a2c2a5276161ddfd4cebb) @@ -1412,15 +1412,6 @@ Toetsoordeel - - Toetsoordeel eenvoudige toets - - - Toetsoordeel gedetailleerde toets - - - Toetsoordeel toets op maat - Normklassen Index: Riskeer/Common/test/Riskeer.Common.Forms.Test/Factories/AssemblyMapDataFactoryTest.cs =================================================================== diff -u -rda5b19a569a21677e10b2efc7c424e64d920907c -r9512b50e132cb9836f8a2c2a5276161ddfd4cebb --- Riskeer/Common/test/Riskeer.Common.Forms.Test/Factories/AssemblyMapDataFactoryTest.cs (.../AssemblyMapDataFactoryTest.cs) (revision da5b19a569a21677e10b2efc7c424e64d920907c) +++ Riskeer/Common/test/Riskeer.Common.Forms.Test/Factories/AssemblyMapDataFactoryTest.cs (.../AssemblyMapDataFactoryTest.cs) (revision 9512b50e132cb9836f8a2c2a5276161ddfd4cebb) @@ -32,57 +32,6 @@ public class AssemblyMapDataFactoryTest { [Test] - public void CreateAssemblyMapDataCollection_ReturnsEmptyMapDataCollection() - { - // Call - MapDataCollection data = AssemblyMapDataFactory.CreateAssemblyMapDataCollection(); - - // Assert - CollectionAssert.IsEmpty(data.Collection); - Assert.AreEqual("Toetsoordeel", data.Name); - } - - [Test] - public void CreateFailureMechanismSectionsMapData_ReturnsEmptyMapLineDataWithExpectedStyling() - { - // Call - MapLineData data = AssemblyMapDataFactory.CreateSimpleAssemblyMapData(); - - // Assert - AssertAssemblyMapLineData("Toetsoordeel eenvoudige toets", false, data); - } - - [Test] - public void CreateDetailedAssemblyMapData_ReturnsEmptyMapLineDataWithExpectedStyling() - { - // Call - MapLineData data = AssemblyMapDataFactory.CreateDetailedAssemblyMapData(); - - // Assert - AssertAssemblyMapLineData("Toetsoordeel gedetailleerde toets", false, data); - } - - [Test] - public void CreateTailorMadeAssemblyMapData_ReturnsEmptyMapLineDataWithExpectedStyling() - { - // Call - MapLineData data = AssemblyMapDataFactory.CreateTailorMadeAssemblyMapData(); - - // Assert - AssertAssemblyMapLineData("Toetsoordeel toets op maat", false, data); - } - - [Test] - public void CreateCombinedAssemblyMapData_ReturnsEmptyMapLineDataWithExpectedStyling() - { - // Call - MapLineData data = AssemblyMapDataFactory.CreateCombinedAssemblyMapData(); - - // Assert - AssertAssemblyMapLineData("Gecombineerd toetsoordeel", true, data); - } - - [Test] public void CreateAssemblyMapData_ReturnsEmptyMapLineDataWithExpectedStyling() { // Call Index: Riskeer/Common/test/Riskeer.Common.Forms.Test/Factories/AssemblyMapDataFeaturesFactoryTest.cs =================================================================== diff -u -r95147b7e1bd2639b32375f945514686fab6e23eb -r9512b50e132cb9836f8a2c2a5276161ddfd4cebb --- Riskeer/Common/test/Riskeer.Common.Forms.Test/Factories/AssemblyMapDataFeaturesFactoryTest.cs (.../AssemblyMapDataFeaturesFactoryTest.cs) (revision 95147b7e1bd2639b32375f945514686fab6e23eb) +++ Riskeer/Common/test/Riskeer.Common.Forms.Test/Factories/AssemblyMapDataFeaturesFactoryTest.cs (.../AssemblyMapDataFeaturesFactoryTest.cs) (revision 9512b50e132cb9836f8a2c2a5276161ddfd4cebb) @@ -33,168 +33,13 @@ using Riskeer.Common.Data.FailureMechanism; using Riskeer.Common.Data.TestUtil; using Riskeer.Common.Forms.Factories; -using Riskeer.Common.Forms.TypeConverters; namespace Riskeer.Common.Forms.Test.Factories { [TestFixture] public class AssemblyMapDataFeaturesFactoryTest { [Test] - public void CreateAssemblyFeatures_FailureMechanismNull_ThrowsArgumentNullException() - { - // Call - TestDelegate call = () => AssemblyMapDataFeaturesFactory.CreateAssemblyFeatures< - IHasSectionResults, FailureMechanismSectionResultOld>(null, sr => null); - - // Assert - string paramName = Assert.Throws(call).ParamName; - Assert.AreEqual("failureMechanism", paramName); - } - - [Test] - public void CreateAssemblyFeatures_GetAssemblyFuncNull_ThrowsArgumentNullException() - { - // Call - TestDelegate call = () => AssemblyMapDataFeaturesFactory.CreateAssemblyFeatures< - TestFailureMechanism, FailureMechanismSectionResultOld>(new TestFailureMechanism(), null); - - // Assert - string paramName = Assert.Throws(call).ParamName; - Assert.AreEqual("getAssemblyFunc", paramName); - } - - [Test] - public void CreateAssemblyFeatures_GetAssemblyFuncThrowsAssemblyExceptionOnFirstSection_FirstSectionSkipped() - { - // Setup - var random = new Random(39); - var failureMechanism = new TestFailureMechanism(); - FailureMechanismTestHelper.AddSections(failureMechanism, 2); - var expectedAssembly = new FailureMechanismSectionAssemblyOld(random.NextDouble(), random.NextEnumValue()); - - // Call - var shouldThrowException = true; - IEnumerable features = AssemblyMapDataFeaturesFactory.CreateAssemblyFeatures< - TestFailureMechanism, FailureMechanismSectionResultOld>(failureMechanism, sr => - { - if (shouldThrowException) - { - shouldThrowException = false; - throw new AssemblyException(); - } - - return expectedAssembly; - }); - - // Assert - AssertMapFeature(failureMechanism.Sections.ElementAt(1), features.Single(), expectedAssembly); - } - - [Test] - public void CreateAssemblyFeatures_ValidParameters_ReturnsExpectedFeatures() - { - // Setup - var random = new Random(39); - var failureMechanism = new TestFailureMechanism(); - FailureMechanismTestHelper.AddSections(failureMechanism, random.Next(0, 10)); - - var expectedAssembly = new FailureMechanismSectionAssemblyOld(random.NextDouble(), random.NextEnumValue()); - - // Call - IEnumerable features = AssemblyMapDataFeaturesFactory.CreateAssemblyFeatures< - TestFailureMechanism, FailureMechanismSectionResultOld>(failureMechanism, sr => expectedAssembly); - - // Assert - Assert.AreEqual(failureMechanism.Sections.Count(), features.Count()); - - for (var i = 0; i < features.Count(); i++) - { - FailureMechanismSection section = failureMechanism.Sections.ElementAt(i); - MapFeature mapFeature = features.ElementAt(i); - AssertMapFeature(section, mapFeature, expectedAssembly); - } - } - - [Test] - public void CreateAssemblyCategoryGroupFeatures_FailureMechanismNull_ThrowsArgumentNullException() - { - // Call - TestDelegate call = () => AssemblyMapDataFeaturesFactory.CreateAssemblyCategoryGroupFeatures< - IHasSectionResults, FailureMechanismSectionResultOld>( - null, - sr => new Random(39).NextEnumValue()); - - // Assert - string paramName = Assert.Throws(call).ParamName; - Assert.AreEqual("failureMechanism", paramName); - } - - [Test] - public void CreateAssemblyCategoryGroupFeatures_GetAssemblyCategoryGroupFuncNull_ThrowsArgumentNullException() - { - // Call - TestDelegate call = () => AssemblyMapDataFeaturesFactory.CreateAssemblyCategoryGroupFeatures< - TestFailureMechanism, FailureMechanismSectionResultOld>(new TestFailureMechanism(), null); - - // Assert - string paramName = Assert.Throws(call).ParamName; - Assert.AreEqual("getAssemblyCategoryGroupFunc", paramName); - } - - [Test] - public void CreateAssemblyCategoryGroupFeatures_GetAssemblyCategoryGroupFuncThrowsAssemblyExceptionOnFirstSection_FirstSectionSkipped() - { - // Setup - var random = new Random(39); - var failureMechanism = new TestFailureMechanism(); - FailureMechanismTestHelper.AddSections(failureMechanism, 2); - var expectedCategoryGroup = random.NextEnumValue(); - - // Call - var shouldThrowException = true; - IEnumerable features = AssemblyMapDataFeaturesFactory.CreateAssemblyCategoryGroupFeatures< - TestFailureMechanism, FailureMechanismSectionResultOld>(failureMechanism, sr => - { - if (shouldThrowException) - { - shouldThrowException = false; - throw new AssemblyException(); - } - - return expectedCategoryGroup; - }); - - // Assert - AssertAssemblyCategoryGroupMapFeature(failureMechanism.Sections.ElementAt(1), features.Single(), expectedCategoryGroup); - } - - [Test] - public void CreateAssemblyCategoryGroupFeatures_ValidParameters_ReturnsExpectedFeatures() - { - // Setup - var random = new Random(39); - var failureMechanism = new TestFailureMechanism(); - FailureMechanismTestHelper.AddSections(failureMechanism, random.Next(0, 10)); - - var expectedCategoryGroup = random.NextEnumValue(); - - // Call - IEnumerable features = AssemblyMapDataFeaturesFactory.CreateAssemblyCategoryGroupFeatures< - TestFailureMechanism, FailureMechanismSectionResultOld>(failureMechanism, sr => expectedCategoryGroup); - - // Assert - Assert.AreEqual(failureMechanism.Sections.Count(), features.Count()); - - for (var i = 0; i < features.Count(); i++) - { - FailureMechanismSection section = failureMechanism.Sections.ElementAt(i); - MapFeature mapFeature = features.ElementAt(i); - AssertAssemblyCategoryGroupMapFeature(section, mapFeature, expectedCategoryGroup); - } - } - - [Test] public void CreateAssemblyGroupFeatures_FailureMechanismNull_ThrowsArgumentNullException() { // Call @@ -275,32 +120,6 @@ } } - private static void AssertMapFeature(FailureMechanismSection section, MapFeature mapFeature, FailureMechanismSectionAssemblyOld expectedAssembly) - { - IEnumerable mapGeometries = mapFeature.MapGeometries; - - Assert.AreEqual(1, mapGeometries.Count()); - CollectionAssert.AreEqual(section.Points, mapGeometries.Single().PointCollections.First()); - Assert.AreEqual(2, mapFeature.MetaData.Keys.Count); - Assert.AreEqual(new EnumDisplayWrapper( - DisplayFailureMechanismSectionAssemblyCategoryGroupConverter.Convert(expectedAssembly.Group)).DisplayName, - mapFeature.MetaData["Categorie"]); - Assert.AreEqual(new NoProbabilityValueDoubleConverter().ConvertToString(expectedAssembly.Probability), - mapFeature.MetaData["Faalkans"]); - } - - private static void AssertAssemblyCategoryGroupMapFeature(FailureMechanismSection section, MapFeature mapFeature, FailureMechanismSectionAssemblyCategoryGroup expectedAssembly) - { - IEnumerable mapGeometries = mapFeature.MapGeometries; - - Assert.AreEqual(1, mapGeometries.Count()); - CollectionAssert.AreEqual(section.Points, mapGeometries.Single().PointCollections.First()); - Assert.AreEqual(1, mapFeature.MetaData.Keys.Count); - Assert.AreEqual(new EnumDisplayWrapper( - DisplayFailureMechanismSectionAssemblyCategoryGroupConverter.Convert(expectedAssembly)).DisplayName, - mapFeature.MetaData["Categorie"]); - } - private static void AssertAssemblyGroupMapFeature(FailureMechanismSection section, MapFeature mapFeature, FailureMechanismSectionAssemblyResult expectedAssemblyResult) { IEnumerable mapGeometries = mapFeature.MapGeometries; Index: Riskeer/Common/test/Riskeer.Common.Forms.TestUtil/MapDataTestHelper.cs =================================================================== diff -u -r9616d6e1fe303f236014e8f5f668a3990373d16b -r9512b50e132cb9836f8a2c2a5276161ddfd4cebb --- Riskeer/Common/test/Riskeer.Common.Forms.TestUtil/MapDataTestHelper.cs (.../MapDataTestHelper.cs) (revision 9616d6e1fe303f236014e8f5f668a3990373d16b) +++ Riskeer/Common/test/Riskeer.Common.Forms.TestUtil/MapDataTestHelper.cs (.../MapDataTestHelper.cs) (revision 9512b50e132cb9836f8a2c2a5276161ddfd4cebb) @@ -35,7 +35,6 @@ using Riskeer.Common.Data.DikeProfiles; using Riskeer.Common.Data.FailureMechanism; using Riskeer.Common.Data.FailurePath; -using Riskeer.Common.Forms.TypeConverters; namespace Riskeer.Common.Forms.TestUtil { @@ -285,68 +284,6 @@ } /// - /// Asserts whether the contains the data that is representative - /// for the and supplied . - /// - /// The expected simple assembly. - /// The expected detailed assembly. - /// The expected tailor made assembly. - /// The expected combined assembly. - /// The that needs to be asserted. - /// The the map data collection belongs to. - /// Thrown when: - /// - /// there is an incorrect amount of items in ; - /// one of the items in has incorrect properties. - /// - /// - public static void AssertAssemblyMapDataCollection(FailureMechanismSectionAssemblyOld expectedSimpleAssembly, - FailureMechanismSectionAssemblyOld expectedDetailedAssembly, - FailureMechanismSectionAssemblyOld expectedTailorMadeAssembly, - FailureMechanismSectionAssemblyOld expectedCombinedAssembly, - MapDataCollection assemblyMapData, - IFailureMechanism failureMechanism) - { - IEnumerable assemblyMapDataCollection = assemblyMapData.Collection; - Assert.AreEqual(4, assemblyMapDataCollection.Count()); - AssertAssemblyMapData("Toetsoordeel toets op maat", failureMechanism, expectedTailorMadeAssembly, assemblyMapDataCollection.ElementAt(0)); - AssertAssemblyMapData("Toetsoordeel gedetailleerde toets", failureMechanism, expectedDetailedAssembly, assemblyMapDataCollection.ElementAt(1)); - AssertAssemblyMapData("Toetsoordeel eenvoudige toets", failureMechanism, expectedSimpleAssembly, assemblyMapDataCollection.ElementAt(2)); - AssertAssemblyMapData("Gecombineerd toetsoordeel", failureMechanism, expectedCombinedAssembly, assemblyMapDataCollection.ElementAt(3)); - } - - /// - /// Asserts whether the contains the data that is representative - /// for the and supplied . - /// - /// The expected simple assembly category. - /// The expected detailed assembly category. - /// The expected tailor made assembly category. - /// The expected combined assembly category. - /// The that needs to be asserted. - /// The the map data collection belongs to. - /// Thrown when: - /// - /// there is an incorrect amount of items in ; - /// one of the items in has incorrect properties. - /// - /// - public static void AssertAssemblyMapDataCollection(FailureMechanismSectionAssemblyCategoryGroup expectedSimpleAssemblyCategory, - FailureMechanismSectionAssemblyCategoryGroup expectedDetailedAssemblyCategory, - FailureMechanismSectionAssemblyCategoryGroup expectedTailorMadeAssemblyCategory, - FailureMechanismSectionAssemblyCategoryGroup expectedCombinedAssemblyCategory, - MapDataCollection assemblyMapData, - IFailureMechanism failureMechanism) - { - IEnumerable assemblyMapDataCollection = assemblyMapData.Collection; - Assert.AreEqual(4, assemblyMapDataCollection.Count()); - AssertAssemblyMapData("Toetsoordeel toets op maat", failureMechanism, expectedTailorMadeAssemblyCategory, assemblyMapDataCollection.ElementAt(0)); - AssertAssemblyMapData("Toetsoordeel gedetailleerde toets", failureMechanism, expectedDetailedAssemblyCategory, assemblyMapDataCollection.ElementAt(1)); - AssertAssemblyMapData("Toetsoordeel eenvoudige toets", failureMechanism, expectedSimpleAssemblyCategory, assemblyMapDataCollection.ElementAt(2)); - AssertAssemblyMapData("Gecombineerd toetsoordeel", failureMechanism, expectedCombinedAssemblyCategory, assemblyMapDataCollection.ElementAt(3)); - } - - /// /// Asserts whether the contains the data that is representative /// for the . /// @@ -388,60 +325,6 @@ } } - private static void AssertAssemblyMapData(string expectedMapDataName, - IFailureMechanism failureMechanism, - FailureMechanismSectionAssemblyOld expectedAssembly, - MapData mapData) - { - var assemblyMapLineData = (MapLineData) mapData; - Assert.AreEqual(expectedMapDataName, assemblyMapLineData.Name); - - MapFeature[] features = assemblyMapLineData.Features.ToArray(); - FailureMechanismSection[] sections = failureMechanism.Sections.ToArray(); - Assert.AreEqual(sections.Length, features.Length); - - for (var index = 0; index < sections.Length; index++) - { - MapFeature feature = features[index]; - - FailureMechanismSection failureMechanismSection = sections[index]; - CollectionAssert.AreEqual(failureMechanismSection.Points, feature.MapGeometries.Single().PointCollections.Single()); - - Assert.AreEqual(2, feature.MetaData.Count); - Assert.AreEqual(new EnumDisplayWrapper( - DisplayFailureMechanismSectionAssemblyCategoryGroupConverter.Convert(expectedAssembly.Group)).DisplayName, - feature.MetaData["Categorie"]); - Assert.AreEqual(new NoProbabilityValueDoubleConverter().ConvertToString(expectedAssembly.Probability), - feature.MetaData["Faalkans"]); - } - } - - private static void AssertAssemblyMapData(string expectedMapDataName, - IFailureMechanism failureMechanism, - FailureMechanismSectionAssemblyCategoryGroup expectedCategory, - MapData mapData) - { - var assemblyMapLineData = (MapLineData) mapData; - Assert.AreEqual(expectedMapDataName, assemblyMapLineData.Name); - - MapFeature[] features = assemblyMapLineData.Features.ToArray(); - FailureMechanismSection[] sections = failureMechanism.Sections.ToArray(); - Assert.AreEqual(sections.Length, features.Length); - - for (var index = 0; index < sections.Length; index++) - { - MapFeature feature = features[index]; - - FailureMechanismSection failureMechanismSection = sections[index]; - CollectionAssert.AreEqual(failureMechanismSection.Points, feature.MapGeometries.Single().PointCollections.Single()); - - Assert.AreEqual(1, feature.MetaData.Count); - Assert.AreEqual(new EnumDisplayWrapper( - DisplayFailureMechanismSectionAssemblyCategoryGroupConverter.Convert(expectedCategory)).DisplayName, - feature.MetaData["Categorie"]); - } - } - private static IEnumerable GetWorldPoints(ForeshoreProfile foreshoreProfile) { return AdvancedMath2D.FromXToXY(