Index: Ringtoets/AssemblyTool/src/Ringtoets.AssemblyTool.KernelWrapper/Calculators/Assessments/FailureMechanismSectionAssessmentAssemblyCalculator.cs =================================================================== diff -u -r69292416d79293f09adcebad2fe7ac6869b6b16e -r5b0e8c5af142efae756ed228ffd8ddbd8457474a --- Ringtoets/AssemblyTool/src/Ringtoets.AssemblyTool.KernelWrapper/Calculators/Assessments/FailureMechanismSectionAssessmentAssemblyCalculator.cs (.../FailureMechanismSectionAssessmentAssemblyCalculator.cs) (revision 69292416d79293f09adcebad2fe7ac6869b6b16e) +++ Ringtoets/AssemblyTool/src/Ringtoets.AssemblyTool.KernelWrapper/Calculators/Assessments/FailureMechanismSectionAssessmentAssemblyCalculator.cs (.../FailureMechanismSectionAssessmentAssemblyCalculator.cs) (revision 5b0e8c5af142efae756ed228ffd8ddbd8457474a) @@ -52,31 +52,31 @@ this.factory = factory; } - public FailureMechanismSectionAssessment AssembleSimpleAssessment(SimpleAssessmentResultType input) + public FailureMechanismSectionAssembly AssembleSimpleAssessment(SimpleAssessmentResultType input) { try { IFailureMechanismSectionAssemblyCalculator kernel = factory.CreateFailureMechanismSectionAssemblyKernel(); CalculationOutput output = kernel.SimpleAssessmentDirectFailureMechanisms( FailureMechanismSectionAssemblyCalculatorInputCreator.CreateSimpleCalculationResult(input)); - return FailureMechanismSectionAssessmentCreator.Create(output.Result); + return FailureMechanismSectionAssemblyCreator.Create(output.Result); } catch (Exception e) { throw new FailureMechanismSectionAssessmentAssemblyCalculatorException(e.Message, e); } } - public FailureMechanismSectionAssessment AssembleSimpleAssessment(SimpleAssessmentResultValidityOnlyType input) + public FailureMechanismSectionAssembly AssembleSimpleAssessment(SimpleAssessmentResultValidityOnlyType input) { try { IFailureMechanismSectionAssemblyCalculator kernel = factory.CreateFailureMechanismSectionAssemblyKernel(); CalculationOutput output = kernel.SimpleAssessmentDirectFailureMechanisms( FailureMechanismSectionAssemblyCalculatorInputCreator.CreateSimplecalclCalculationResultValidityOnly(input)); - return FailureMechanismSectionAssessmentCreator.Create(output.Result); + return FailureMechanismSectionAssemblyCreator.Create(output.Result); } catch (Exception e) { Index: Ringtoets/AssemblyTool/src/Ringtoets.AssemblyTool.KernelWrapper/Calculators/Assessments/IFailureMechanismSectionAssessmentAssemblyCalculator.cs =================================================================== diff -u -r7f052155e026d0ec47d577d64594e746048d2157 -r5b0e8c5af142efae756ed228ffd8ddbd8457474a --- Ringtoets/AssemblyTool/src/Ringtoets.AssemblyTool.KernelWrapper/Calculators/Assessments/IFailureMechanismSectionAssessmentAssemblyCalculator.cs (.../IFailureMechanismSectionAssessmentAssemblyCalculator.cs) (revision 7f052155e026d0ec47d577d64594e746048d2157) +++ Ringtoets/AssemblyTool/src/Ringtoets.AssemblyTool.KernelWrapper/Calculators/Assessments/IFailureMechanismSectionAssessmentAssemblyCalculator.cs (.../IFailureMechanismSectionAssessmentAssemblyCalculator.cs) (revision 5b0e8c5af142efae756ed228ffd8ddbd8457474a) @@ -40,16 +40,16 @@ /// Assembles the simple assessment for the given . /// /// The to assemble for. - /// A . + /// A . /// Thrown when /// an error occurs when performing the assembly. - FailureMechanismSectionAssessment AssembleSimpleAssessment(SimpleAssessmentResultType input); + FailureMechanismSectionAssembly AssembleSimpleAssessment(SimpleAssessmentResultType input); /// /// Assembles the simple assessment for the given . /// /// The to assemble for. - /// A . - FailureMechanismSectionAssessment AssembleSimpleAssessment(SimpleAssessmentResultValidityOnlyType input); + /// A . + FailureMechanismSectionAssembly AssembleSimpleAssessment(SimpleAssessmentResultValidityOnlyType input); } } \ No newline at end of file Index: Ringtoets/AssemblyTool/src/Ringtoets.AssemblyTool.KernelWrapper/Creators/FailureMechanismSectionAssemblyCreator.cs =================================================================== diff -u --- Ringtoets/AssemblyTool/src/Ringtoets.AssemblyTool.KernelWrapper/Creators/FailureMechanismSectionAssemblyCreator.cs (revision 0) +++ Ringtoets/AssemblyTool/src/Ringtoets.AssemblyTool.KernelWrapper/Creators/FailureMechanismSectionAssemblyCreator.cs (revision 5b0e8c5af142efae756ed228ffd8ddbd8457474a) @@ -0,0 +1,94 @@ +// 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.ComponentModel; +using AssemblyTool.Kernel.Data.AssemblyCategories; +using Ringtoets.Common.Data.AssemblyTool; + +namespace Ringtoets.AssemblyTool.KernelWrapper.Creators +{ + /// + /// Creates instances. + /// + public static class FailureMechanismSectionAssemblyCreator + { + /// + /// Creates from the given . + /// + /// The result to create the assembly from. + /// The created assembly. + /// Thrown when is null. + /// Thrown when + /// is an invalid value. + /// Thrown when + /// is a valid value, but unsupported. + public static FailureMechanismSectionAssembly Create(FailureMechanismSectionAssemblyCategoryResult result) + { + if (result == null) + { + throw new ArgumentNullException(nameof(result)); + } + + FailureMechanismSectionAssemblyCategoryGroup group; + FailureMechanismSectionCategoryGroup originalGroup = result.CategoryGroup; + + if (!Enum.IsDefined(typeof(FailureMechanismSectionCategoryGroup), originalGroup)) + { + throw new InvalidEnumArgumentException(nameof(originalGroup), + (int)originalGroup, + typeof(FailureMechanismSectionCategoryGroup)); + } + + switch (originalGroup) + { + case FailureMechanismSectionCategoryGroup.Iv: + group = FailureMechanismSectionAssemblyCategoryGroup.Iv; + break; + case FailureMechanismSectionCategoryGroup.IIv: + group = FailureMechanismSectionAssemblyCategoryGroup.IIv; + break; + case FailureMechanismSectionCategoryGroup.IIIv: + group = FailureMechanismSectionAssemblyCategoryGroup.IIIv; + break; + case FailureMechanismSectionCategoryGroup.IVv: + group = FailureMechanismSectionAssemblyCategoryGroup.IVv; + break; + case FailureMechanismSectionCategoryGroup.Vv: + group = FailureMechanismSectionAssemblyCategoryGroup.Vv; + break; + case FailureMechanismSectionCategoryGroup.VIv: + group = FailureMechanismSectionAssemblyCategoryGroup.VIv; + break; + case FailureMechanismSectionCategoryGroup.VIIv: + group = FailureMechanismSectionAssemblyCategoryGroup.VIIv; + break; + case FailureMechanismSectionCategoryGroup.None: + group = FailureMechanismSectionAssemblyCategoryGroup.None; + break; + default: + throw new NotSupportedException(); + } + + return new FailureMechanismSectionAssembly(result.EstimatedProbabilityOfFailure.Value, group); + } + } +} \ No newline at end of file Fisheye: Tag 5b0e8c5af142efae756ed228ffd8ddbd8457474a refers to a dead (removed) revision in file `Ringtoets/AssemblyTool/src/Ringtoets.AssemblyTool.KernelWrapper/Creators/FailureMechanismSectionAssessmentCreator.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/AssemblyTool/src/Ringtoets.AssemblyTool.KernelWrapper/Ringtoets.AssemblyTool.KernelWrapper.csproj =================================================================== diff -u -r579f2e7430a7374075c5e64433268fa8b547951b -r5b0e8c5af142efae756ed228ffd8ddbd8457474a --- Ringtoets/AssemblyTool/src/Ringtoets.AssemblyTool.KernelWrapper/Ringtoets.AssemblyTool.KernelWrapper.csproj (.../Ringtoets.AssemblyTool.KernelWrapper.csproj) (revision 579f2e7430a7374075c5e64433268fa8b547951b) +++ Ringtoets/AssemblyTool/src/Ringtoets.AssemblyTool.KernelWrapper/Ringtoets.AssemblyTool.KernelWrapper.csproj (.../Ringtoets.AssemblyTool.KernelWrapper.csproj) (revision 5b0e8c5af142efae756ed228ffd8ddbd8457474a) @@ -24,7 +24,7 @@ - + Index: Ringtoets/AssemblyTool/test/Ringtoets.AssemblyTool.KernelWrapper.Test/Calculators/Assessments/FailureMechanismSectionAssessmentAssemblyCalculatorTest.cs =================================================================== diff -u -rae01e1feaabca47786d234e5530deac5a0b85f08 -r5b0e8c5af142efae756ed228ffd8ddbd8457474a --- Ringtoets/AssemblyTool/test/Ringtoets.AssemblyTool.KernelWrapper.Test/Calculators/Assessments/FailureMechanismSectionAssessmentAssemblyCalculatorTest.cs (.../FailureMechanismSectionAssessmentAssemblyCalculatorTest.cs) (revision ae01e1feaabca47786d234e5530deac5a0b85f08) +++ Ringtoets/AssemblyTool/test/Ringtoets.AssemblyTool.KernelWrapper.Test/Calculators/Assessments/FailureMechanismSectionAssessmentAssemblyCalculatorTest.cs (.../FailureMechanismSectionAssessmentAssemblyCalculatorTest.cs) (revision 5b0e8c5af142efae756ed228ffd8ddbd8457474a) @@ -123,10 +123,10 @@ var calculator = new FailureMechanismSectionAssessmentAssemblyCalculator(factory); // Call - FailureMechanismSectionAssessment assessment = calculator.AssembleSimpleAssessment(SimpleAssessmentResultType.AssessFurther); + FailureMechanismSectionAssembly assembly = calculator.AssembleSimpleAssessment(SimpleAssessmentResultType.AssessFurther); // Assert - AssertCalculatorOutput(kernel.FailureMechanismSectionAssemblyCategoryResult, assessment); + AssertCalculatorOutput(kernel.FailureMechanismSectionAssemblyCategoryResult, assembly); } } @@ -233,10 +233,10 @@ var calculator = new FailureMechanismSectionAssessmentAssemblyCalculator(factory); // Call - FailureMechanismSectionAssessment assessment = calculator.AssembleSimpleAssessment(SimpleAssessmentResultValidityOnlyType.NotApplicable); + FailureMechanismSectionAssembly assembly = calculator.AssembleSimpleAssessment(SimpleAssessmentResultValidityOnlyType.NotApplicable); // Assert - AssertCalculatorOutput(kernel.FailureMechanismSectionAssemblyCategoryResult, assessment); + AssertCalculatorOutput(kernel.FailureMechanismSectionAssemblyCategoryResult, assembly); } } @@ -286,7 +286,7 @@ } } - private static void AssertCalculatorOutput(CalculationOutput original, FailureMechanismSectionAssessment actual) + private static void AssertCalculatorOutput(CalculationOutput original, FailureMechanismSectionAssembly actual) { Assert.AreEqual(GetGroup(original.Result.CategoryGroup), actual.Group); Assert.AreEqual(original.Result.EstimatedProbabilityOfFailure, actual.Probability); Index: Ringtoets/AssemblyTool/test/Ringtoets.AssemblyTool.KernelWrapper.Test/Creators/FailureMechanismSectionAssemblyCreatorTest.cs =================================================================== diff -u --- Ringtoets/AssemblyTool/test/Ringtoets.AssemblyTool.KernelWrapper.Test/Creators/FailureMechanismSectionAssemblyCreatorTest.cs (revision 0) +++ Ringtoets/AssemblyTool/test/Ringtoets.AssemblyTool.KernelWrapper.Test/Creators/FailureMechanismSectionAssemblyCreatorTest.cs (revision 5b0e8c5af142efae756ed228ffd8ddbd8457474a) @@ -0,0 +1,87 @@ +// 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.ComponentModel; +using AssemblyTool.Kernel.Data; +using AssemblyTool.Kernel.Data.AssemblyCategories; +using Core.Common.TestUtil; +using NUnit.Framework; +using Ringtoets.AssemblyTool.KernelWrapper.Creators; +using Ringtoets.Common.Data.AssemblyTool; + +namespace Ringtoets.AssemblyTool.KernelWrapper.Test.Creators +{ + [TestFixture] + public class FailureMechanismSectionAssemblyCreatorTest + { + [Test] + public void Create_ResultNull_ThrowsArgumentNullException() + { + // Call + TestDelegate call = () => FailureMechanismSectionAssemblyCreator.Create(null); + + // Assert + var exception = Assert.Throws(call); + Assert.AreEqual("result", exception.ParamName); + } + + [Test] + public void Create_InvalidGroup_ThrowsInvalidEnumArgumentException() + { + // Setup + var result = new FailureMechanismSectionAssemblyCategoryResult((FailureMechanismSectionCategoryGroup) 99, Probability.NaN); + + // Call + TestDelegate test = () => FailureMechanismSectionAssemblyCreator.Create(result); + + // Assert + const string expectedMessage = "The value of argument 'originalGroup' (99) is invalid for Enum type 'FailureMechanismSectionCategoryGroup'."; + TestHelper.AssertThrowsArgumentExceptionAndTestMessage(test, expectedMessage); + } + + [Test] + [TestCase(FailureMechanismSectionCategoryGroup.None, FailureMechanismSectionAssemblyCategoryGroup.None)] + [TestCase(FailureMechanismSectionCategoryGroup.Iv, FailureMechanismSectionAssemblyCategoryGroup.Iv)] + [TestCase(FailureMechanismSectionCategoryGroup.IIv, FailureMechanismSectionAssemblyCategoryGroup.IIv)] + [TestCase(FailureMechanismSectionCategoryGroup.IIIv, FailureMechanismSectionAssemblyCategoryGroup.IIIv)] + [TestCase(FailureMechanismSectionCategoryGroup.IVv, FailureMechanismSectionAssemblyCategoryGroup.IVv)] + [TestCase(FailureMechanismSectionCategoryGroup.Vv, FailureMechanismSectionAssemblyCategoryGroup.Vv)] + [TestCase(FailureMechanismSectionCategoryGroup.VIv, FailureMechanismSectionAssemblyCategoryGroup.VIv)] + [TestCase(FailureMechanismSectionCategoryGroup.VIIv, FailureMechanismSectionAssemblyCategoryGroup.VIIv)] + public void Create_ValidResult_ReturnFailureMechanismSectionAssembly(FailureMechanismSectionCategoryGroup originalGroup, + FailureMechanismSectionAssemblyCategoryGroup expectedGroup) + { + // Setup + var random = new Random(39); + double probability = random.NextDouble(); + + var result = new FailureMechanismSectionAssemblyCategoryResult(originalGroup, new Probability(probability)); + + // Call + FailureMechanismSectionAssembly assembly = FailureMechanismSectionAssemblyCreator.Create(result); + + // Assert + Assert.AreEqual(expectedGroup, assembly.Group); + Assert.AreEqual(probability, assembly.Probability); + } + } +} \ No newline at end of file Fisheye: Tag 5b0e8c5af142efae756ed228ffd8ddbd8457474a refers to a dead (removed) revision in file `Ringtoets/AssemblyTool/test/Ringtoets.AssemblyTool.KernelWrapper.Test/Creators/FailureMechanismSectionAssessmentCreatorTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/AssemblyTool/test/Ringtoets.AssemblyTool.KernelWrapper.Test/Ringtoets.AssemblyTool.KernelWrapper.Test.csproj =================================================================== diff -u -r579f2e7430a7374075c5e64433268fa8b547951b -r5b0e8c5af142efae756ed228ffd8ddbd8457474a --- Ringtoets/AssemblyTool/test/Ringtoets.AssemblyTool.KernelWrapper.Test/Ringtoets.AssemblyTool.KernelWrapper.Test.csproj (.../Ringtoets.AssemblyTool.KernelWrapper.Test.csproj) (revision 579f2e7430a7374075c5e64433268fa8b547951b) +++ Ringtoets/AssemblyTool/test/Ringtoets.AssemblyTool.KernelWrapper.Test/Ringtoets.AssemblyTool.KernelWrapper.Test.csproj (.../Ringtoets.AssemblyTool.KernelWrapper.Test.csproj) (revision 5b0e8c5af142efae756ed228ffd8ddbd8457474a) @@ -28,7 +28,7 @@ - + Index: Ringtoets/AssemblyTool/test/Ringtoets.AssemblyTool.KernelWrapper.TestUtil.Test/Calculators/Assessments/FailureMechanismSectionAssessmentAssemblyCalculatorStubTest.cs =================================================================== diff -u -r33296d6acd0f054663d486d0149e304f80995d08 -r5b0e8c5af142efae756ed228ffd8ddbd8457474a --- Ringtoets/AssemblyTool/test/Ringtoets.AssemblyTool.KernelWrapper.TestUtil.Test/Calculators/Assessments/FailureMechanismSectionAssessmentAssemblyCalculatorStubTest.cs (.../FailureMechanismSectionAssessmentAssemblyCalculatorStubTest.cs) (revision 33296d6acd0f054663d486d0149e304f80995d08) +++ Ringtoets/AssemblyTool/test/Ringtoets.AssemblyTool.KernelWrapper.TestUtil.Test/Calculators/Assessments/FailureMechanismSectionAssessmentAssemblyCalculatorStubTest.cs (.../FailureMechanismSectionAssessmentAssemblyCalculatorStubTest.cs) (revision 5b0e8c5af142efae756ed228ffd8ddbd8457474a) @@ -48,11 +48,11 @@ var calculator = new FailureMechanismSectionAssessmentAssemblyCalculatorStub(); // Call - FailureMechanismSectionAssessment assessment = calculator.AssembleSimpleAssessment(SimpleAssessmentResultType.None); + FailureMechanismSectionAssembly assembly = calculator.AssembleSimpleAssessment(SimpleAssessmentResultType.None); // Assert - Assert.AreEqual(0, assessment.Probability); - Assert.AreEqual(FailureMechanismSectionAssemblyCategoryGroup.Iv, assessment.Group); + Assert.AreEqual(0, assembly.Probability); + Assert.AreEqual(FailureMechanismSectionAssemblyCategoryGroup.Iv, assembly.Group); } [Test] @@ -61,14 +61,14 @@ // Setup var calculator = new FailureMechanismSectionAssessmentAssemblyCalculatorStub { - SimpleAssessmentAssemblyOutput = new FailureMechanismSectionAssessment(0.4, FailureMechanismSectionAssemblyCategoryGroup.None) + SimpleAssessmentAssemblyOutput = new FailureMechanismSectionAssembly(0.4, FailureMechanismSectionAssemblyCategoryGroup.None) }; // Call - FailureMechanismSectionAssessment assessment = calculator.AssembleSimpleAssessment(SimpleAssessmentResultType.None); + FailureMechanismSectionAssembly assembly = calculator.AssembleSimpleAssessment(SimpleAssessmentResultType.None); // Assert - Assert.AreSame(calculator.SimpleAssessmentAssemblyOutput, assessment); + Assert.AreSame(calculator.SimpleAssessmentAssemblyOutput, assembly); } [Test] @@ -110,11 +110,11 @@ var calculator = new FailureMechanismSectionAssessmentAssemblyCalculatorStub(); // Call - FailureMechanismSectionAssessment assessment = calculator.AssembleSimpleAssessment(SimpleAssessmentResultValidityOnlyType.None); + FailureMechanismSectionAssembly assembly = calculator.AssembleSimpleAssessment(SimpleAssessmentResultValidityOnlyType.None); // Assert - Assert.AreEqual(1, assessment.Probability); - Assert.AreEqual(FailureMechanismSectionAssemblyCategoryGroup.VIIv, assessment.Group); + Assert.AreEqual(1, assembly.Probability); + Assert.AreEqual(FailureMechanismSectionAssemblyCategoryGroup.VIIv, assembly.Group); } [Test] @@ -123,14 +123,14 @@ // Setup var calculator = new FailureMechanismSectionAssessmentAssemblyCalculatorStub { - SimpleAssessmentAssemblyOutput = new FailureMechanismSectionAssessment(0.4, FailureMechanismSectionAssemblyCategoryGroup.None) + SimpleAssessmentAssemblyOutput = new FailureMechanismSectionAssembly(0.4, FailureMechanismSectionAssemblyCategoryGroup.None) }; // Call - FailureMechanismSectionAssessment assessment = calculator.AssembleSimpleAssessment(SimpleAssessmentResultValidityOnlyType.None); + FailureMechanismSectionAssembly assembly = calculator.AssembleSimpleAssessment(SimpleAssessmentResultValidityOnlyType.None); // Assert - Assert.AreSame(calculator.SimpleAssessmentAssemblyOutput, assessment); + Assert.AreSame(calculator.SimpleAssessmentAssemblyOutput, assembly); } [Test] Index: Ringtoets/AssemblyTool/test/Ringtoets.AssemblyTool.KernelWrapper.TestUtil/Calculators/Assessments/FailureMechanismSectionAssessmentAssemblyCalculatorStub.cs =================================================================== diff -u -r33296d6acd0f054663d486d0149e304f80995d08 -r5b0e8c5af142efae756ed228ffd8ddbd8457474a --- Ringtoets/AssemblyTool/test/Ringtoets.AssemblyTool.KernelWrapper.TestUtil/Calculators/Assessments/FailureMechanismSectionAssessmentAssemblyCalculatorStub.cs (.../FailureMechanismSectionAssessmentAssemblyCalculatorStub.cs) (revision 33296d6acd0f054663d486d0149e304f80995d08) +++ Ringtoets/AssemblyTool/test/Ringtoets.AssemblyTool.KernelWrapper.TestUtil/Calculators/Assessments/FailureMechanismSectionAssessmentAssemblyCalculatorStub.cs (.../FailureMechanismSectionAssessmentAssemblyCalculatorStub.cs) (revision 5b0e8c5af142efae756ed228ffd8ddbd8457474a) @@ -34,7 +34,7 @@ /// /// Gets or sets the output of the calculation. /// - public FailureMechanismSectionAssessment SimpleAssessmentAssemblyOutput { get; set; } + public FailureMechanismSectionAssembly SimpleAssessmentAssemblyOutput { get; set; } /// /// Gets the input of the calculation. @@ -51,7 +51,7 @@ /// public bool ThrowExceptionOnCalculate { private get; set; } - public FailureMechanismSectionAssessment AssembleSimpleAssessment(SimpleAssessmentResultType input) + public FailureMechanismSectionAssembly AssembleSimpleAssessment(SimpleAssessmentResultType input) { if (ThrowExceptionOnCalculate) { @@ -61,10 +61,10 @@ SimpleAssessmentInput = input; return SimpleAssessmentAssemblyOutput ?? - (SimpleAssessmentAssemblyOutput = new FailureMechanismSectionAssessment(0, FailureMechanismSectionAssemblyCategoryGroup.Iv)); + (SimpleAssessmentAssemblyOutput = new FailureMechanismSectionAssembly(0, FailureMechanismSectionAssemblyCategoryGroup.Iv)); } - public FailureMechanismSectionAssessment AssembleSimpleAssessment(SimpleAssessmentResultValidityOnlyType input) + public FailureMechanismSectionAssembly AssembleSimpleAssessment(SimpleAssessmentResultValidityOnlyType input) { if (ThrowExceptionOnCalculate) { @@ -74,7 +74,7 @@ SimpleAssessmentValidityOnlyInput = input; return SimpleAssessmentAssemblyOutput ?? - (SimpleAssessmentAssemblyOutput = new FailureMechanismSectionAssessment(1, FailureMechanismSectionAssemblyCategoryGroup.VIIv)); + (SimpleAssessmentAssemblyOutput = new FailureMechanismSectionAssembly(1, FailureMechanismSectionAssemblyCategoryGroup.VIIv)); } } } Index: Ringtoets/Common/src/Ringtoets.Common.Data/AssemblyTool/FailureMechanismSectionAssembly.cs =================================================================== diff -u --- Ringtoets/Common/src/Ringtoets.Common.Data/AssemblyTool/FailureMechanismSectionAssembly.cs (revision 0) +++ Ringtoets/Common/src/Ringtoets.Common.Data/AssemblyTool/FailureMechanismSectionAssembly.cs (revision 5b0e8c5af142efae756ed228ffd8ddbd8457474a) @@ -0,0 +1,50 @@ +// 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. + +namespace Ringtoets.Common.Data.AssemblyTool +{ + /// + /// Assembly for failure mechanism section. + /// + public class FailureMechanismSectionAssembly + { + /// + /// Creates a new instance of . + /// + /// The probability of the assembly. + /// The group of the assembly. + public FailureMechanismSectionAssembly(double probability, FailureMechanismSectionAssemblyCategoryGroup group) + { + Probability = probability; + Group = group; + } + + /// + /// Gets the probability of the assembly. + /// + public double Probability { get; } + + /// + /// Gets the group of the assembly. + /// + public FailureMechanismSectionAssemblyCategoryGroup Group { get; } + } +} \ No newline at end of file Fisheye: Tag 5b0e8c5af142efae756ed228ffd8ddbd8457474a refers to a dead (removed) revision in file `Ringtoets/Common/src/Ringtoets.Common.Data/AssemblyTool/FailureMechanismSectionAssessment.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/Common/src/Ringtoets.Common.Data/Ringtoets.Common.Data.csproj =================================================================== diff -u -rd132667b4f4ff81200737fe927232effa3271449 -r5b0e8c5af142efae756ed228ffd8ddbd8457474a --- Ringtoets/Common/src/Ringtoets.Common.Data/Ringtoets.Common.Data.csproj (.../Ringtoets.Common.Data.csproj) (revision d132667b4f4ff81200737fe927232effa3271449) +++ Ringtoets/Common/src/Ringtoets.Common.Data/Ringtoets.Common.Data.csproj (.../Ringtoets.Common.Data.csproj) (revision 5b0e8c5af142efae756ed228ffd8ddbd8457474a) @@ -20,7 +20,7 @@ - + Index: Ringtoets/Common/test/Ringtoets.Common.Data.Test/AssemblyTool/FailureMechanismSectionAssemblyTest.cs =================================================================== diff -u --- Ringtoets/Common/test/Ringtoets.Common.Data.Test/AssemblyTool/FailureMechanismSectionAssemblyTest.cs (revision 0) +++ Ringtoets/Common/test/Ringtoets.Common.Data.Test/AssemblyTool/FailureMechanismSectionAssemblyTest.cs (revision 5b0e8c5af142efae756ed228ffd8ddbd8457474a) @@ -0,0 +1,48 @@ +// 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 Core.Common.TestUtil; +using NUnit.Framework; +using Ringtoets.Common.Data.AssemblyTool; + +namespace Ringtoets.Common.Data.Test.AssemblyTool +{ + [TestFixture] + public class FailureMechanismSectionAssemblyTest + { + [Test] + public void Constructor_ExpectedValues() + { + // Setup + var random = new Random(39); + double probability = random.NextDouble(); + var group = random.NextEnumValue(); + + // Call + var assembly = new FailureMechanismSectionAssembly(probability, group); + + // Assert + Assert.AreEqual(probability, assembly.Probability); + Assert.AreEqual(group, assembly.Group); + } + } +} \ No newline at end of file Fisheye: Tag 5b0e8c5af142efae756ed228ffd8ddbd8457474a refers to a dead (removed) revision in file `Ringtoets/Common/test/Ringtoets.Common.Data.Test/AssemblyTool/FailureMechanismSectionAssessmentTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/Common/test/Ringtoets.Common.Data.Test/Ringtoets.Common.Data.Test.csproj =================================================================== diff -u -rd132667b4f4ff81200737fe927232effa3271449 -r5b0e8c5af142efae756ed228ffd8ddbd8457474a --- Ringtoets/Common/test/Ringtoets.Common.Data.Test/Ringtoets.Common.Data.Test.csproj (.../Ringtoets.Common.Data.Test.csproj) (revision d132667b4f4ff81200737fe927232effa3271449) +++ Ringtoets/Common/test/Ringtoets.Common.Data.Test/Ringtoets.Common.Data.Test.csproj (.../Ringtoets.Common.Data.Test.csproj) (revision 5b0e8c5af142efae756ed228ffd8ddbd8457474a) @@ -24,7 +24,7 @@ - +