Index: Riskeer/Common/src/Riskeer.Common.Forms/Properties/Resources.Designer.cs
===================================================================
diff -u -r6cd178a9e075fe86c45cf420d0625e05a2bbd312 -rc1a92b999dcc6a79240c5d16710942cde7ad6669
--- Riskeer/Common/src/Riskeer.Common.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 6cd178a9e075fe86c45cf420d0625e05a2bbd312)
+++ Riskeer/Common/src/Riskeer.Common.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision c1a92b999dcc6a79240c5d16710942cde7ad6669)
@@ -110,6 +110,15 @@
}
///
+ /// Looks up a localized string similar to Ondergrens van de duidingsklasse..
+ ///
+ public static string AssemblyCategory_LowerBoundary_Description {
+ get {
+ return ResourceManager.GetString("AssemblyCategory_LowerBoundary_Description", resourceCulture);
+ }
+ }
+
+ ///
/// Looks up a localized string similar to Ondergrens [1/jaar].
///
public static string AssemblyCategory_LowerBoundary_DisplayName {
@@ -119,6 +128,15 @@
}
///
+ /// Looks up a localized string similar to Bovengrens van de duidingsklasse..
+ ///
+ public static string AssemblyCategory_UpperBoundary_Description {
+ get {
+ return ResourceManager.GetString("AssemblyCategory_UpperBoundary_Description", resourceCulture);
+ }
+ }
+
+ ///
/// Looks up a localized string similar to Bovengrens [1/jaar].
///
public static string AssemblyCategory_UpperBoundary_DisplayName {
@@ -146,6 +164,24 @@
}
///
+ /// Looks up a localized string similar to Naam van de duidingsklasse..
+ ///
+ public static string AssemblyGroup_Name_Description {
+ get {
+ return ResourceManager.GetString("AssemblyGroup_Name_Description", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Naam.
+ ///
+ public static string AssemblyGroup_Name_DisplayName {
+ get {
+ return ResourceManager.GetString("AssemblyGroup_Name_DisplayName", resourceCulture);
+ }
+ }
+
+ ///
/// Looks up a localized string similar to Duidingsklassen.
///
public static string AssemblyGroups_DisplayName {
Index: Riskeer/Common/src/Riskeer.Common.Forms/Properties/Resources.resx
===================================================================
diff -u -r6cd178a9e075fe86c45cf420d0625e05a2bbd312 -rc1a92b999dcc6a79240c5d16710942cde7ad6669
--- Riskeer/Common/src/Riskeer.Common.Forms/Properties/Resources.resx (.../Resources.resx) (revision 6cd178a9e075fe86c45cf420d0625e05a2bbd312)
+++ Riskeer/Common/src/Riskeer.Common.Forms/Properties/Resources.resx (.../Resources.resx) (revision c1a92b999dcc6a79240c5d16710942cde7ad6669)
@@ -1346,9 +1346,15 @@
Ondergrens [1/jaar]
+
+ Ondergrens van de duidingsklasse.
+
Bovengrens [1/jaar]
+
+ Bovengrens van de duidingsklasse.
+
Berekende waterstand.
@@ -1624,4 +1630,10 @@
Duidingsklassen
+
+ Naam
+
+
+ Naam van de duidingsklasse.
+
\ No newline at end of file
Index: Riskeer/Integration/src/Riskeer.Integration.Forms/PropertyClasses/AssemblyGroupProperties.cs
===================================================================
diff -u
--- Riskeer/Integration/src/Riskeer.Integration.Forms/PropertyClasses/AssemblyGroupProperties.cs (revision 0)
+++ Riskeer/Integration/src/Riskeer.Integration.Forms/PropertyClasses/AssemblyGroupProperties.cs (revision c1a92b999dcc6a79240c5d16710942cde7ad6669)
@@ -0,0 +1,101 @@
+// Copyright (C) Stichting Deltares 2021. All rights reserved.
+//
+// This file is part of Riskeer.
+//
+// Riskeer 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.ComponentModel;
+using Core.Common.Util;
+using Core.Common.Util.Attributes;
+using Core.Gui.Attributes;
+using Core.Gui.PropertyBag;
+using Riskeer.AssemblyTool.Data;
+using Riskeer.Common.Forms.TypeConverters;
+using RiskeerCommonFormsResources = Riskeer.Common.Forms.Properties.Resources;
+
+namespace Riskeer.Integration.Forms.PropertyClasses
+{
+ ///
+ /// ViewModel of a for properties panel.
+ ///
+ [TypeConverter(typeof(ExpandableObjectConverter))]
+ public class AssemblyGroupProperties : ObjectProperties
+ {
+ private const int groupPropertyIndex = 1;
+ private const int lowerBoundaryPropertyIndex = 2;
+ private const int upperBoundaryPropertyIndex = 3;
+
+ ///
+ /// Creates a new instance of .
+ ///
+ public AssemblyGroupProperties(FailureMechanismSectionAssemblyGroupBoundaries assemblyGroupBoundaries)
+ {
+ if (assemblyGroupBoundaries == null)
+ {
+ throw new ArgumentNullException(nameof(assemblyGroupBoundaries));
+ }
+
+ Data = assemblyGroupBoundaries;
+ }
+
+ [PropertyOrder(groupPropertyIndex)]
+ [ResourcesCategory(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Categories_General))]
+ [ResourcesDisplayName(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.AssemblyGroup_Name_DisplayName))]
+ [ResourcesDescription(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.AssemblyGroup_Name_Description))]
+ [TypeConverter(typeof(EnumTypeConverter))]
+ public FailureMechanismSectionAssemblyGroup Group
+ {
+ get
+ {
+ return data.Group;
+ }
+ }
+
+ [PropertyOrder(lowerBoundaryPropertyIndex)]
+ [ResourcesCategory(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Categories_General))]
+ [ResourcesDisplayName(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.AssemblyCategory_LowerBoundary_DisplayName))]
+ [ResourcesDescription(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.AssemblyCategory_LowerBoundary_Description))]
+ [TypeConverter(typeof(NoProbabilityValueDoubleConverter))]
+ public double LowerBoundary
+ {
+ get
+ {
+ return data.LowerBoundary;
+ }
+ }
+
+ [PropertyOrder(upperBoundaryPropertyIndex)]
+ [ResourcesCategory(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Categories_General))]
+ [ResourcesDisplayName(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.AssemblyCategory_UpperBoundary_DisplayName))]
+ [ResourcesDescription(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.AssemblyCategory_UpperBoundary_Description))]
+ [TypeConverter(typeof(NoProbabilityValueDoubleConverter))]
+ public double UpperBoundary
+ {
+ get
+ {
+ return data.UpperBoundary;
+ }
+ }
+
+ public override string ToString()
+ {
+ return new EnumDisplayWrapper(data.Group).DisplayName;
+ }
+ }
+}
\ No newline at end of file
Index: Riskeer/Integration/src/Riskeer.Integration.Forms/PropertyClasses/AssemblyGroupsProperties.cs
===================================================================
diff -u
--- Riskeer/Integration/src/Riskeer.Integration.Forms/PropertyClasses/AssemblyGroupsProperties.cs (revision 0)
+++ Riskeer/Integration/src/Riskeer.Integration.Forms/PropertyClasses/AssemblyGroupsProperties.cs (revision c1a92b999dcc6a79240c5d16710942cde7ad6669)
@@ -0,0 +1,79 @@
+// Copyright (C) Stichting Deltares 2021. All rights reserved.
+//
+// This file is part of Riskeer.
+//
+// Riskeer 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.ComponentModel;
+using System.Linq;
+using Core.Common.Util.Attributes;
+using Core.Gui.Attributes;
+using Core.Gui.Converters;
+using Core.Gui.PropertyBag;
+using Riskeer.AssemblyTool.Data;
+using Riskeer.Common.Data.AssemblyTool;
+using Riskeer.Integration.Data;
+using RiskeerCommonFormsResources = Riskeer.Common.Forms.Properties.Resources;
+
+namespace Riskeer.Integration.Forms.PropertyClasses
+{
+ ///
+ /// ViewModel of a collection of for properties panel.
+ ///
+ public class AssemblyGroupsProperties : ObjectProperties
+ {
+ private const int failureMechanismSectionAssemblyCategoryPropertyIndex = 1;
+
+ ///
+ /// Creates a new instance of .
+ ///
+ /// The collection of .
+ /// Thrown when any parameter is null.
+ public AssemblyGroupsProperties(AssessmentSection assessmentSection)
+ {
+ if (assessmentSection == null)
+ {
+ throw new ArgumentNullException(nameof(assessmentSection));
+ }
+
+ Data = assessmentSection;
+ }
+
+ [PropertyOrder(failureMechanismSectionAssemblyCategoryPropertyIndex)]
+ [ResourcesCategory(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.Categories_General))]
+ [ResourcesDisplayName(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.AssemblyGroups_DisplayName))]
+ [ResourcesDescription(typeof(RiskeerCommonFormsResources), nameof(RiskeerCommonFormsResources.AssemblyGroups_DisplayName))]
+ [TypeConverter(typeof(ExpandableArrayConverter))]
+ public AssemblyGroupProperties[] FailureMechanismAssemblyGroups
+ {
+ get
+ {
+ return GetFailureMechanismAssemblyGroups();
+ }
+ }
+
+ private AssemblyGroupProperties[] GetFailureMechanismAssemblyGroups()
+ {
+ var assessmentSection = Data as AssessmentSection;
+
+ return AssemblyToolGroupBoundariesFactory.CreateFailureMechanismSectionAssemblyGroupBoundaries(
+ assessmentSection.FailureMechanismContribution.SignalingNorm, assessmentSection.FailureMechanismContribution.LowerLimitNorm).Select(category => new AssemblyGroupProperties(category)).ToArray();
+ }
+ }
+}
\ No newline at end of file
Index: Riskeer/Integration/src/Riskeer.Integration.Plugin/RiskeerPlugin.cs
===================================================================
diff -u -r09486786d73dcf29f225c4aad4a3ac89ca44d21a -rc1a92b999dcc6a79240c5d16710942cde7ad6669
--- Riskeer/Integration/src/Riskeer.Integration.Plugin/RiskeerPlugin.cs (.../RiskeerPlugin.cs) (revision 09486786d73dcf29f225c4aad4a3ac89ca44d21a)
+++ Riskeer/Integration/src/Riskeer.Integration.Plugin/RiskeerPlugin.cs (.../RiskeerPlugin.cs) (revision c1a92b999dcc6a79240c5d16710942cde7ad6669)
@@ -317,6 +317,11 @@
{
CreateInstance = context => new StructuresOutputProperties(context.WrappedData.Output)
};
+
+ yield return new PropertyInfo
+ {
+ CreateInstance = context => new AssemblyGroupsProperties(context.WrappedData)
+ };
}
public override IEnumerable GetViewInfos()
Index: Riskeer/Integration/test/Riskeer.Integration.Forms.Test/PropertyClasses/AssemblyGroupPropertiesTest.cs
===================================================================
diff -u
--- Riskeer/Integration/test/Riskeer.Integration.Forms.Test/PropertyClasses/AssemblyGroupPropertiesTest.cs (revision 0)
+++ Riskeer/Integration/test/Riskeer.Integration.Forms.Test/PropertyClasses/AssemblyGroupPropertiesTest.cs (revision c1a92b999dcc6a79240c5d16710942cde7ad6669)
@@ -0,0 +1,127 @@
+// Copyright (C) Stichting Deltares 2021. All rights reserved.
+//
+// This file is part of Riskeer.
+//
+// Riskeer 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.ComponentModel;
+using Core.Common.TestUtil;
+using Core.Common.Util;
+using Core.Gui.PropertyBag;
+using Core.Gui.TestUtil;
+using NUnit.Framework;
+using Riskeer.AssemblyTool.Data;
+using Riskeer.Integration.Forms.PropertyClasses;
+
+namespace Riskeer.Integration.Forms.Test.PropertyClasses
+{
+ [TestFixture]
+ public class AssemblyGroupPropertiesTest
+ {
+ [Test]
+ public void Constructor_AssemblyGroupBoundariesNull_ThrowsArgumentNullException()
+ {
+ // Call
+ void Call() => new AssemblyGroupProperties(null);
+
+ // Assert
+ var exception = Assert.Throws(Call);
+ Assert.AreEqual("assemblyGroupBoundaries", exception.ParamName);
+ }
+
+ [Test]
+ public void Constructor_ValidParameters_ExpectedValues()
+ {
+ // Setup
+ var random = new Random(39);
+ var assemblyCategory = new FailureMechanismSectionAssemblyGroupBoundaries(random.NextEnumValue(),
+ random.NextDouble(),
+ random.NextDouble());
+
+ // Call
+ var properties = new AssemblyGroupProperties(assemblyCategory);
+
+ // Assert
+ Assert.IsInstanceOf>(properties);
+ Assert.AreSame(assemblyCategory, properties.Data);
+ TestHelper.AssertTypeConverter();
+
+ Assert.AreEqual(assemblyCategory.Group, properties.Group);
+ Assert.AreEqual(assemblyCategory.LowerBoundary, properties.LowerBoundary);
+ Assert.AreEqual(assemblyCategory.UpperBoundary, properties.UpperBoundary);
+ }
+
+ [Test]
+ public void Constructor_Always_PropertiesHaveExpectedAttributesValues()
+ {
+ // Setup
+ var random = new Random(39);
+ var assemblyCategory = new FailureMechanismSectionAssemblyGroupBoundaries(random.NextEnumValue(),
+ random.NextDouble(),
+ random.NextDouble());
+
+ // Call
+ var properties = new AssemblyGroupProperties(assemblyCategory);
+ // Assert
+ PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties);
+ Assert.AreEqual(3, dynamicProperties.Count);
+
+ const string generalCategoryName = "Algemeen";
+
+ PropertyDescriptor nameProperty = dynamicProperties[0];
+ PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(nameProperty,
+ generalCategoryName,
+ "Naam",
+ "Naam van de duidingsklasse.",
+ true);
+
+ PropertyDescriptor lowerBoundaryProperty = dynamicProperties[1];
+ PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(lowerBoundaryProperty,
+ generalCategoryName,
+ "Ondergrens [1/jaar]",
+ "Ondergrens van de duidingsklasse.",
+ true);
+
+ PropertyDescriptor upperBoundaryProperty = dynamicProperties[2];
+ PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(upperBoundaryProperty,
+ generalCategoryName,
+ "Bovengrens [1/jaar]",
+ "Bovengrens van de duidingsklasse.",
+ true);
+ }
+
+ [Test]
+ public void ToString_Always_ReturnsCategoryGroupDisplayName()
+ {
+ // Setup
+ var random = new Random(39);
+ var categoryGroup = random.NextEnumValue();
+ var properties = new AssemblyGroupProperties(new FailureMechanismSectionAssemblyGroupBoundaries(categoryGroup,
+ random.NextDouble(),
+ random.NextDouble()));
+
+ // Call
+ var result = properties.ToString();
+
+ // Assert
+ Assert.AreEqual(new EnumDisplayWrapper(categoryGroup).DisplayName,
+ result);
+ }
+ }
+}
\ No newline at end of file
Index: Riskeer/Integration/test/Riskeer.Integration.Forms.Test/PropertyClasses/AssemblyGroupsPropertiesTest.cs
===================================================================
diff -u
--- Riskeer/Integration/test/Riskeer.Integration.Forms.Test/PropertyClasses/AssemblyGroupsPropertiesTest.cs (revision 0)
+++ Riskeer/Integration/test/Riskeer.Integration.Forms.Test/PropertyClasses/AssemblyGroupsPropertiesTest.cs (revision c1a92b999dcc6a79240c5d16710942cde7ad6669)
@@ -0,0 +1,84 @@
+// Copyright (C) Stichting Deltares 2021. All rights reserved.
+//
+// This file is part of Riskeer.
+//
+// Riskeer 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.ComponentModel;
+using Core.Common.TestUtil;
+using Core.Gui.Converters;
+using Core.Gui.TestUtil;
+using NUnit.Framework;
+using Riskeer.Common.Data.AssessmentSection;
+using Riskeer.Integration.Data;
+using Riskeer.Integration.Forms.PropertyClasses;
+
+namespace Riskeer.Integration.Forms.Test.PropertyClasses
+{
+ [TestFixture]
+ public class AssemblyGroupsPropertiesTest
+ {
+ [Test]
+ public void Constructor_assessmentSectionNull_ThrowsArgumentNullException()
+ {
+ // Call
+ void Call() => new AssemblyGroupsProperties(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);
+
+ // Call
+ var properties = new AssemblyGroupsProperties(assessmentSection);
+
+ // Assert
+ Assert.IsInstanceOf(properties);
+ Assert.AreSame(assessmentSection, properties.Data);
+ TestHelper.AssertTypeConverter(
+ nameof(AssemblyGroupsProperties.FailureMechanismAssemblyGroups));
+ }
+
+ [Test]
+ public void Constructor_Always_PropertiesHaveExpectedAttributesValues()
+ {
+ // Call
+ var properties = new AssemblyGroupsProperties(new AssessmentSection(AssessmentSectionComposition.Dike));
+
+ // Assert
+ PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties);
+ Assert.AreEqual(1, dynamicProperties.Count);
+
+ const string generalCategoryName = "Algemeen";
+
+ PropertyDescriptor failureMechanismSectionCategoriesProperty = dynamicProperties[0];
+ PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(failureMechanismSectionCategoriesProperty,
+ generalCategoryName,
+ "Duidingsklassen",
+ "Duidingsklassen",
+ true);
+ }
+ }
+}
\ No newline at end of file
Index: Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/PropertyInfos/AssemblyGroupsContextPropertyInfoTest.cs
===================================================================
diff -u
--- Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/PropertyInfos/AssemblyGroupsContextPropertyInfoTest.cs (revision 0)
+++ Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/PropertyInfos/AssemblyGroupsContextPropertyInfoTest.cs (revision c1a92b999dcc6a79240c5d16710942cde7ad6669)
@@ -0,0 +1,115 @@
+// Copyright (C) Stichting Deltares 2021. All rights reserved.
+//
+// This file is part of Riskeer.
+//
+// Riskeer 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.Linq;
+using Core.Common.TestUtil;
+using Core.Gui.Plugin;
+using Core.Gui.PropertyBag;
+using NUnit.Framework;
+using Riskeer.AssemblyTool.Data;
+using Riskeer.AssemblyTool.KernelWrapper.Calculators;
+using Riskeer.AssemblyTool.KernelWrapper.TestUtil.Calculators;
+using Riskeer.AssemblyTool.KernelWrapper.TestUtil.Calculators.Categories;
+using Riskeer.Common.Data.AssessmentSection;
+using Riskeer.Integration.Data;
+using Riskeer.Integration.Forms.PresentationObjects;
+using Riskeer.Integration.Forms.PropertyClasses;
+
+namespace Riskeer.Integration.Plugin.Test.PropertyInfos
+{
+ [TestFixture]
+ public class AssemblyGroupsContextPropertyInfoTest
+ {
+ private RiskeerPlugin plugin;
+ private PropertyInfo info;
+
+ [SetUp]
+ public void SetUp()
+ {
+ plugin = new RiskeerPlugin();
+ info = plugin.GetPropertyInfos().First(tni => tni.DataType == typeof(AssemblyGroupsContext));
+ }
+
+ [TearDown]
+ public void TearDown()
+ {
+ plugin.Dispose();
+ }
+
+ [Test]
+ public void Initialized_Always_ExpectedPropertiesSet()
+ {
+ // Assert
+ Assert.AreEqual(typeof(AssemblyGroupsContext), info.DataType);
+ Assert.AreEqual(typeof(AssemblyGroupsProperties), info.PropertyObjectType);
+ }
+
+ [Test]
+ public void CreateInstance_ValidArguments_ReturnProperties()
+ {
+ // Setup
+ var random = new Random();
+ var context = new AssemblyGroupsContext(new AssessmentSection(AssessmentSectionComposition.Dike));
+
+ using (new AssemblyToolCalculatorFactoryConfig())
+ {
+ var calculatorFactory = (TestAssemblyToolCalculatorFactory) AssemblyToolCalculatorFactory.Instance;
+ AssemblyGroupBoundariesCalculatorStub calculator = calculatorFactory.LastCreatedAssemblyGroupBoundariesCalculator;
+ var output = new List();
+
+ int newGroupBoundaries = random.Next(1, 10);
+ for (var i = 1; i <= newGroupBoundaries; i++)
+ {
+ output.Add(CreateRandomDisplayFailureMechanismSectionAssemblyGroupBoundaries(random));
+ }
+
+ calculator.FailureMechanismSectionAssemblyGroupBoundariesOutput = output;
+
+ // Call
+ IObjectProperties objectProperties = info.CreateInstance(context);
+
+ // Assert
+ Assert.IsInstanceOf(objectProperties);
+
+ var properties = (AssemblyGroupsProperties) objectProperties;
+
+ Assert.AreEqual(calculator.FailureMechanismSectionAssemblyGroupBoundariesOutput.Count(), properties.FailureMechanismAssemblyGroups.Length);
+ for (var i = 0; i < calculator.FailureMechanismSectionAssemblyGroupBoundariesOutput.Count(); i++)
+ {
+ FailureMechanismSectionAssemblyGroupBoundaries category = calculator.FailureMechanismSectionAssemblyGroupBoundariesOutput.ElementAt(i);
+ AssemblyGroupProperties property = properties.FailureMechanismAssemblyGroups[i];
+ Assert.AreEqual(category.Group, property.Group);
+ Assert.AreEqual(category.UpperBoundary, property.UpperBoundary);
+ Assert.AreEqual(category.LowerBoundary, property.LowerBoundary);
+ }
+ }
+ }
+
+ private static FailureMechanismSectionAssemblyGroupBoundaries CreateRandomDisplayFailureMechanismSectionAssemblyGroupBoundaries(Random random)
+ {
+ return new FailureMechanismSectionAssemblyGroupBoundaries(random.NextEnumValue(),
+ random.NextDouble(),
+ random.NextDouble());
+ }
+ }
+}
\ No newline at end of file
Index: Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/RiskeerPluginTest.cs
===================================================================
diff -u -r1ea12f928a15a4cf5595651ca6518a56c96407fb -rc1a92b999dcc6a79240c5d16710942cde7ad6669
--- Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/RiskeerPluginTest.cs (.../RiskeerPluginTest.cs) (revision 1ea12f928a15a4cf5595651ca6518a56c96407fb)
+++ Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/RiskeerPluginTest.cs (.../RiskeerPluginTest.cs) (revision c1a92b999dcc6a79240c5d16710942cde7ad6669)
@@ -216,7 +216,7 @@
PropertyInfo[] propertyInfos = plugin.GetPropertyInfos().ToArray();
// Assert
- Assert.AreEqual(23, propertyInfos.Length);
+ Assert.AreEqual(24, propertyInfos.Length);
PluginTestHelper.AssertPropertyInfoDefined(
propertyInfos,
@@ -332,6 +332,11 @@
propertyInfos,
typeof(StructuresOutputContext),
typeof(StructuresOutputProperties));
+
+ PluginTestHelper.AssertPropertyInfoDefined(
+ propertyInfos,
+ typeof(AssemblyGroupsContext),
+ typeof(AssemblyGroupsProperties));
}
}
@@ -527,7 +532,7 @@
typeof(AssemblyGroupsContext),
typeof(AssessmentSection),
typeof(AssemblyGroupsView));
-
+
viewInfos.ForEachElementDo(vi =>
{
Assert.AreEqual(symbol, vi.GetSymbol());