Index: Ringtoets/AssemblyTool/src/Ringtoets.AssemblyTool.KernelWrapper/Calculators/Categories/AssemblyCategoriesCalculator.cs =================================================================== diff -u -r79eb920077047065defbdf7f5b7d6bc55e85c3f4 -r354a7f9f917922dc63ff1f54ffbcc10c88dde45b --- Ringtoets/AssemblyTool/src/Ringtoets.AssemblyTool.KernelWrapper/Calculators/Categories/AssemblyCategoriesCalculator.cs (.../AssemblyCategoriesCalculator.cs) (revision 79eb920077047065defbdf7f5b7d6bc55e85c3f4) +++ Ringtoets/AssemblyTool/src/Ringtoets.AssemblyTool.KernelWrapper/Calculators/Categories/AssemblyCategoriesCalculator.cs (.../AssemblyCategoriesCalculator.cs) (revision 354a7f9f917922dc63ff1f54ffbcc10c88dde45b) @@ -116,15 +116,16 @@ } } - public IEnumerable CalculateGeotechnicalFailureMechanismSectionCategories( - AssemblyCategoriesInput assemblyCategoriesInput) + public IEnumerable CalculateGeotechnicalFailureMechanismSectionCategories(double normativeNorm, + double failureMechanismN, + double failureMechanismContribution) { try { ICategoryLimitsCalculator kernel = factory.CreateAssemblyCategoriesKernel(); CategoriesList output = kernel.CalculateFmSectionCategoryLimitsWbi02( - new AssessmentSection(1, assemblyCategoriesInput.SignalingNorm, assemblyCategoriesInput.LowerLimitNorm), - new FailureMechanism(assemblyCategoriesInput.N, assemblyCategoriesInput.FailureMechanismContribution)); + normativeNorm, + new FailureMechanism(failureMechanismN, failureMechanismContribution)); return AssemblyCategoryCreator.CreateFailureMechanismSectionAssemblyCategories(output); } Index: Ringtoets/AssemblyTool/src/Ringtoets.AssemblyTool.KernelWrapper/Calculators/Categories/IAssemblyCategoriesCalculator.cs =================================================================== diff -u -rd75cba7f33dd4264452ed4dcceddd5ec79b210ea -r354a7f9f917922dc63ff1f54ffbcc10c88dde45b --- Ringtoets/AssemblyTool/src/Ringtoets.AssemblyTool.KernelWrapper/Calculators/Categories/IAssemblyCategoriesCalculator.cs (.../IAssemblyCategoriesCalculator.cs) (revision d75cba7f33dd4264452ed4dcceddd5ec79b210ea) +++ Ringtoets/AssemblyTool/src/Ringtoets.AssemblyTool.KernelWrapper/Calculators/Categories/IAssemblyCategoriesCalculator.cs (.../IAssemblyCategoriesCalculator.cs) (revision 354a7f9f917922dc63ff1f54ffbcc10c88dde45b) @@ -67,13 +67,15 @@ /// /// Performs the calculation for getting the geotechnical failure mechanism section categories. /// - /// The object containing the input parameters for - /// determining the assembly categories. + /// The norm which has been defined on the assessment section. + /// The 'N' parameter used to factor in the 'length effect'. + /// The contribution of a failure mechanism. /// An with categories of /// . /// Thrown when an error occurs /// while performing the calculation. - IEnumerable CalculateGeotechnicalFailureMechanismSectionCategories( - AssemblyCategoriesInput assemblyCategoriesInput); + IEnumerable CalculateGeotechnicalFailureMechanismSectionCategories(double normativeNorm, + double failureMechanismN, + double failureMechanismContribution); } } \ No newline at end of file Index: Ringtoets/AssemblyTool/test/Ringtoets.AssemblyTool.KernelWrapper.Test/Calculators/Categories/AssemblyCategoriesCalculatorTest.cs =================================================================== diff -u -r79eb920077047065defbdf7f5b7d6bc55e85c3f4 -r354a7f9f917922dc63ff1f54ffbcc10c88dde45b --- Ringtoets/AssemblyTool/test/Ringtoets.AssemblyTool.KernelWrapper.Test/Calculators/Categories/AssemblyCategoriesCalculatorTest.cs (.../AssemblyCategoriesCalculatorTest.cs) (revision 79eb920077047065defbdf7f5b7d6bc55e85c3f4) +++ Ringtoets/AssemblyTool/test/Ringtoets.AssemblyTool.KernelWrapper.Test/Calculators/Categories/AssemblyCategoriesCalculatorTest.cs (.../AssemblyCategoriesCalculatorTest.cs) (revision 354a7f9f917922dc63ff1f54ffbcc10c88dde45b) @@ -369,7 +369,10 @@ public void CalculateGeotechnicalFailureMechanismSectionCategories_WithInput_InputCorrectlySetToKernel() { // Setup - AssemblyCategoriesInput assemblyCategoriesInput = CreateRandomAssemblyCategoriesInput(); + var random = new Random(21); + double normativeNorm = random.NextDouble(); + double failureMechanismN = random.NextDouble(); + double failureMechanismContribution = random.NextDouble(); using (new AssemblyToolKernelFactoryConfig()) { @@ -380,20 +383,22 @@ var calculator = new AssemblyCategoriesCalculator(factory); // Call - calculator.CalculateGeotechnicalFailureMechanismSectionCategories(assemblyCategoriesInput); + calculator.CalculateGeotechnicalFailureMechanismSectionCategories(normativeNorm, + failureMechanismN, + failureMechanismContribution); // Assert - Assert.AreEqual(assemblyCategoriesInput.LowerLimitNorm, kernel.LowerLimitNorm); - Assert.AreEqual(assemblyCategoriesInput.SignalingNorm, kernel.SignalingNorm); - Assert.AreEqual(assemblyCategoriesInput.FailureMechanismContribution, kernel.FailureMechanismContribution); - Assert.AreEqual(assemblyCategoriesInput.N, kernel.N); + Assert.AreEqual(normativeNorm, kernel.AssessmentSectionNorm); + Assert.AreEqual(failureMechanismContribution, kernel.FailureMechanismContribution); + Assert.AreEqual(failureMechanismN, kernel.N); } } [Test] public void CalculateGeotechnicalFailureMechanismSectionCategories_KernelWithCompleteOutput_OutputCorrectlyReturnedByCalculator() { // Setup + var random = new Random(21); CategoriesList output = CategoriesListTestFactory.CreateFailureMechanismSectionCategories(); using (new AssemblyToolKernelFactoryConfig()) @@ -406,7 +411,9 @@ // Call IEnumerable result = calculator.CalculateGeotechnicalFailureMechanismSectionCategories( - CreateRandomAssemblyCategoriesInput()); + random.NextDouble(), + random.NextDouble(), + random.NextDouble()); // Assert AssemblyCategoryAssert.AssertFailureMechanismSectionAssemblyCategories(output, result); @@ -417,6 +424,7 @@ public void CalculateGeotechnicalFailureMechanismSectionCategories_KernelThrowsException_ThrowAssemblyCategoriesCalculatorException() { // Setup + var random = new Random(21); using (new AssemblyToolKernelFactoryConfig()) { var factory = (TestAssemblyToolKernelFactory) AssemblyToolKernelFactory.Instance; @@ -427,7 +435,9 @@ // Call TestDelegate test = () => calculator.CalculateGeotechnicalFailureMechanismSectionCategories( - CreateRandomAssemblyCategoriesInput()); + random.NextDouble(), + random.NextDouble(), + random.NextDouble()); // Assert var exception = Assert.Throws(test); @@ -440,6 +450,7 @@ public void CalculateGeotechnicalFailureMechanismSectionCategories_KernelThrowsAssemblyException_ThrowAssemblyCategoriesCalculatorException() { // Setup + var random = new Random(21); using (new AssemblyToolKernelFactoryConfig()) { var factory = (TestAssemblyToolKernelFactory) AssemblyToolKernelFactory.Instance; @@ -450,7 +461,9 @@ // Call TestDelegate test = () => calculator.CalculateGeotechnicalFailureMechanismSectionCategories( - CreateRandomAssemblyCategoriesInput()); + random.NextDouble(), + random.NextDouble(), + random.NextDouble()); // Assert var exception = Assert.Throws(test); Index: Ringtoets/AssemblyTool/test/Ringtoets.AssemblyTool.KernelWrapper.TestUtil.Test/Calculators/Categories/AssemblyCategoriesCalculatorStubTest.cs =================================================================== diff -u -r4f8de1ec63217365ef12dbbca6092f49a4b24113 -r354a7f9f917922dc63ff1f54ffbcc10c88dde45b --- Ringtoets/AssemblyTool/test/Ringtoets.AssemblyTool.KernelWrapper.TestUtil.Test/Calculators/Categories/AssemblyCategoriesCalculatorStubTest.cs (.../AssemblyCategoriesCalculatorStubTest.cs) (revision 4f8de1ec63217365ef12dbbca6092f49a4b24113) +++ Ringtoets/AssemblyTool/test/Ringtoets.AssemblyTool.KernelWrapper.TestUtil.Test/Calculators/Categories/AssemblyCategoriesCalculatorStubTest.cs (.../AssemblyCategoriesCalculatorStubTest.cs) (revision 354a7f9f917922dc63ff1f54ffbcc10c88dde45b) @@ -45,6 +45,9 @@ Assert.IsNull(calculator.AssemblyCategoriesInput); Assert.AreEqual(0.0, calculator.SignalingNorm); Assert.AreEqual(0.0, calculator.LowerLimitNorm); + Assert.AreEqual(0.0, calculator.NormativeNorm); + Assert.AreEqual(0.0, calculator.FailureMechanismN); + Assert.AreEqual(0.0, calculator.FailureMechanismContribution); } [Test] @@ -299,10 +302,13 @@ public void CalculateGeotechnicalFailureMechanismSectionCategories_ThrowExceptionOnCalculateFalseAndOutputNotSet_ReturnsCategories() { // Setup + var random = new Random(21); var calculator = new AssemblyCategoriesCalculatorStub(); // Call - IEnumerable result = calculator.CalculateGeotechnicalFailureMechanismSectionCategories(CreateAssemblyCategoriesInput()); + IEnumerable result = calculator.CalculateGeotechnicalFailureMechanismSectionCategories(random.NextDouble(), + random.NextDouble(), + random.NextDouble()); // Assert Assert.AreSame(calculator.GeoTechnicalFailureMechanismSectionCategoriesOutput, result); @@ -331,13 +337,16 @@ public void CalculateGeotechnicalFailureMechanismSectionCategories_ThrowExceptionOnCalculateFalseAndOutputSet_ReturnsCategories() { // Setup + var random = new Random(21); var calculator = new AssemblyCategoriesCalculatorStub { GeoTechnicalFailureMechanismSectionCategoriesOutput = Enumerable.Empty() }; // Call - IEnumerable result = calculator.CalculateGeotechnicalFailureMechanismSectionCategories(CreateAssemblyCategoriesInput()); + IEnumerable result = calculator.CalculateGeotechnicalFailureMechanismSectionCategories(random.NextDouble(), + random.NextDouble(), + random.NextDouble()); // Assert Assert.AreSame(calculator.GeoTechnicalFailureMechanismSectionCategoriesOutput, result); @@ -347,29 +356,36 @@ public void CalculateGeotechnicalFailureMechanismSectionCategories_ThrowExceptionOnCalculateFalse_SetsInput() { // Setup - AssemblyCategoriesInput assemblyCategoriesInput = CreateAssemblyCategoriesInput(); + var random = new Random(21); + double normativeNorm = random.NextDouble(); + double n = random.NextDouble(); + double failureMechanismContribution = random.NextDouble(); var calculator = new AssemblyCategoriesCalculatorStub(); // Call - calculator.CalculateGeotechnicalFailureMechanismSectionCategories( - assemblyCategoriesInput); + calculator.CalculateGeotechnicalFailureMechanismSectionCategories(normativeNorm, n, failureMechanismContribution); // Assert - Assert.AreSame(assemblyCategoriesInput, calculator.AssemblyCategoriesInput); + Assert.AreEqual(normativeNorm, calculator.NormativeNorm); + Assert.AreEqual(n, calculator.FailureMechanismN); + Assert.AreEqual(failureMechanismContribution, calculator.FailureMechanismContribution); } [Test] public void CalculateGeotechnicalFailureMechanismSectionCategories_ThrowExceptionOnCalculateTrue_ThrowsAssemblyCategoriesCalculatorException() { // Setup + var random = new Random(21); var calculator = new AssemblyCategoriesCalculatorStub { ThrowExceptionOnCalculate = true }; // Call - TestDelegate test = () => calculator.CalculateGeotechnicalFailureMechanismSectionCategories(CreateAssemblyCategoriesInput()); + TestDelegate test = () => calculator.CalculateGeotechnicalFailureMechanismSectionCategories(random.NextDouble(), + random.NextDouble(), + random.NextDouble()); // Assert var exception = Assert.Throws(test); Index: Ringtoets/AssemblyTool/test/Ringtoets.AssemblyTool.KernelWrapper.TestUtil/Calculators/Categories/AssemblyCategoriesCalculatorStub.cs =================================================================== diff -u -r4f8de1ec63217365ef12dbbca6092f49a4b24113 -r354a7f9f917922dc63ff1f54ffbcc10c88dde45b --- Ringtoets/AssemblyTool/test/Ringtoets.AssemblyTool.KernelWrapper.TestUtil/Calculators/Categories/AssemblyCategoriesCalculatorStub.cs (.../AssemblyCategoriesCalculatorStub.cs) (revision 4f8de1ec63217365ef12dbbca6092f49a4b24113) +++ Ringtoets/AssemblyTool/test/Ringtoets.AssemblyTool.KernelWrapper.TestUtil/Calculators/Categories/AssemblyCategoriesCalculatorStub.cs (.../AssemblyCategoriesCalculatorStub.cs) (revision 354a7f9f917922dc63ff1f54ffbcc10c88dde45b) @@ -42,6 +42,22 @@ public double LowerLimitNorm { get; private set; } /// + /// Gets the normative norm that is used in the calculation. + /// + public double NormativeNorm { get; private set; } + + /// + /// Gets the 'N' parameter used to factor in the 'length effect' + /// that is used in the calculation. + /// + public double FailureMechanismN { get; private set; } + + /// + /// Gets the failure mechanism contribution that is used in the calculation. + /// + public double FailureMechanismContribution { get; private set; } + + /// /// Gets the assembly categories input used in the assembly calculation methods. /// public AssemblyCategoriesInput AssemblyCategoriesInput { get; private set; } @@ -128,14 +144,18 @@ } public IEnumerable CalculateGeotechnicalFailureMechanismSectionCategories( - AssemblyCategoriesInput assemblyCategoriesInput) + double normativeNorm, + double failureMechanismN, + double failureMechanismContribution) { if (ThrowExceptionOnCalculate) { throw new AssemblyCategoriesCalculatorException("Message", new Exception()); } - AssemblyCategoriesInput = assemblyCategoriesInput; + NormativeNorm = normativeNorm; + FailureMechanismN = failureMechanismN; + FailureMechanismContribution = failureMechanismContribution; return GeoTechnicalFailureMechanismSectionCategoriesOutput ?? (GeoTechnicalFailureMechanismSectionCategoriesOutput = new[]