Index: Ringtoets/AssemblyTool/src/Ringtoets.AssemblyTool.KernelWrapper/Calculators/Categories/AssemblyCategoriesCalculator.cs =================================================================== diff -u -r61e0b1bf1351eabb70eccd3fafeb61ade378f44c -rd75cba7f33dd4264452ed4dcceddd5ec79b210ea --- Ringtoets/AssemblyTool/src/Ringtoets.AssemblyTool.KernelWrapper/Calculators/Categories/AssemblyCategoriesCalculator.cs (.../AssemblyCategoriesCalculator.cs) (revision 61e0b1bf1351eabb70eccd3fafeb61ade378f44c) +++ Ringtoets/AssemblyTool/src/Ringtoets.AssemblyTool.KernelWrapper/Calculators/Categories/AssemblyCategoriesCalculator.cs (.../AssemblyCategoriesCalculator.cs) (revision d75cba7f33dd4264452ed4dcceddd5ec79b210ea) @@ -116,7 +116,7 @@ } } - public IEnumerable CalculateGeotechnicFailureMechanismSectionCategories( + public IEnumerable CalculateGeotechnicalFailureMechanismSectionCategories( AssemblyCategoriesInput assemblyCategoriesInput) { try Index: Ringtoets/AssemblyTool/src/Ringtoets.AssemblyTool.KernelWrapper/Calculators/Categories/IAssemblyCategoriesCalculator.cs =================================================================== diff -u -r28bcc5f05ac19148d432c3051a88758c60c9dc0c -rd75cba7f33dd4264452ed4dcceddd5ec79b210ea --- Ringtoets/AssemblyTool/src/Ringtoets.AssemblyTool.KernelWrapper/Calculators/Categories/IAssemblyCategoriesCalculator.cs (.../IAssemblyCategoriesCalculator.cs) (revision 28bcc5f05ac19148d432c3051a88758c60c9dc0c) +++ Ringtoets/AssemblyTool/src/Ringtoets.AssemblyTool.KernelWrapper/Calculators/Categories/IAssemblyCategoriesCalculator.cs (.../IAssemblyCategoriesCalculator.cs) (revision d75cba7f33dd4264452ed4dcceddd5ec79b210ea) @@ -65,15 +65,15 @@ AssemblyCategoriesInput assemblyCategoriesInput); /// - /// Performs the calculation for getting the geotechnic failure mechanism section categories. + /// Performs the calculation for getting the geotechnical failure mechanism section categories. /// /// The object containing the input parameters for /// determining the assembly categories. /// An with categories of /// . /// Thrown when an error occurs /// while performing the calculation. - IEnumerable CalculateGeotechnicFailureMechanismSectionCategories( + IEnumerable CalculateGeotechnicalFailureMechanismSectionCategories( AssemblyCategoriesInput assemblyCategoriesInput); } } \ No newline at end of file Index: Ringtoets/AssemblyTool/test/Ringtoets.AssemblyTool.KernelWrapper.Test/Calculators/Categories/AssemblyCategoriesCalculatorTest.cs =================================================================== diff -u -r61e0b1bf1351eabb70eccd3fafeb61ade378f44c -rd75cba7f33dd4264452ed4dcceddd5ec79b210ea --- Ringtoets/AssemblyTool/test/Ringtoets.AssemblyTool.KernelWrapper.Test/Calculators/Categories/AssemblyCategoriesCalculatorTest.cs (.../AssemblyCategoriesCalculatorTest.cs) (revision 61e0b1bf1351eabb70eccd3fafeb61ade378f44c) +++ Ringtoets/AssemblyTool/test/Ringtoets.AssemblyTool.KernelWrapper.Test/Calculators/Categories/AssemblyCategoriesCalculatorTest.cs (.../AssemblyCategoriesCalculatorTest.cs) (revision d75cba7f33dd4264452ed4dcceddd5ec79b210ea) @@ -243,7 +243,7 @@ Assert.AreEqual(AssemblyErrorMessageCreator.CreateGenericErrorMessage(), exception.Message); } } - + [Test] public void CalculateFailureMechanismCategories_KernelThrowsAssemblyException_ThrowAssemblyCategoriesCalculatorException() { @@ -340,7 +340,7 @@ Assert.AreEqual(AssemblyErrorMessageCreator.CreateGenericErrorMessage(), exception.Message); } } - + [Test] public void CalculateFailureMechanismSectionCategories_KernelThrowsAssemblyException_ThrowAssemblyCategoriesCalculatorException() { @@ -368,7 +368,7 @@ } [Test] - public void CalculateGeotechnicFailureMechanismSectionCategories_WithInput_InputCorrectlySetToKernel() + public void CalculateGeotechnicalFailureMechanismSectionCategories_WithInput_InputCorrectlySetToKernel() { // Setup AssemblyCategoriesInput assemblyCategoriesInput = CreateRandomAssemblyCategoriesInput(); @@ -382,7 +382,7 @@ var calculator = new AssemblyCategoriesCalculator(factory); // Call - calculator.CalculateGeotechnicFailureMechanismSectionCategories(assemblyCategoriesInput); + calculator.CalculateGeotechnicalFailureMechanismSectionCategories(assemblyCategoriesInput); // Assert Assert.AreEqual(assemblyCategoriesInput.LowerLimitNorm, kernel.LowerLimitNorm); @@ -393,7 +393,7 @@ } [Test] - public void CalculateGeotechnicFailureMechanismSectionCategories_KernelWithCompleteOutput_OutputCorrectlyReturnedByCalculator() + public void CalculateGeotechnicalFailureMechanismSectionCategories_KernelWithCompleteOutput_OutputCorrectlyReturnedByCalculator() { // Setup IEnumerable output = CreateFailureMechanismSectionCategoryKernelOutput(); @@ -407,7 +407,7 @@ var calculator = new AssemblyCategoriesCalculator(factory); // Call - IEnumerable result = calculator.CalculateGeotechnicFailureMechanismSectionCategories( + IEnumerable result = calculator.CalculateGeotechnicalFailureMechanismSectionCategories( CreateRandomAssemblyCategoriesInput()); // Assert @@ -416,7 +416,7 @@ } [Test] - public void CalculateGeotechnicFailureMechanismSectionCategories_KernelThrowsException_ThrowAssemblyCategoriesCalculatorException() + public void CalculateGeotechnicalFailureMechanismSectionCategories_KernelThrowsException_ThrowAssemblyCategoriesCalculatorException() { // Setup using (new AssemblyToolKernelFactoryConfig()) @@ -428,7 +428,7 @@ var calculator = new AssemblyCategoriesCalculator(factory); // Call - TestDelegate test = () => calculator.CalculateGeotechnicFailureMechanismSectionCategories( + TestDelegate test = () => calculator.CalculateGeotechnicalFailureMechanismSectionCategories( CreateRandomAssemblyCategoriesInput()); // Assert @@ -437,9 +437,9 @@ Assert.AreEqual(AssemblyErrorMessageCreator.CreateGenericErrorMessage(), exception.Message); } } - + [Test] - public void CalculateGeotechnicFailureMechanismSectionCategories_KernelThrowsAssemblyException_ThrowAssemblyCategoriesCalculatorException() + public void CalculateGeotechnicalFailureMechanismSectionCategories_KernelThrowsAssemblyException_ThrowAssemblyCategoriesCalculatorException() { // Setup using (new AssemblyToolKernelFactoryConfig()) @@ -451,7 +451,7 @@ var calculator = new AssemblyCategoriesCalculator(factory); // Call - TestDelegate test = () => calculator.CalculateGeotechnicFailureMechanismSectionCategories( + TestDelegate test = () => calculator.CalculateGeotechnicalFailureMechanismSectionCategories( CreateRandomAssemblyCategoriesInput()); // Assert Index: Ringtoets/AssemblyTool/test/Ringtoets.AssemblyTool.KernelWrapper.TestUtil.Test/Calculators/Categories/AssemblyCategoriesCalculatorStubTest.cs =================================================================== diff -u -r28bcc5f05ac19148d432c3051a88758c60c9dc0c -rd75cba7f33dd4264452ed4dcceddd5ec79b210ea --- Ringtoets/AssemblyTool/test/Ringtoets.AssemblyTool.KernelWrapper.TestUtil.Test/Calculators/Categories/AssemblyCategoriesCalculatorStubTest.cs (.../AssemblyCategoriesCalculatorStubTest.cs) (revision 28bcc5f05ac19148d432c3051a88758c60c9dc0c) +++ Ringtoets/AssemblyTool/test/Ringtoets.AssemblyTool.KernelWrapper.TestUtil.Test/Calculators/Categories/AssemblyCategoriesCalculatorStubTest.cs (.../AssemblyCategoriesCalculatorStubTest.cs) (revision d75cba7f33dd4264452ed4dcceddd5ec79b210ea) @@ -296,13 +296,13 @@ } [Test] - public void CalculateGeotechnicFailureMechanismSectionCategories_ThrowExceptionOnCalculateFalseAndOutputNotSet_ReturnsCategories() + public void CalculateGeotechnicalFailureMechanismSectionCategories_ThrowExceptionOnCalculateFalseAndOutputNotSet_ReturnsCategories() { // Setup var calculator = new AssemblyCategoriesCalculatorStub(); // Call - IEnumerable result = calculator.CalculateGeotechnicFailureMechanismSectionCategories(CreateAssemblyCategoriesInput()); + IEnumerable result = calculator.CalculateGeotechnicalFailureMechanismSectionCategories(CreateAssemblyCategoriesInput()); // Assert Assert.AreSame(calculator.FailureMechanismSectionCategoriesOutput, result); @@ -328,7 +328,7 @@ } [Test] - public void CalculateGeotechnicFailureMechanismSectionCategories_ThrowExceptionOnCalculateFalseAndOutputSet_ReturnsCategories() + public void CalculateGeotechnicalFailureMechanismSectionCategories_ThrowExceptionOnCalculateFalseAndOutputSet_ReturnsCategories() { // Setup var calculator = new AssemblyCategoriesCalculatorStub @@ -337,30 +337,30 @@ }; // Call - IEnumerable result = calculator.CalculateGeotechnicFailureMechanismSectionCategories(CreateAssemblyCategoriesInput()); + IEnumerable result = calculator.CalculateGeotechnicalFailureMechanismSectionCategories(CreateAssemblyCategoriesInput()); // Assert Assert.AreSame(calculator.FailureMechanismSectionCategoriesOutput, result); } [Test] - public void CalculateGeotechnicFailureMechanismSectionCategories_ThrowExceptionOnCalculateFalse_SetsInput() + public void CalculateGeotechnicalFailureMechanismSectionCategories_ThrowExceptionOnCalculateFalse_SetsInput() { // Setup AssemblyCategoriesInput assemblyCategoriesInput = CreateAssemblyCategoriesInput(); var calculator = new AssemblyCategoriesCalculatorStub(); // Call - calculator.CalculateGeotechnicFailureMechanismSectionCategories( + calculator.CalculateGeotechnicalFailureMechanismSectionCategories( assemblyCategoriesInput); // Assert Assert.AreSame(assemblyCategoriesInput, calculator.AssemblyCategoriesInput); } [Test] - public void CalculateGeotechnicFailureMechanismSectionCategories_ThrowExceptionOnCalculateTrue_ThrowsAssemblyCategoriesCalculatorException() + public void CalculateGeotechnicalFailureMechanismSectionCategories_ThrowExceptionOnCalculateTrue_ThrowsAssemblyCategoriesCalculatorException() { // Setup var calculator = new AssemblyCategoriesCalculatorStub @@ -369,7 +369,7 @@ }; // Call - TestDelegate test = () => calculator.CalculateGeotechnicFailureMechanismSectionCategories(CreateAssemblyCategoriesInput()); + TestDelegate test = () => calculator.CalculateGeotechnicalFailureMechanismSectionCategories(CreateAssemblyCategoriesInput()); // Assert var exception = Assert.Throws(test); Index: Ringtoets/AssemblyTool/test/Ringtoets.AssemblyTool.KernelWrapper.TestUtil/Calculators/Categories/AssemblyCategoriesCalculatorStub.cs =================================================================== diff -u -r28bcc5f05ac19148d432c3051a88758c60c9dc0c -rd75cba7f33dd4264452ed4dcceddd5ec79b210ea --- Ringtoets/AssemblyTool/test/Ringtoets.AssemblyTool.KernelWrapper.TestUtil/Calculators/Categories/AssemblyCategoriesCalculatorStub.cs (.../AssemblyCategoriesCalculatorStub.cs) (revision 28bcc5f05ac19148d432c3051a88758c60c9dc0c) +++ Ringtoets/AssemblyTool/test/Ringtoets.AssemblyTool.KernelWrapper.TestUtil/Calculators/Categories/AssemblyCategoriesCalculatorStub.cs (.../AssemblyCategoriesCalculatorStub.cs) (revision d75cba7f33dd4264452ed4dcceddd5ec79b210ea) @@ -122,7 +122,7 @@ }); } - public IEnumerable CalculateGeotechnicFailureMechanismSectionCategories( + public IEnumerable CalculateGeotechnicalFailureMechanismSectionCategories( AssemblyCategoriesInput assemblyCategoriesInput) { if (ThrowExceptionOnCalculate) Index: Ringtoets/Common/src/Ringtoets.Common.Data/AssemblyTool/AssemblyToolCategoriesFactory.cs =================================================================== diff -u -r8b119f52dad2aeba53f63b9bde9e6176452e834e -rd75cba7f33dd4264452ed4dcceddd5ec79b210ea --- Ringtoets/Common/src/Ringtoets.Common.Data/AssemblyTool/AssemblyToolCategoriesFactory.cs (.../AssemblyToolCategoriesFactory.cs) (revision 8b119f52dad2aeba53f63b9bde9e6176452e834e) +++ Ringtoets/Common/src/Ringtoets.Common.Data/AssemblyTool/AssemblyToolCategoriesFactory.cs (.../AssemblyToolCategoriesFactory.cs) (revision d75cba7f33dd4264452ed4dcceddd5ec79b210ea) @@ -120,7 +120,7 @@ } /// - /// Creates the geotechnic failure mechanism section assembly categories. + /// Creates the geotechnical failure mechanism section assembly categories. /// /// The signaling norm to use in the calculation. /// The lower limit norm to use in the calculation. @@ -129,7 +129,7 @@ /// An with categories of /// . /// Thrown when an error occurred while creating the categories. - public static IEnumerable CreateGeotechnicFailureMechanismSectionAssemblyCategories( + public static IEnumerable CreateGeotechnicalFailureMechanismSectionAssemblyCategories( double signalingNorm, double lowerLimitNorm, double failureMechanismContribution, @@ -140,10 +140,10 @@ try { - return calculator.CalculateGeotechnicFailureMechanismSectionCategories(new AssemblyCategoriesInput(n, - failureMechanismContribution, - signalingNorm, - lowerLimitNorm)); + return calculator.CalculateGeotechnicalFailureMechanismSectionCategories(new AssemblyCategoriesInput(n, + failureMechanismContribution, + signalingNorm, + lowerLimitNorm)); } catch (AssemblyCategoriesCalculatorException e) { Fisheye: Tag d75cba7f33dd4264452ed4dcceddd5ec79b210ea refers to a dead (removed) revision in file `Ringtoets/Common/src/Ringtoets.Common.Forms/PropertyClasses/GeotechnicFailureMechanismAssemblyCategoriesProperties.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/Common/src/Ringtoets.Common.Forms/PropertyClasses/GeotechnicalFailureMechanismAssemblyCategoriesProperties.cs =================================================================== diff -u --- Ringtoets/Common/src/Ringtoets.Common.Forms/PropertyClasses/GeotechnicalFailureMechanismAssemblyCategoriesProperties.cs (revision 0) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/PropertyClasses/GeotechnicalFailureMechanismAssemblyCategoriesProperties.cs (revision d75cba7f33dd4264452ed4dcceddd5ec79b210ea) @@ -0,0 +1,58 @@ +// 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.Linq; +using Ringtoets.Common.Data.AssemblyTool; +using Ringtoets.Common.Data.AssessmentSection; +using Ringtoets.Common.Data.Contribution; +using Ringtoets.Common.Data.Exceptions; +using Ringtoets.Common.Data.FailureMechanism; + +namespace Ringtoets.Common.Forms.PropertyClasses +{ + /// + /// ViewModel of the category boundaries in a geotechnical for properties panel. + /// + public class GeotechnicalFailureMechanismAssemblyCategoriesProperties : FailureMechanismAssemblyCategoriesBaseProperties + { + /// + /// + /// Creates a new instance of . + /// + public GeotechnicalFailureMechanismAssemblyCategoriesProperties(IFailureMechanism failureMechanism, + IAssessmentSection assessmentSection, + Func getNFunc) : base(failureMechanism, assessmentSection, getNFunc) {} + + /// + /// Thrown when an error occurred while creating the categories. + protected override IEnumerable CreateFailureMechanismSectionAssemblyCategories() + { + FailureMechanismContribution failureMechanismContribution = AssessmentSection.FailureMechanismContribution; + return AssemblyToolCategoriesFactory.CreateGeotechnicalFailureMechanismSectionAssemblyCategories(failureMechanismContribution.SignalingNorm, + failureMechanismContribution.LowerLimitNorm, + data.Contribution, + GetNFunc()) + .Select(category => new FailureMechanismSectionAssemblyCategoryProperties(category)); + } + } +} \ No newline at end of file Index: Ringtoets/Common/src/Ringtoets.Common.Forms/Ringtoets.Common.Forms.csproj =================================================================== diff -u -rab0620a9becf183f9796fd55ae83dcbf43ac86c4 -rd75cba7f33dd4264452ed4dcceddd5ec79b210ea --- Ringtoets/Common/src/Ringtoets.Common.Forms/Ringtoets.Common.Forms.csproj (.../Ringtoets.Common.Forms.csproj) (revision ab0620a9becf183f9796fd55ae83dcbf43ac86c4) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/Ringtoets.Common.Forms.csproj (.../Ringtoets.Common.Forms.csproj) (revision d75cba7f33dd4264452ed4dcceddd5ec79b210ea) @@ -96,7 +96,7 @@ - + Index: Ringtoets/Common/test/Ringtoets.Common.Data.Test/AssemblyTool/AssemblyToolCategoriesFactoryTest.cs =================================================================== diff -u -r8b119f52dad2aeba53f63b9bde9e6176452e834e -rd75cba7f33dd4264452ed4dcceddd5ec79b210ea --- Ringtoets/Common/test/Ringtoets.Common.Data.Test/AssemblyTool/AssemblyToolCategoriesFactoryTest.cs (.../AssemblyToolCategoriesFactoryTest.cs) (revision 8b119f52dad2aeba53f63b9bde9e6176452e834e) +++ Ringtoets/Common/test/Ringtoets.Common.Data.Test/AssemblyTool/AssemblyToolCategoriesFactoryTest.cs (.../AssemblyToolCategoriesFactoryTest.cs) (revision d75cba7f33dd4264452ed4dcceddd5ec79b210ea) @@ -268,7 +268,7 @@ } [Test] - public void CreateGeotechnicFailureMechanismSectionAssemblyCategories_WithInput_SetsInputOnCalculator() + public void CreateGeotechnicalFailureMechanismSectionAssemblyCategories_WithInput_SetsInputOnCalculator() { // Setup var random = new Random(11); @@ -283,10 +283,10 @@ AssemblyCategoriesCalculatorStub calculator = calculatorFactory.LastCreatedAssemblyCategoriesCalculator; // Call - AssemblyToolCategoriesFactory.CreateGeotechnicFailureMechanismSectionAssemblyCategories(signalingNorm, - lowerLimitNorm, - failureMechanismContribution, - n); + AssemblyToolCategoriesFactory.CreateGeotechnicalFailureMechanismSectionAssemblyCategories(signalingNorm, + lowerLimitNorm, + failureMechanismContribution, + n); // Assert AssemblyCategoriesInput assemblyCategoriesInput = calculator.AssemblyCategoriesInput; @@ -298,7 +298,7 @@ } [Test] - public void CreateGeotechnicFailureMechanismSectionAssemblyCategories_CalculatorRan_ReturnsOutput() + public void CreateGeotechnicalFailureMechanismSectionAssemblyCategories_CalculatorRan_ReturnsOutput() { // Setup var random = new Random(11); @@ -313,7 +313,7 @@ AssemblyCategoriesCalculatorStub calculator = calculatorFactory.LastCreatedAssemblyCategoriesCalculator; // Call - FailureMechanismSectionAssemblyCategory[] output = AssemblyToolCategoriesFactory.CreateGeotechnicFailureMechanismSectionAssemblyCategories( + FailureMechanismSectionAssemblyCategory[] output = AssemblyToolCategoriesFactory.CreateGeotechnicalFailureMechanismSectionAssemblyCategories( signalingNorm, lowerLimitNorm, failureMechanismContribution, @@ -330,7 +330,7 @@ } [Test] - public void CreateGeotechnicFailureMechanismSectionAssemblyCategories_CalculatorThrowsException_ThrowsAssemblyException() + public void CreateGeotechnicalFailureMechanismSectionAssemblyCategories_CalculatorThrowsException_ThrowsAssemblyException() { // Setup using (new AssemblyToolCalculatorFactoryConfig()) @@ -340,7 +340,7 @@ calculator.ThrowExceptionOnCalculate = true; // Call - TestDelegate test = () => AssemblyToolCategoriesFactory.CreateGeotechnicFailureMechanismSectionAssemblyCategories(0, 0, 0, 0); + TestDelegate test = () => AssemblyToolCategoriesFactory.CreateGeotechnicalFailureMechanismSectionAssemblyCategories(0, 0, 0, 0); // Assert var exception = Assert.Throws(test); Fisheye: Tag d75cba7f33dd4264452ed4dcceddd5ec79b210ea refers to a dead (removed) revision in file `Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PropertyClasses/GeotechnicFailureMechanismAssemblyCategoriesPropertiesTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PropertyClasses/GeotechnicalFailureMechanismAssemblyCategoriesPropertiesTest.cs =================================================================== diff -u --- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PropertyClasses/GeotechnicalFailureMechanismAssemblyCategoriesPropertiesTest.cs (revision 0) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PropertyClasses/GeotechnicalFailureMechanismAssemblyCategoriesPropertiesTest.cs (revision d75cba7f33dd4264452ed4dcceddd5ec79b210ea) @@ -0,0 +1,104 @@ +// 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.Collections.Generic; +using Core.Common.TestUtil; +using NUnit.Framework; +using Rhino.Mocks; +using Ringtoets.AssemblyTool.Data; +using Ringtoets.AssemblyTool.KernelWrapper.TestUtil.Calculators; +using Ringtoets.Common.Data.AssemblyTool; +using Ringtoets.Common.Data.Contribution; +using Ringtoets.Common.Data.FailureMechanism; +using Ringtoets.Common.Data.TestUtil; +using Ringtoets.Common.Forms.PropertyClasses; +using Ringtoets.Common.Forms.TestUtil; + +namespace Ringtoets.Common.Forms.Test.PropertyClasses +{ + [TestFixture] + public class GeotechnicalFailureMechanismAssemblyCategoriesPropertiesTest + { + [Test] + public void Constructor_ValidParameters_ExpectedValues() + { + // Setup + const double n = 1.0; + + var mocks = new MockRepository(); + var failureMechanism = mocks.Stub(); + failureMechanism.Contribution = 5; + var assessmentSection = new AssessmentSectionStub(); + mocks.ReplayAll(); + + using (new AssemblyToolCalculatorFactoryConfig()) + { + // Call + var properties = new GeotechnicalFailureMechanismAssemblyCategoriesProperties(failureMechanism, + assessmentSection, + () => n); + + // Assert + Assert.IsInstanceOf(properties); + + FailureMechanismContribution failureMechanismContribution = assessmentSection.FailureMechanismContribution; + IEnumerable expectedFailureMechanismCategories = + AssemblyToolCategoriesFactory.CreateFailureMechanismAssemblyCategories( + failureMechanismContribution.SignalingNorm, + failureMechanismContribution.LowerLimitNorm, + failureMechanism.Contribution, + n); + + IEnumerable expectedFailureMechanismSectionCategories = + AssemblyToolCategoriesFactory.CreateGeotechnicalFailureMechanismSectionAssemblyCategories( + failureMechanismContribution.SignalingNorm, + failureMechanismContribution.LowerLimitNorm, + failureMechanism.Contribution, + n); + + AssemblyCategoryPropertiesTestHelper.AssertFailureMechanismAssemblyCategoryProperties( + expectedFailureMechanismCategories, + expectedFailureMechanismSectionCategories, + properties); + + mocks.VerifyAll(); + } + } + + [Test] + public void Constructor_Always_ReturnsExpectedPropertyCount() + { + // Setup + var mocks = new MockRepository(); + var failureMechanism = mocks.Stub(); + var assessmentSection = new AssessmentSectionStub(); + mocks.ReplayAll(); + + // Call + var properties = new GeotechnicalFailureMechanismAssemblyCategoriesProperties(failureMechanism, + assessmentSection, + () => 0.01); + // Assert + Assert.AreEqual(2, PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties).Count); + mocks.VerifyAll(); + } + } +} \ No newline at end of file Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Ringtoets.Common.Forms.Test.csproj =================================================================== diff -u -rab0620a9becf183f9796fd55ae83dcbf43ac86c4 -rd75cba7f33dd4264452ed4dcceddd5ec79b210ea --- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Ringtoets.Common.Forms.Test.csproj (.../Ringtoets.Common.Forms.Test.csproj) (revision ab0620a9becf183f9796fd55ae83dcbf43ac86c4) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Ringtoets.Common.Forms.Test.csproj (.../Ringtoets.Common.Forms.Test.csproj) (revision d75cba7f33dd4264452ed4dcceddd5ec79b210ea) @@ -98,7 +98,7 @@ - + Index: Ringtoets/Integration/src/Ringtoets.Integration.Plugin/RingtoetsPlugin.cs =================================================================== diff -u -rca941595ed8f298fda9bad3c0851bdbd94e180c2 -rd75cba7f33dd4264452ed4dcceddd5ec79b210ea --- Ringtoets/Integration/src/Ringtoets.Integration.Plugin/RingtoetsPlugin.cs (.../RingtoetsPlugin.cs) (revision ca941595ed8f298fda9bad3c0851bdbd94e180c2) +++ Ringtoets/Integration/src/Ringtoets.Integration.Plugin/RingtoetsPlugin.cs (.../RingtoetsPlugin.cs) (revision d75cba7f33dd4264452ed4dcceddd5ec79b210ea) @@ -378,11 +378,11 @@ { CreateInstance = context => new ReferenceLineProperties(context.WrappedData) }; - yield return new PropertyInfo + yield return new PropertyInfo { - CreateInstance = context => new GeotechnicFailureMechanismAssemblyCategoriesProperties(context.WrappedData, - context.AssessmentSection, - context.GetNFunc) + CreateInstance = context => new GeotechnicalFailureMechanismAssemblyCategoriesProperties(context.WrappedData, + context.AssessmentSection, + context.GetNFunc) }; yield return new PropertyInfo { Index: Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/PropertyInfos/GeotechnicalFailureMechanismAssemblyCategoriesPropertyInfoTest.cs =================================================================== diff -u -rca941595ed8f298fda9bad3c0851bdbd94e180c2 -rd75cba7f33dd4264452ed4dcceddd5ec79b210ea --- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/PropertyInfos/GeotechnicalFailureMechanismAssemblyCategoriesPropertyInfoTest.cs (.../GeotechnicalFailureMechanismAssemblyCategoriesPropertyInfoTest.cs) (revision ca941595ed8f298fda9bad3c0851bdbd94e180c2) +++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/PropertyInfos/GeotechnicalFailureMechanismAssemblyCategoriesPropertyInfoTest.cs (.../GeotechnicalFailureMechanismAssemblyCategoriesPropertyInfoTest.cs) (revision d75cba7f33dd4264452ed4dcceddd5ec79b210ea) @@ -41,7 +41,7 @@ public void SetUp() { plugin = new RingtoetsPlugin(); - info = plugin.GetPropertyInfos().First(tni => tni.PropertyObjectType == typeof(GeotechnicFailureMechanismAssemblyCategoriesProperties)); + info = plugin.GetPropertyInfos().First(tni => tni.PropertyObjectType == typeof(GeotechnicalFailureMechanismAssemblyCategoriesProperties)); } [TearDown] @@ -72,7 +72,7 @@ IObjectProperties objectProperties = info.CreateInstance(context); // Assert - Assert.IsInstanceOf(objectProperties); + Assert.IsInstanceOf(objectProperties); Assert.AreSame(failureMechanism, objectProperties.Data); mocks.VerifyAll(); Index: Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/RingtoetsPluginTest.cs =================================================================== diff -u -rca941595ed8f298fda9bad3c0851bdbd94e180c2 -rd75cba7f33dd4264452ed4dcceddd5ec79b210ea --- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/RingtoetsPluginTest.cs (.../RingtoetsPluginTest.cs) (revision ca941595ed8f298fda9bad3c0851bdbd94e180c2) +++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/RingtoetsPluginTest.cs (.../RingtoetsPluginTest.cs) (revision d75cba7f33dd4264452ed4dcceddd5ec79b210ea) @@ -346,7 +346,7 @@ PluginTestHelper.AssertPropertyInfoDefined( propertyInfos, typeof(GeotechnicalFailureMechanismAssemblyCategoriesContext), - typeof(GeotechnicFailureMechanismAssemblyCategoriesProperties)); + typeof(GeotechnicalFailureMechanismAssemblyCategoriesProperties)); } }