Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/Properties/Resources.Designer.cs =================================================================== diff -u -r11faaf2149d31eb83bcb32b8be0e989b477d3c83 -rc94701528c392fbac4fbf2bb2e2c0641735318fa --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 11faaf2149d31eb83bcb32b8be0e989b477d3c83) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision c94701528c392fbac4fbf2bb2e2c0641735318fa) @@ -469,6 +469,24 @@ } /// + /// Looks up a localized string similar to De categoriegrenzen voor de gecombineerde toetssporen in groep 1 en 2.. + /// + public static string CategoryBoundariesGroupOneAndTwo_Description { + get { + return ResourceManager.GetString("CategoryBoundariesGroupOneAndTwo_Description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Categoriegrenzen groep 1 en 2. + /// + public static string CategoryBoundariesGroupOneAndTwo_DisplayName { + get { + return ResourceManager.GetString("CategoryBoundariesGroupOneAndTwo_DisplayName", resourceCulture); + } + } + + /// /// Looks up a localized string similar to U heeft een ander hydraulische belastingendatabase bestand geselecteerd. Als gevolg hiervan moet de uitvoer van alle ervan afhankelijke berekeningen verwijderd worden. /// ///Weet u zeker dat u wilt doorgaan?. @@ -619,6 +637,24 @@ } /// + /// Looks up a localized string similar to De gecombineerde faalkansruimte voor de toetssporen in groep 1 en 2.. + /// + public static string FailureProbabilityMarginFactor_Description { + get { + return ResourceManager.GetString("FailureProbabilityMarginFactor_Description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Gecombineerde faalkansruimte. + /// + public static string FailureProbabilityMarginFactor_DisplayName { + get { + return ResourceManager.GetString("FailureProbabilityMarginFactor_DisplayName", resourceCulture); + } + } + + /// /// Looks up a localized string similar to &Koppel aan database.... /// public static string HydraulicBoundaryDatabase_Connect { Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/Properties/Resources.resx =================================================================== diff -u -r11faaf2149d31eb83bcb32b8be0e989b477d3c83 -rc94701528c392fbac4fbf2bb2e2c0641735318fa --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/Properties/Resources.resx (.../Resources.resx) (revision 11faaf2149d31eb83bcb32b8be0e989b477d3c83) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/Properties/Resources.resx (.../Resources.resx) (revision c94701528c392fbac4fbf2bb2e2c0641735318fa) @@ -376,4 +376,16 @@ Gecombineerd vakoordeel + + De categoriegrenzen voor de gecombineerde toetssporen in groep 1 en 2. + + + Categoriegrenzen groep 1 en 2 + + + De gecombineerde faalkansruimte voor de toetssporen in groep 1 en 2. + + + Gecombineerde faalkansruimte + \ No newline at end of file Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/PropertyClasses/AssemblyResultCategoriesProperties.cs =================================================================== diff -u --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/PropertyClasses/AssemblyResultCategoriesProperties.cs (revision 0) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/PropertyClasses/AssemblyResultCategoriesProperties.cs (revision c94701528c392fbac4fbf2bb2e2c0641735318fa) @@ -0,0 +1,93 @@ +// Copyright (C) Stichting Deltares 2017. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using Core.Common.Base.Data; +using Core.Common.Gui.Attributes; +using Core.Common.Gui.Converters; +using Core.Common.Gui.PropertyBag; +using Core.Common.Util.Attributes; +using Ringtoets.AssemblyTool.Data; +using Ringtoets.Integration.Data; +using Ringtoets.Integration.Forms.Properties; +using RingtoetsCommonFormsResources = Ringtoets.Common.Forms.Properties.Resources; + +namespace Ringtoets.Integration.Forms.PropertyClasses +{ + /// + /// ViewModel of a collection of for properties panel. + /// + public class AssemblyResultCategoriesProperties : ObjectProperties> + { + private readonly AssessmentSection assessmentSection; + + /// + /// Creates a new instance of . + /// + /// The collection of categories. + /// The assessment section. + /// Thrown when any parameter is null. + public AssemblyResultCategoriesProperties(IEnumerable categories, + AssessmentSection assessmentSection) + { + if (assessmentSection == null) + { + throw new ArgumentNullException(nameof(assessmentSection)); + } + + if (categories == null) + { + throw new ArgumentNullException(nameof(categories)); + } + + Data = categories; + this.assessmentSection = assessmentSection; + } + + [PropertyOrder(1)] + [ResourcesCategory(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Categories_General))] + [ResourcesDisplayName(typeof(Resources), nameof(Resources.CategoryBoundariesGroupOneAndTwo_DisplayName))] + [ResourcesDescription(typeof(Resources), nameof(Resources.CategoryBoundariesGroupOneAndTwo_Description))] + [TypeConverter(typeof(ExpandableArrayConverter))] + public FailureMechanismAssemblyCategoryProperties[] AssemblyCategories + { + get + { + return data.Select(category => new FailureMechanismAssemblyCategoryProperties(category)).ToArray(); + } + } + + [PropertyOrder(2)] + [ResourcesCategory(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Categories_General))] + [ResourcesDisplayName(typeof(Resources), nameof(Resources.FailureProbabilityMarginFactor_DisplayName))] + [ResourcesDescription(typeof(Resources), nameof(Resources.FailureProbabilityMarginFactor_Description))] + public RoundedDouble FailureProbabilityMarginFactor + { + get + { + return assessmentSection.FailureProbabilityMarginFactor; + } + } + } +} \ No newline at end of file Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/Ringtoets.Integration.Forms.csproj =================================================================== diff -u -r9b6a3927ea0f32fa59ee5648cd4abede807cb65a -rc94701528c392fbac4fbf2bb2e2c0641735318fa --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/Ringtoets.Integration.Forms.csproj (.../Ringtoets.Integration.Forms.csproj) (revision 9b6a3927ea0f32fa59ee5648cd4abede807cb65a) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/Ringtoets.Integration.Forms.csproj (.../Ringtoets.Integration.Forms.csproj) (revision c94701528c392fbac4fbf2bb2e2c0641735318fa) @@ -63,6 +63,7 @@ + Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/AssemblyResultCategoriesPropertiesTest.cs =================================================================== diff -u --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/AssemblyResultCategoriesPropertiesTest.cs (revision 0) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/AssemblyResultCategoriesPropertiesTest.cs (revision c94701528c392fbac4fbf2bb2e2c0641735318fa) @@ -0,0 +1,126 @@ +// Copyright (C) Stichting Deltares 2017. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using Core.Common.Gui.Converters; +using Core.Common.Gui.PropertyBag; +using Core.Common.TestUtil; +using NUnit.Framework; +using Ringtoets.AssemblyTool.Data; +using Ringtoets.Common.Data.AssessmentSection; +using Ringtoets.Integration.Data; +using Ringtoets.Integration.Forms.PropertyClasses; +using Ringtoets.Integration.Forms.TestUtil; + +namespace Ringtoets.Integration.Forms.Test.PropertyClasses +{ + [TestFixture] + public class AssemblyResultCategoriesPropertiesTest + { + [Test] + public void Constructor_CategoriesNull_ThrowsArgumentNullException() + { + // Call + TestDelegate call = () => new AssemblyResultCategoriesProperties(null, new AssessmentSection(AssessmentSectionComposition.Dike)); + + // Assert + var exception = Assert.Throws(call); + Assert.AreEqual("categories", exception.ParamName); + } + + [Test] + public void Constructor_AssessmentSectionNull_ThrowsArgumentNullException() + { + // Call + TestDelegate call = () => new AssemblyResultCategoriesProperties(Enumerable.Empty(), null); + + // Assert + var exception = Assert.Throws(call); + Assert.AreEqual("assessmentSection", exception.ParamName); + } + + [Test] + public void Constructor_ValidParameters_ExpectedValues() + { + // Setup + var assessmentSection = new AssessmentSection(AssessmentSectionComposition.Dike); + IEnumerable expectedFailureMechanismCategories = GetFailureMechanismAssemblyCategories(); + + // Call + var properties = new AssemblyResultCategoriesProperties(expectedFailureMechanismCategories, assessmentSection); + + // Assert + Assert.IsInstanceOf>>(properties); + + TestHelper.AssertTypeConverter( + nameof(AssemblyResultCategoriesProperties.AssemblyCategories)); + + Assert.AreSame(expectedFailureMechanismCategories, properties.Data); + Assert.AreEqual(assessmentSection.FailureProbabilityMarginFactor, properties.FailureProbabilityMarginFactor); + AssemblyCategoryPropertiesTestHelper.AssertFailureMechanismAssemblyCategoryProperties( + expectedFailureMechanismCategories, + properties); + } + + [Test] + public void Constructor_Always_PropertiesHaveExpectedAttributesValues() + { + // Call + var properties = new AssemblyResultCategoriesProperties(GetFailureMechanismAssemblyCategories(), + new AssessmentSection(AssessmentSectionComposition.Dike)); + + // Assert + PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); + Assert.AreEqual(2, dynamicProperties.Count); + + const string generalCategoryName = "Algemeen"; + + PropertyDescriptor categoriesProperty = dynamicProperties[0]; + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(categoriesProperty, + generalCategoryName, + "Categoriegrenzen groep 1 en 2", + "De categoriegrenzen voor de gecombineerde toetssporen in groep 1 en 2.", + true); + + PropertyDescriptor failureMechanismSectionCategoriesProperty = dynamicProperties[1]; + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(failureMechanismSectionCategoriesProperty, + generalCategoryName, + "Gecombineerde faalkansruimte", + "De gecombineerde faalkansruimte voor de toetssporen in groep 1 en 2.", + true); + } + + private static IEnumerable GetFailureMechanismAssemblyCategories() + { + var random = new Random(21); + + return new[] + { + new FailureMechanismAssemblyCategory(random.NextDouble(), + random.NextDouble(), + random.NextEnumValue()) + }; + } + } +} \ No newline at end of file Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/FailureMechanismAssemblyCategoriesPropertiesTest.cs =================================================================== diff -u -r997fbe209a64d3b50a11c0902aafdb7f48762aff -rc94701528c392fbac4fbf2bb2e2c0641735318fa --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/FailureMechanismAssemblyCategoriesPropertiesTest.cs (.../FailureMechanismAssemblyCategoriesPropertiesTest.cs) (revision 997fbe209a64d3b50a11c0902aafdb7f48762aff) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/FailureMechanismAssemblyCategoriesPropertiesTest.cs (.../FailureMechanismAssemblyCategoriesPropertiesTest.cs) (revision c94701528c392fbac4fbf2bb2e2c0641735318fa) @@ -65,7 +65,7 @@ TestHelper.AssertTypeConverter( nameof(FailureMechanismAssemblyCategoriesProperties.FailureMechanismSectionAssemblyCategories)); - AssemblyCategoryPropertiesTestHelper.AssertFailureMechanismAssemblyCategoryProperties( + AssemblyCategoryPropertiesTestHelper.AssertFailureMechanismAndFailureMechanismSectionAssemblyCategoryProperties( expectedFailureMechanismCategories, expectedFailureMechanismSectionCategories, properties); Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Ringtoets.Integration.Forms.Test.csproj =================================================================== diff -u -r9b6a3927ea0f32fa59ee5648cd4abede807cb65a -rc94701528c392fbac4fbf2bb2e2c0641735318fa --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Ringtoets.Integration.Forms.Test.csproj (.../Ringtoets.Integration.Forms.Test.csproj) (revision 9b6a3927ea0f32fa59ee5648cd4abede807cb65a) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Ringtoets.Integration.Forms.Test.csproj (.../Ringtoets.Integration.Forms.Test.csproj) (revision c94701528c392fbac4fbf2bb2e2c0641735318fa) @@ -62,6 +62,7 @@ + Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.TestUtil/AssemblyCategoryPropertiesTestHelper.cs =================================================================== diff -u -r997fbe209a64d3b50a11c0902aafdb7f48762aff -rc94701528c392fbac4fbf2bb2e2c0641735318fa --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.TestUtil/AssemblyCategoryPropertiesTestHelper.cs (.../AssemblyCategoryPropertiesTestHelper.cs) (revision 997fbe209a64d3b50a11c0902aafdb7f48762aff) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.TestUtil/AssemblyCategoryPropertiesTestHelper.cs (.../AssemblyCategoryPropertiesTestHelper.cs) (revision c94701528c392fbac4fbf2bb2e2c0641735318fa) @@ -41,7 +41,7 @@ /// The actual to assert. /// Thrown when the content of does not equal /// and . - public static void AssertFailureMechanismAssemblyCategoryProperties( + public static void AssertFailureMechanismAndFailureMechanismSectionAssemblyCategoryProperties( IEnumerable expectedFailureMechanismCategories, IEnumerable expectedFailureMechanismSectionCategories, FailureMechanismAssemblyCategoriesProperties properties) @@ -61,6 +61,29 @@ /// /// Asserts whether the content of equals the given + /// and . + /// + /// The collection of expected . + /// The actual to assert. + /// Thrown when the content of does not equal + /// . + public static void AssertFailureMechanismAssemblyCategoryProperties( + IEnumerable expectedFailureMechanismCategories, + AssemblyResultCategoriesProperties properties) + { + Assert.AreEqual(expectedFailureMechanismCategories.Count(), properties.AssemblyCategories.Length); + for (var i = 0; i < expectedFailureMechanismCategories.Count(); i++) + { + FailureMechanismAssemblyCategory category = expectedFailureMechanismCategories.ElementAt(i); + FailureMechanismAssemblyCategoryProperties property = properties.AssemblyCategories[i]; + Assert.AreEqual(category.Group, property.Group); + Assert.AreEqual(category.UpperBoundary, property.UpperBoundary); + Assert.AreEqual(category.LowerBoundary, property.LowerBoundary); + } + } + + /// + /// Asserts whether the content of equals the given /// . /// /// The collection of expected . Index: Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/PropertyInfos/FailureMechanismAssemblyCategoriesContextPropertyInfoTest.cs =================================================================== diff -u -rab9e6a1f47225304b418f5fce8a3c321e7439886 -rc94701528c392fbac4fbf2bb2e2c0641735318fa --- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/PropertyInfos/FailureMechanismAssemblyCategoriesContextPropertyInfoTest.cs (.../FailureMechanismAssemblyCategoriesContextPropertyInfoTest.cs) (revision ab9e6a1f47225304b418f5fce8a3c321e7439886) +++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/PropertyInfos/FailureMechanismAssemblyCategoriesContextPropertyInfoTest.cs (.../FailureMechanismAssemblyCategoriesContextPropertyInfoTest.cs) (revision c94701528c392fbac4fbf2bb2e2c0641735318fa) @@ -19,15 +19,11 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. -using System; -using System.Collections.Generic; using System.Linq; using Core.Common.Gui.Plugin; using Core.Common.Gui.PropertyBag; -using Core.Common.TestUtil; using NUnit.Framework; using Rhino.Mocks; -using Ringtoets.AssemblyTool.Data; using Ringtoets.AssemblyTool.KernelWrapper.Calculators; using Ringtoets.AssemblyTool.KernelWrapper.TestUtil.Calculators; using Ringtoets.AssemblyTool.KernelWrapper.TestUtil.Calculators.Categories; @@ -90,7 +86,7 @@ Assert.IsInstanceOf(objectProperties); var properties = (FailureMechanismAssemblyCategoriesProperties) objectProperties; - AssemblyCategoryPropertiesTestHelper.AssertFailureMechanismAssemblyCategoryProperties( + AssemblyCategoryPropertiesTestHelper.AssertFailureMechanismAndFailureMechanismSectionAssemblyCategoryProperties( calculator.FailureMechanismCategoriesOutput, context.GetFailureMechanismSectionAssemblyCategoriesFunc(), properties);