Index: Core/Components/src/Core.Components.GraphSharp/Converters/GraphNodeConverter.cs =================================================================== diff -u -rf46ba440e51db6e6cb1c02375b6afa771eb94570 -rccc77eb1d25d2f6e73e7b6547f2cc87b4d077713 --- Core/Components/src/Core.Components.GraphSharp/Converters/GraphNodeConverter.cs (.../GraphNodeConverter.cs) (revision f46ba440e51db6e6cb1c02375b6afa771eb94570) +++ Core/Components/src/Core.Components.GraphSharp/Converters/GraphNodeConverter.cs (.../GraphNodeConverter.cs) (revision ccc77eb1d25d2f6e73e7b6547f2cc87b4d077713) @@ -42,7 +42,7 @@ /// Thrown when /// is an invalid value. /// Thrown when - /// is a valid value but unsupported. + /// is a valid value, but unsupported. public static PointedTreeElementVertex Convert(GraphNode graphNode) { if (graphNode == null) @@ -77,7 +77,7 @@ /// Thrown when /// is an invalid value. /// Thrown when - /// is a valid value but unsupported. + /// is a valid value, but unsupported. private static PointedTreeVertexType ConvertType(GraphNodeShape shape) { if (!Enum.IsDefined(typeof(GraphNodeShape), shape)) Index: Ringtoets/AssemblyTool/src/Ringtoets.AssemblyTool.KernelWrapper/Calculators/Categories/AssemblyCategoriesCalculatorException.cs =================================================================== diff -u -r262cb75f10cbfc5af6418d0185d7e15076962c8b -rccc77eb1d25d2f6e73e7b6547f2cc87b4d077713 --- Ringtoets/AssemblyTool/src/Ringtoets.AssemblyTool.KernelWrapper/Calculators/Categories/AssemblyCategoriesCalculatorException.cs (.../AssemblyCategoriesCalculatorException.cs) (revision 262cb75f10cbfc5af6418d0185d7e15076962c8b) +++ Ringtoets/AssemblyTool/src/Ringtoets.AssemblyTool.KernelWrapper/Calculators/Categories/AssemblyCategoriesCalculatorException.cs (.../AssemblyCategoriesCalculatorException.cs) (revision ccc77eb1d25d2f6e73e7b6547f2cc87b4d077713) @@ -64,7 +64,5 @@ /// The class name is null or /// is zero (0). protected AssemblyCategoriesCalculatorException(SerializationInfo info, StreamingContext context) : base(info, context) {} - - } } \ No newline at end of file Index: Ringtoets/AssemblyTool/src/Ringtoets.AssemblyTool.KernelWrapper/Creators/AssemblyCategoryResultCreator.cs =================================================================== diff -u -r4160a30705d657946461b76a5c443119cb78d437 -rccc77eb1d25d2f6e73e7b6547f2cc87b4d077713 --- Ringtoets/AssemblyTool/src/Ringtoets.AssemblyTool.KernelWrapper/Creators/AssemblyCategoryResultCreator.cs (.../AssemblyCategoryResultCreator.cs) (revision 4160a30705d657946461b76a5c443119cb78d437) +++ Ringtoets/AssemblyTool/src/Ringtoets.AssemblyTool.KernelWrapper/Creators/AssemblyCategoryResultCreator.cs (.../AssemblyCategoryResultCreator.cs) (revision ccc77eb1d25d2f6e73e7b6547f2cc87b4d077713) @@ -46,7 +46,7 @@ /// Thrown when /// is an invalid value. /// Thrown when - /// is a valid value but unsupported. + /// is a valid value, but unsupported. public static IEnumerable CreateAssessmentSectionAssemblyCategoryResult( CalculationOutput output) { @@ -56,8 +56,9 @@ } return output.Result.Select( - categoriesOutput => new AssessmentSectionAssemblyCategoryResult(categoriesOutput.LowerBoundary, - categoriesOutput.UpperBoundary, ConvertAssessmentSectionCategoryType(categoriesOutput.Category))).ToArray(); + categoriesOutput => new AssessmentSectionAssemblyCategoryResult(categoriesOutput.LowerBoundary, + categoriesOutput.UpperBoundary, + ConvertAssessmentSectionCategoryType(categoriesOutput.Category))).ToArray(); } /// @@ -68,7 +69,7 @@ /// Thrown when /// is an invalid value. /// Thrown when - /// is a valid value but unsupported. + /// is a valid value, but unsupported. private static AssessmentSectionAssemblyCategoryResultType ConvertAssessmentSectionCategoryType(AssessmentSectionAssemblyCategory category) { if (!Enum.IsDefined(typeof(AssessmentSectionAssemblyCategory), category)) Index: Ringtoets/AssemblyTool/src/Ringtoets.AssemblyTool.KernelWrapper/Kernels/Categories/AssemblyCategoriesKernelWrapperException.cs =================================================================== diff -u -r8e0c01ab04271d1d075511f6cf2ca159d1ab7558 -rccc77eb1d25d2f6e73e7b6547f2cc87b4d077713 --- Ringtoets/AssemblyTool/src/Ringtoets.AssemblyTool.KernelWrapper/Kernels/Categories/AssemblyCategoriesKernelWrapperException.cs (.../AssemblyCategoriesKernelWrapperException.cs) (revision 8e0c01ab04271d1d075511f6cf2ca159d1ab7558) +++ Ringtoets/AssemblyTool/src/Ringtoets.AssemblyTool.KernelWrapper/Kernels/Categories/AssemblyCategoriesKernelWrapperException.cs (.../AssemblyCategoriesKernelWrapperException.cs) (revision ccc77eb1d25d2f6e73e7b6547f2cc87b4d077713) @@ -64,7 +64,5 @@ /// The class name is null or /// is zero (0). protected AssemblyCategoriesKernelWrapperException(SerializationInfo info, StreamingContext context) : base(info, context) {} - - } } \ No newline at end of file Index: Ringtoets/AssemblyTool/test/Ringtoets.AssemblyTool.Data.Test/Output/AssessmentSectionAssemblyCategoryResultTest.cs =================================================================== diff -u -r8bd83f4b0e42485f9ce1e0101afba13744102b24 -rccc77eb1d25d2f6e73e7b6547f2cc87b4d077713 --- Ringtoets/AssemblyTool/test/Ringtoets.AssemblyTool.Data.Test/Output/AssessmentSectionAssemblyCategoryResultTest.cs (.../AssessmentSectionAssemblyCategoryResultTest.cs) (revision 8bd83f4b0e42485f9ce1e0101afba13744102b24) +++ Ringtoets/AssemblyTool/test/Ringtoets.AssemblyTool.Data.Test/Output/AssessmentSectionAssemblyCategoryResultTest.cs (.../AssessmentSectionAssemblyCategoryResultTest.cs) (revision ccc77eb1d25d2f6e73e7b6547f2cc87b4d077713) @@ -35,12 +35,16 @@ // Setup var random = new Random(11); var category = random.NextEnumValue(); + double lowerBoundary = random.NextDouble(); + double upperBoundary = random.NextDouble(); // Call - var categoryResult = new AssessmentSectionAssemblyCategoryResult(0, 0, category); + var categoryResult = new AssessmentSectionAssemblyCategoryResult(lowerBoundary, upperBoundary, category); // Assert Assert.IsInstanceOf(categoryResult); + Assert.AreEqual(lowerBoundary, categoryResult.LowerBoundary); + Assert.AreEqual(upperBoundary, categoryResult.UpperBoundary); Assert.AreEqual(category, categoryResult.Category); } } Index: Ringtoets/AssemblyTool/test/Ringtoets.AssemblyTool.KernelWrapper.Test/AssemblyCategoryResultAssert.cs =================================================================== diff -u -r4160a30705d657946461b76a5c443119cb78d437 -rccc77eb1d25d2f6e73e7b6547f2cc87b4d077713 --- Ringtoets/AssemblyTool/test/Ringtoets.AssemblyTool.KernelWrapper.Test/AssemblyCategoryResultAssert.cs (.../AssemblyCategoryResultAssert.cs) (revision 4160a30705d657946461b76a5c443119cb78d437) +++ Ringtoets/AssemblyTool/test/Ringtoets.AssemblyTool.KernelWrapper.Test/AssemblyCategoryResultAssert.cs (.../AssemblyCategoryResultAssert.cs) (revision ccc77eb1d25d2f6e73e7b6547f2cc87b4d077713) @@ -43,7 +43,7 @@ /// Thrown when /// is not equal to . public static void AssertAssessmentSectionAssemblyCategoriesResult(CalculationOutput original, - IEnumerable actual) + IEnumerable actual) { Assert.AreEqual(original.Result.Length, actual.Count()); Index: Ringtoets/AssemblyTool/test/Ringtoets.AssemblyTool.KernelWrapper.Test/Calculators/AssemblyToolCalculatorFactoryTest.cs =================================================================== diff -u -r4160a30705d657946461b76a5c443119cb78d437 -rccc77eb1d25d2f6e73e7b6547f2cc87b4d077713 --- Ringtoets/AssemblyTool/test/Ringtoets.AssemblyTool.KernelWrapper.Test/Calculators/AssemblyToolCalculatorFactoryTest.cs (.../AssemblyToolCalculatorFactoryTest.cs) (revision 4160a30705d657946461b76a5c443119cb78d437) +++ Ringtoets/AssemblyTool/test/Ringtoets.AssemblyTool.KernelWrapper.Test/Calculators/AssemblyToolCalculatorFactoryTest.cs (.../AssemblyToolCalculatorFactoryTest.cs) (revision ccc77eb1d25d2f6e73e7b6547f2cc87b4d077713) @@ -70,7 +70,7 @@ } [Test] - public void CreateAssemblyCategoriesCalculator_WithCalculatorInput_ReturnsAssemblyCategoriesCalculator() + public void CreateAssemblyCategoriesCalculator_WithKernelWrapperFactory_ReturnsAssemblyCategoriesCalculator() { // Setup IAssemblyToolCalculatorFactory factory = AssemblyToolCalculatorFactory.Instance; Index: Ringtoets/AssemblyTool/test/Ringtoets.AssemblyTool.KernelWrapper.TestUtil.Test/Calculators/AssemblyToolCalculatorFactoryConfigTest.cs =================================================================== diff -u -rc0a1601c561a4f873da7c639326077d5f4733854 -rccc77eb1d25d2f6e73e7b6547f2cc87b4d077713 --- Ringtoets/AssemblyTool/test/Ringtoets.AssemblyTool.KernelWrapper.TestUtil.Test/Calculators/AssemblyToolCalculatorFactoryConfigTest.cs (.../AssemblyToolCalculatorFactoryConfigTest.cs) (revision c0a1601c561a4f873da7c639326077d5f4733854) +++ Ringtoets/AssemblyTool/test/Ringtoets.AssemblyTool.KernelWrapper.TestUtil.Test/Calculators/AssemblyToolCalculatorFactoryConfigTest.cs (.../AssemblyToolCalculatorFactoryConfigTest.cs) (revision ccc77eb1d25d2f6e73e7b6547f2cc87b4d077713) @@ -41,7 +41,7 @@ } [Test] - public void Constructor_SetsTestFactoryForMacroStabilityInwardsCalculatorFactory() + public void Constructor_SetsTestFactoryForAssemblyToolCalculatorFactory() { // Call using (new AssemblyToolCalculatorFactoryConfig()) Index: Ringtoets/AssemblyTool/test/Ringtoets.AssemblyTool.KernelWrapper.TestUtil.Test/Calculators/Categories/AssemblyCategoriesCalculatorStubTest.cs =================================================================== diff -u -refbfe6d1cff9c51c1947f98cb54f225fe45d955f -rccc77eb1d25d2f6e73e7b6547f2cc87b4d077713 --- Ringtoets/AssemblyTool/test/Ringtoets.AssemblyTool.KernelWrapper.TestUtil.Test/Calculators/Categories/AssemblyCategoriesCalculatorStubTest.cs (.../AssemblyCategoriesCalculatorStubTest.cs) (revision efbfe6d1cff9c51c1947f98cb54f225fe45d955f) +++ Ringtoets/AssemblyTool/test/Ringtoets.AssemblyTool.KernelWrapper.TestUtil.Test/Calculators/Categories/AssemblyCategoriesCalculatorStubTest.cs (.../AssemblyCategoriesCalculatorStubTest.cs) (revision ccc77eb1d25d2f6e73e7b6547f2cc87b4d077713) @@ -57,11 +57,15 @@ Assert.AreEqual(3, result.Length); CollectionAssert.AreEqual(new[] { - 1, 2.01, 3.01 + 1, + 2.01, + 3.01 }, result.Select(r => r.LowerBoundary)); CollectionAssert.AreEqual(new[] { - 2, 3, 4 + 2, + 3, + 4 }, result.Select(r => r.UpperBoundary)); CollectionAssert.AreEqual(new[] { @@ -103,7 +107,7 @@ } [Test] - public void CalculateAssessmentSectionCategories_ThrowExceptionOnCalculateTrue_ThrowAssemblyCategoreis() + public void CalculateAssessmentSectionCategories_ThrowExceptionOnCalculateTrue_ThrowsAssemblyCategoriesCalculatorException() { // Setup var calculator = new AssemblyCategoriesCalculatorStub Index: Ringtoets/AssemblyTool/test/Ringtoets.AssemblyTool.KernelWrapper.TestUtil.Test/Calculators/TestAssemblyToolCalculatorFactoryTest.cs =================================================================== diff -u -r4160a30705d657946461b76a5c443119cb78d437 -rccc77eb1d25d2f6e73e7b6547f2cc87b4d077713 --- Ringtoets/AssemblyTool/test/Ringtoets.AssemblyTool.KernelWrapper.TestUtil.Test/Calculators/TestAssemblyToolCalculatorFactoryTest.cs (.../TestAssemblyToolCalculatorFactoryTest.cs) (revision 4160a30705d657946461b76a5c443119cb78d437) +++ Ringtoets/AssemblyTool/test/Ringtoets.AssemblyTool.KernelWrapper.TestUtil.Test/Calculators/TestAssemblyToolCalculatorFactoryTest.cs (.../TestAssemblyToolCalculatorFactoryTest.cs) (revision ccc77eb1d25d2f6e73e7b6547f2cc87b4d077713) @@ -22,7 +22,6 @@ using NUnit.Framework; using Ringtoets.AssemblyTool.KernelWrapper.Calculators; using Ringtoets.AssemblyTool.KernelWrapper.Calculators.Categories; -using Ringtoets.AssemblyTool.KernelWrapper.Kernels; using Ringtoets.AssemblyTool.KernelWrapper.TestUtil.Calculators; using Ringtoets.AssemblyTool.KernelWrapper.TestUtil.Calculators.Categories; using Ringtoets.AssemblyTool.KernelWrapper.TestUtil.Kernels; @@ -45,19 +44,19 @@ } [Test] - public void CreateAssemblyCategoriesCalculator_Always_ReturnStubWithInputSet() + public void CreateAssemblyCategoriesCalculator_Always_ReturnStub() { // Setup var factory = new TestAssemblyToolCalculatorFactory(); using (new AssemblyToolKernelFactoryConfig()) { // Call - IAssemblyCategoriesCalculator calculator = factory.CreateAssemblyCategoriesCalculator( - AssemblyToolKernelWrapperFactory.Instance); + IAssemblyCategoriesCalculator calculator = factory.CreateAssemblyCategoriesCalculator(null); // Assert Assert.IsInstanceOf(calculator); + Assert.AreSame(factory.LastCreatedAssemblyCategoriesCalculator, calculator); } } } Index: Ringtoets/AssemblyTool/test/Ringtoets.AssemblyTool.KernelWrapper.TestUtil.Test/Kernels/Categories/AssemblyCategoriesKernelStubTest.cs =================================================================== diff -u -r82c31612ab2e04315cca968c00feb1758cc0e987 -rccc77eb1d25d2f6e73e7b6547f2cc87b4d077713 --- Ringtoets/AssemblyTool/test/Ringtoets.AssemblyTool.KernelWrapper.TestUtil.Test/Kernels/Categories/AssemblyCategoriesKernelStubTest.cs (.../AssemblyCategoriesKernelStubTest.cs) (revision 82c31612ab2e04315cca968c00feb1758cc0e987) +++ Ringtoets/AssemblyTool/test/Ringtoets.AssemblyTool.KernelWrapper.TestUtil.Test/Kernels/Categories/AssemblyCategoriesKernelStubTest.cs (.../AssemblyCategoriesKernelStubTest.cs) (revision ccc77eb1d25d2f6e73e7b6547f2cc87b4d077713) @@ -43,7 +43,7 @@ } [Test] - public void Calculate_Always_InputCorrectlySetToKernel() + public void Calculate_ThrowExceptionOnCalculateFalse_InputCorrectlySetToKernel() { // Setup var random = new Random(11); @@ -110,7 +110,6 @@ Assert.IsNotNull(exception.InnerException); Assert.IsFalse(kernel.Calculated); Assert.IsNull(kernel.AssessmentSectionCategoriesOutput); - Assert.IsTrue(kernel.ThrowExceptionOnCalculate); } } } \ No newline at end of file Index: Ringtoets/AssemblyTool/test/Ringtoets.AssemblyTool.KernelWrapper.TestUtil/Calculators/Categories/AssemblyCategoriesCalculatorStub.cs =================================================================== diff -u -refbfe6d1cff9c51c1947f98cb54f225fe45d955f -rccc77eb1d25d2f6e73e7b6547f2cc87b4d077713 --- Ringtoets/AssemblyTool/test/Ringtoets.AssemblyTool.KernelWrapper.TestUtil/Calculators/Categories/AssemblyCategoriesCalculatorStub.cs (.../AssemblyCategoriesCalculatorStub.cs) (revision efbfe6d1cff9c51c1947f98cb54f225fe45d955f) +++ Ringtoets/AssemblyTool/test/Ringtoets.AssemblyTool.KernelWrapper.TestUtil/Calculators/Categories/AssemblyCategoriesCalculatorStub.cs (.../AssemblyCategoriesCalculatorStub.cs) (revision ccc77eb1d25d2f6e73e7b6547f2cc87b4d077713) @@ -33,19 +33,19 @@ public class AssemblyCategoriesCalculatorStub : IAssemblyCategoriesCalculator { /// - /// Gets or sets the assembly categories calculator input. + /// Gets the assembly categories calculator input. /// public AssemblyCategoriesCalculatorInput Input { get; private set; } /// - /// Gets the output of the calculation. + /// Gets or sets the output of the calculation. /// public IEnumerable AssessmentSectionCategoriesOutput { get; set; } /// /// Indicator whether an exception must be thrown when performing the calculation. /// - public bool ThrowExceptionOnCalculate { get; set; } + public bool ThrowExceptionOnCalculate { private get; set; } public IEnumerable CalculateAssessmentSectionCategories( AssemblyCategoriesCalculatorInput input) Index: Ringtoets/AssemblyTool/test/Ringtoets.AssemblyTool.KernelWrapper.TestUtil/Kernels/Categories/AssemblyCategoriesKernelStub.cs =================================================================== diff -u -r82c31612ab2e04315cca968c00feb1758cc0e987 -rccc77eb1d25d2f6e73e7b6547f2cc87b4d077713 --- Ringtoets/AssemblyTool/test/Ringtoets.AssemblyTool.KernelWrapper.TestUtil/Kernels/Categories/AssemblyCategoriesKernelStub.cs (.../AssemblyCategoriesKernelStub.cs) (revision 82c31612ab2e04315cca968c00feb1758cc0e987) +++ Ringtoets/AssemblyTool/test/Ringtoets.AssemblyTool.KernelWrapper.TestUtil/Kernels/Categories/AssemblyCategoriesKernelStub.cs (.../AssemblyCategoriesKernelStub.cs) (revision ccc77eb1d25d2f6e73e7b6547f2cc87b4d077713) @@ -49,10 +49,10 @@ /// /// Indicator whether an exception must be thrown when performing the calculation. /// - public bool ThrowExceptionOnCalculate { get; set; } + public bool ThrowExceptionOnCalculate { private get; set; } /// - /// Gets the assessment section categories output. + /// Gets or sets the assessment section categories output. /// public CalculationOutput AssessmentSectionCategoriesOutput { get; set; } Index: Ringtoets/Common/src/Ringtoets.Common.Data/Exceptions/AssemblyCategoryConversionException.cs =================================================================== diff -u -rc664a015d5ebcd9e4154f6a9bb48c8a09c2d0127 -rccc77eb1d25d2f6e73e7b6547f2cc87b4d077713 --- Ringtoets/Common/src/Ringtoets.Common.Data/Exceptions/AssemblyCategoryConversionException.cs (.../AssemblyCategoryConversionException.cs) (revision c664a015d5ebcd9e4154f6a9bb48c8a09c2d0127) +++ Ringtoets/Common/src/Ringtoets.Common.Data/Exceptions/AssemblyCategoryConversionException.cs (.../AssemblyCategoryConversionException.cs) (revision ccc77eb1d25d2f6e73e7b6547f2cc87b4d077713) @@ -25,7 +25,7 @@ namespace Ringtoets.Common.Data.Exceptions { /// - /// The exception that is thrown when converting assembly categories from the Assembly tool data was unsuccessful. + /// The exception that is thrown when converting assembly categories from the assembly tool data was unsuccessful. /// [Serializable] public class AssemblyCategoryConversionException : Exception @@ -64,7 +64,5 @@ /// The class name is null or /// is zero (0). protected AssemblyCategoryConversionException(SerializationInfo info, StreamingContext context) : base(info, context) {} - - } } \ No newline at end of file Index: Ringtoets/Common/src/Ringtoets.Common.Service/AssemblyTool/AssemblyCategoryConverter.cs =================================================================== diff -u -rc664a015d5ebcd9e4154f6a9bb48c8a09c2d0127 -rccc77eb1d25d2f6e73e7b6547f2cc87b4d077713 --- Ringtoets/Common/src/Ringtoets.Common.Service/AssemblyTool/AssemblyCategoryConverter.cs (.../AssemblyCategoryConverter.cs) (revision c664a015d5ebcd9e4154f6a9bb48c8a09c2d0127) +++ Ringtoets/Common/src/Ringtoets.Common.Service/AssemblyTool/AssemblyCategoryConverter.cs (.../AssemblyCategoryConverter.cs) (revision ccc77eb1d25d2f6e73e7b6547f2cc87b4d077713) @@ -35,22 +35,28 @@ public static class AssemblyCategoryConverter { /// - /// Converts a list of into a list of . + /// Converts an of into an + /// of . /// /// The result to convert. /// The converted categories. /// Thrown when is null. - /// Thrown when - /// is an invalid value - /// or a valid value but unsupported. - public static IEnumerable ConvertAssessmentSectionAssemblyCategories( + /// Thrown when any element in is null. + /// Thrown when + /// cannot be successfully converted into an . + public static IEnumerable ConvertToAssessmentSectionAssemblyCategories( IEnumerable result) { if (result == null) { throw new ArgumentNullException(nameof(result)); } + if (result.Contains(null)) + { + throw new ArgumentException(@"Result cannot contain null.", nameof(result)); + } + return result.Select(ConvertAssessmentSectionAssemblyCategory).ToArray(); } @@ -59,9 +65,8 @@ /// /// The result to convert. /// The converted category. - /// Thrown when - /// is an invalid value - /// or a valid value but unsupported. + /// Thrown when + /// cannot be successfully converted into an . private static AssessmentSectionAssemblyCategory ConvertAssessmentSectionAssemblyCategory(AssessmentSectionAssemblyCategoryResult result) { try @@ -84,7 +89,7 @@ /// /// Thrown when /// is an invalid value. /// Thrown when - /// is a valid value but unsupported. + /// is a valid value, but unsupported. private static AssessmentSectionAssemblyCategoryType ConvertAssessmentSectionAssemblyCategoryType( AssessmentSectionAssemblyCategoryResultType categoryType) { Index: Ringtoets/Common/src/Ringtoets.Common.Service/AssemblyTool/AssemblyToolCategoriesCalculationService.cs =================================================================== diff -u -r7eb086070edadc5f5d24683b9a72be9c1c5ef209 -rccc77eb1d25d2f6e73e7b6547f2cc87b4d077713 --- Ringtoets/Common/src/Ringtoets.Common.Service/AssemblyTool/AssemblyToolCategoriesCalculationService.cs (.../AssemblyToolCategoriesCalculationService.cs) (revision 7eb086070edadc5f5d24683b9a72be9c1c5ef209) +++ Ringtoets/Common/src/Ringtoets.Common.Service/AssemblyTool/AssemblyToolCategoriesCalculationService.cs (.../AssemblyToolCategoriesCalculationService.cs) (revision ccc77eb1d25d2f6e73e7b6547f2cc87b4d077713) @@ -57,7 +57,7 @@ IEnumerable categories = calculator.CalculateAssessmentSectionCategories( AssemblyCategoryInputConverter.Convert(input)); - return AssemblyCategoryConverter.ConvertAssessmentSectionAssemblyCategories(categories); + return AssemblyCategoryConverter.ConvertToAssessmentSectionAssemblyCategories(categories); } catch (Exception e) when (e is AssemblyCategoriesCalculatorException || e is AssemblyCategoryConversionException) { Index: Ringtoets/Common/src/Ringtoets.Common.Service/HydraRingInputParser.cs =================================================================== diff -u -r83ac738ad69ef53eba6ca4f647657e5b7f024b96 -rccc77eb1d25d2f6e73e7b6547f2cc87b4d077713 --- Ringtoets/Common/src/Ringtoets.Common.Service/HydraRingInputParser.cs (.../HydraRingInputParser.cs) (revision 83ac738ad69ef53eba6ca4f647657e5b7f024b96) +++ Ringtoets/Common/src/Ringtoets.Common.Service/HydraRingInputParser.cs (.../HydraRingInputParser.cs) (revision ccc77eb1d25d2f6e73e7b6547f2cc87b4d077713) @@ -52,7 +52,7 @@ /// A object, null if /// is false /// Thrown when the break water type is an invalid value. - /// Thrown when the break water type is a valid value but unsupported. + /// Thrown when the break water type is a valid value, but unsupported. public static HydraRingBreakWater ParseBreakWater(IUseBreakWater input) { return input.UseBreakWater ? new HydraRingBreakWater(ConvertBreakWaterType(input.BreakWater.Type), input.BreakWater.Height) : null; @@ -64,7 +64,7 @@ /// The to convert. /// The integer value to be used by Hydra-Ring. /// Thrown when is an invalid value. - /// Thrown when is a valid value but unsupported. + /// Thrown when is a valid value but, unsupported. private static int ConvertBreakWaterType(BreakWaterType type) { if (!Enum.IsDefined(type.GetType(), type)) Index: Ringtoets/Common/test/Ringtoets.Common.Data.Test/AssemblyTool/AssessmentSectionAssemblyCategoryTest.cs =================================================================== diff -u -r8bd83f4b0e42485f9ce1e0101afba13744102b24 -rccc77eb1d25d2f6e73e7b6547f2cc87b4d077713 --- Ringtoets/Common/test/Ringtoets.Common.Data.Test/AssemblyTool/AssessmentSectionAssemblyCategoryTest.cs (.../AssessmentSectionAssemblyCategoryTest.cs) (revision 8bd83f4b0e42485f9ce1e0101afba13744102b24) +++ Ringtoets/Common/test/Ringtoets.Common.Data.Test/AssemblyTool/AssessmentSectionAssemblyCategoryTest.cs (.../AssessmentSectionAssemblyCategoryTest.cs) (revision ccc77eb1d25d2f6e73e7b6547f2cc87b4d077713) @@ -33,14 +33,18 @@ public void Constructor_ExpectedValues() { // Setup - var random = new Random(11); + var random = new Random(39); var categoryType = random.NextEnumValue(); + double lowerBoundary = random.NextDouble(); + double upperBoundary = random.NextDouble(); // Call - var category = new AssessmentSectionAssemblyCategory(0, 0, categoryType); + var category = new AssessmentSectionAssemblyCategory(lowerBoundary, upperBoundary, categoryType); // Assert Assert.IsInstanceOf(category); + Assert.AreEqual(lowerBoundary, category.LowerBoundary); + Assert.AreEqual(upperBoundary, category.UpperBoundary); Assert.AreEqual(categoryType, category.Type); } } Index: Ringtoets/Common/test/Ringtoets.Common.Service.Test/AssemblyTool/AssemblyCategoryConverterTest.cs =================================================================== diff -u -rc664a015d5ebcd9e4154f6a9bb48c8a09c2d0127 -rccc77eb1d25d2f6e73e7b6547f2cc87b4d077713 --- Ringtoets/Common/test/Ringtoets.Common.Service.Test/AssemblyTool/AssemblyCategoryConverterTest.cs (.../AssemblyCategoryConverterTest.cs) (revision c664a015d5ebcd9e4154f6a9bb48c8a09c2d0127) +++ Ringtoets/Common/test/Ringtoets.Common.Service.Test/AssemblyTool/AssemblyCategoryConverterTest.cs (.../AssemblyCategoryConverterTest.cs) (revision ccc77eb1d25d2f6e73e7b6547f2cc87b4d077713) @@ -36,19 +36,34 @@ public class AssemblyCategoryConverterTest { [Test] - public void ConvertAssessmentSectionAssemblyCategories_ResultNull_ThrowsArgumentNullException() + public void ConvertToAssessmentSectionAssemblyCategories_ResultNull_ThrowsArgumentNullException() { // Call - TestDelegate call = () => AssemblyCategoryConverter.ConvertAssessmentSectionAssemblyCategories(null); + TestDelegate call = () => AssemblyCategoryConverter.ConvertToAssessmentSectionAssemblyCategories(null); // Assert var exception = Assert.Throws(call); Assert.AreEqual("result", exception.ParamName); } [Test] - public void ConvertAssessmentSectionAssemblyCategories_WithResult_ReturnAssessmentSectionAssemblyCategories() + public void ConvertToAssessmentSectionAssemblyCategories_ResultWithNullElement_ThrowsArgumentException() { + // Call + TestDelegate call = () => AssemblyCategoryConverter.ConvertToAssessmentSectionAssemblyCategories(new AssessmentSectionAssemblyCategoryResult[] + { + null + }); + + // Assert + const string message = "Result cannot contain null."; + var exception = TestHelper.AssertThrowsArgumentExceptionAndTestMessage(call, message); + Assert.AreEqual("result", exception.ParamName); + } + + [Test] + public void ConvertToAssessmentSectionAssemblyCategories_WithResult_ReturnAssessmentSectionAssemblyCategories() + { // Setup var random = new Random(11); var result = new[] @@ -59,7 +74,7 @@ }; // Call - IEnumerable categories = AssemblyCategoryConverter.ConvertAssessmentSectionAssemblyCategories(result); + IEnumerable categories = AssemblyCategoryConverter.ConvertToAssessmentSectionAssemblyCategories(result); // Assert Assert.AreEqual(result.Length, categories.Count()); @@ -68,7 +83,7 @@ } [Test] - public void ConvertAssessmentSectionAssemblyCategories_CategoryWithInvalidType_ThrowsInvalidEnumArgumentException() + public void ConvertToAssessmentSectionAssemblyCategories_CategoryWithInvalidType_ThrowsInvalidEnumArgumentException() { // Setup var result = new[] @@ -77,7 +92,7 @@ }; // Call - TestDelegate test = () => AssemblyCategoryConverter.ConvertAssessmentSectionAssemblyCategories(result); + TestDelegate test = () => AssemblyCategoryConverter.ConvertToAssessmentSectionAssemblyCategories(result); // Assert const string expectedMessage = "The value of argument 'categoryType' (99) is invalid for Enum type 'AssessmentSectionAssemblyCategoryResultType'.\r\nParameter name: categoryType"; @@ -92,7 +107,7 @@ [TestCase(AssessmentSectionAssemblyCategoryResultType.B, AssessmentSectionAssemblyCategoryType.B)] [TestCase(AssessmentSectionAssemblyCategoryResultType.C, AssessmentSectionAssemblyCategoryType.C)] [TestCase(AssessmentSectionAssemblyCategoryResultType.D, AssessmentSectionAssemblyCategoryType.D)] - public void ConvertAssessmentSectionAssemblyCategories_CategoryWithValidType_ExpectedAssessmentSectionAssemblyCategoryType( + public void ConvertToAssessmentSectionAssemblyCategories_CategoryWithValidType_ExpectedAssessmentSectionAssemblyCategoryType( AssessmentSectionAssemblyCategoryResultType resultType, AssessmentSectionAssemblyCategoryType expectedType) { @@ -103,7 +118,7 @@ }; // Call - IEnumerable categories = AssemblyCategoryConverter.ConvertAssessmentSectionAssemblyCategories(result); + IEnumerable categories = AssemblyCategoryConverter.ConvertToAssessmentSectionAssemblyCategories(result); // Assert Assert.AreEqual(1, categories.Count()); Index: Ringtoets/Common/test/Ringtoets.Common.Service.Test/AssemblyTool/AssemblyToolCategoriesCalculationServiceTest.cs =================================================================== diff -u -r7eb086070edadc5f5d24683b9a72be9c1c5ef209 -rccc77eb1d25d2f6e73e7b6547f2cc87b4d077713 --- Ringtoets/Common/test/Ringtoets.Common.Service.Test/AssemblyTool/AssemblyToolCategoriesCalculationServiceTest.cs (.../AssemblyToolCategoriesCalculationServiceTest.cs) (revision 7eb086070edadc5f5d24683b9a72be9c1c5ef209) +++ Ringtoets/Common/test/Ringtoets.Common.Service.Test/AssemblyTool/AssemblyToolCategoriesCalculationServiceTest.cs (.../AssemblyToolCategoriesCalculationServiceTest.cs) (revision ccc77eb1d25d2f6e73e7b6547f2cc87b4d077713) @@ -65,7 +65,7 @@ var calculatorFactory = (TestAssemblyToolCalculatorFactory) AssemblyToolCalculatorFactory.Instance; AssemblyCategoriesCalculatorStub calculator = calculatorFactory.LastCreatedAssemblyCategoriesCalculator; - //Call + // Call AssemblyToolCategoriesCalculationService.CalculateAssessmentSectionAssemblyCategories(input); // Assert @@ -78,6 +78,7 @@ [Test] public void CalculateAssessmentSectionAssemblyCategories_CalculationRan_ReturnsOutput() { + // Setup var random = new Random(11); double signalingNorm = random.NextDouble(); double lowerBoundaryNorm = random.NextDouble(); @@ -88,7 +89,7 @@ var calculatorFactory = (TestAssemblyToolCalculatorFactory) AssemblyToolCalculatorFactory.Instance; AssemblyCategoriesCalculatorStub calculator = calculatorFactory.LastCreatedAssemblyCategoriesCalculator; - //Call + // Call AssessmentSectionAssemblyCategory[] output = AssemblyToolCategoriesCalculationService.CalculateAssessmentSectionAssemblyCategories(input).ToArray(); // Assert @@ -104,6 +105,7 @@ [Test] public void CalculateAssessmentSectionAssemblyCategories_CalculatorThrowsException_LogErrorAndReturnEmptyOutput() { + // Setup var input = new AssemblyCategoryInput(0, 0); using (new AssemblyToolCalculatorFactoryConfig()) @@ -112,7 +114,7 @@ AssemblyCategoriesCalculatorStub calculator = calculatorFactory.LastCreatedAssemblyCategoriesCalculator; calculator.ThrowExceptionOnCalculate = true; - //Call + // Call IEnumerable output = null; Action test = () => output = AssemblyToolCategoriesCalculationService.CalculateAssessmentSectionAssemblyCategories(input); @@ -134,6 +136,7 @@ [Test] public void CalculateAssessmentSectionAssemblyCategories_ErrorInConversion_LogErrorAndReturnEmptyOutput() { + // Setup var input = new AssemblyCategoryInput(0, 0); using (new AssemblyToolCalculatorFactoryConfig()) @@ -145,7 +148,7 @@ new AssessmentSectionAssemblyCategoryResult(0, 1, (AssessmentSectionAssemblyCategoryResultType) 99) }; - //Call + // Call IEnumerable output = null; Action test = () => output = AssemblyToolCategoriesCalculationService.CalculateAssessmentSectionAssemblyCategories(input); Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.CalculatedInput/Converters/SoilProfileConverter.cs =================================================================== diff -u -r42b0a40e019f6b36f83495fc46b13bac5971292f -rccc77eb1d25d2f6e73e7b6547f2cc87b4d077713 --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.CalculatedInput/Converters/SoilProfileConverter.cs (.../SoilProfileConverter.cs) (revision 42b0a40e019f6b36f83495fc46b13bac5971292f) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.CalculatedInput/Converters/SoilProfileConverter.cs (.../SoilProfileConverter.cs) (revision ccc77eb1d25d2f6e73e7b6547f2cc87b4d077713) @@ -49,7 +49,7 @@ /// is an invalid value. /// Thrown when /// - /// is a valid value but unsupported. + /// is a valid value, but unsupported. public static SoilProfile Convert(IMacroStabilityInwardsSoilProfileUnderSurfaceLine soilProfile) { if (soilProfile == null) @@ -73,7 +73,7 @@ /// is an invalid value. /// Thrown when /// - /// is a valid value but unsupported. + /// is a valid value, but unsupported. private static IEnumerable ConvertLayers(IEnumerable layers) { return layers.Select(l => @@ -123,7 +123,7 @@ /// Thrown when /// is an invalid value. /// Thrown when - /// is a valid value but unsupported. + /// is a valid value, but unsupported. private static ShearStrengthModel ConvertShearStrengthModel(MacroStabilityInwardsShearStrengthModel shearStrengthModel) { if (!Enum.IsDefined(typeof(MacroStabilityInwardsShearStrengthModel), shearStrengthModel)) Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Creators/Input/LayerWithSoilCreator.cs =================================================================== diff -u -r66964d0c53eb0d904f7ada3e3bbc1e9604e241e7 -rccc77eb1d25d2f6e73e7b6547f2cc87b4d077713 --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Creators/Input/LayerWithSoilCreator.cs (.../LayerWithSoilCreator.cs) (revision 66964d0c53eb0d904f7ada3e3bbc1e9604e241e7) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Creators/Input/LayerWithSoilCreator.cs (.../LayerWithSoilCreator.cs) (revision ccc77eb1d25d2f6e73e7b6547f2cc87b4d077713) @@ -50,7 +50,7 @@ /// Thrown when , /// or is an invalid value. /// Thrown when , - /// or is a valid value but unsupported. + /// or is a valid value, but unsupported. public static LayerWithSoil[] Create(SoilProfile soilProfile) { if (soilProfile == null) @@ -69,7 +69,7 @@ /// Thrown when , /// or is an invalid value. /// Thrown when , - /// or is a valid value but unsupported. + /// or is a valid value, but unsupported. private static IEnumerable GetLayersWithSoilRecursively(IEnumerable soilLayers) { var layersWithSoil = new List(); @@ -122,7 +122,7 @@ /// Thrown when /// is an invalid value. /// Thrown when - /// is a valid value but unsupported. + /// is a valid value, but unsupported. private static WtiStabilityShearStrengthModel ConvertShearStrengthModel(ShearStrengthModel shearStrengthModel) { if (!Enum.IsDefined(typeof(ShearStrengthModel), shearStrengthModel)) @@ -153,7 +153,7 @@ /// Thrown when /// is an invalid value. /// Thrown when - /// is a valid value but unsupported. + /// is a valid value, but unsupported. private static WtiStabilityDilatancyType ConvertDilatancyType(DilatancyType dilatancyType) { if (!Enum.IsDefined(typeof(DilatancyType), dilatancyType)) @@ -184,7 +184,7 @@ /// Thrown when /// is an invalid value. /// Thrown when - /// is a valid value but unsupported. + /// is a valid value, but unsupported. private static WaterpressureInterpolationModel ConvertWaterPressureInterpolationModel(WaterPressureInterpolationModel waterPressureInterpolationModel) { if (!Enum.IsDefined(typeof(WaterPressureInterpolationModel), waterPressureInterpolationModel)) Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Creators/Input/StabilityLocationCreatorHelper.cs =================================================================== diff -u -r9f35261205f8f664dc06e652f6d264ad9fee7bd9 -rccc77eb1d25d2f6e73e7b6547f2cc87b4d077713 --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Creators/Input/StabilityLocationCreatorHelper.cs (.../StabilityLocationCreatorHelper.cs) (revision 9f35261205f8f664dc06e652f6d264ad9fee7bd9) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Creators/Input/StabilityLocationCreatorHelper.cs (.../StabilityLocationCreatorHelper.cs) (revision ccc77eb1d25d2f6e73e7b6547f2cc87b4d077713) @@ -44,7 +44,7 @@ /// Thrown when /// is an invalid value. /// Thrown when - /// is a valid value but unsupported. + /// is a valid value, but unsupported. public static DikeSoilScenario ConvertDikeSoilScenario(MacroStabilityInwardsDikeSoilScenario dikeSoilScenario) { if (!Enum.IsDefined(typeof(MacroStabilityInwardsDikeSoilScenario), dikeSoilScenario)) @@ -77,7 +77,7 @@ /// Thrown when /// is an invalid value. /// Thrown when - /// is a valid value but unsupported. + /// is a valid value, but unsupported. public static WtiStabilityWaternetCreationMode ConvertWaternetCreationMode(WaternetCreationMode waternetCreationMode) { if (!Enum.IsDefined(typeof(WaternetCreationMode), waternetCreationMode)) @@ -106,7 +106,7 @@ /// Thrown when /// is an invalid value. /// Thrown when - /// is a valid value but unsupported. + /// is a valid value, but unsupported. public static WtiStabilityPlLineCreationMethod ConvertPlLineCreationMethod(PlLineCreationMethod plLineCreationMethod) { if (!Enum.IsDefined(typeof(PlLineCreationMethod), plLineCreationMethod)) Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Creators/Input/SurfaceLineCreator.cs =================================================================== diff -u -r39e941a3f116d264000cd6f46a61f64674063933 -rccc77eb1d25d2f6e73e7b6547f2cc87b4d077713 --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Creators/Input/SurfaceLineCreator.cs (.../SurfaceLineCreator.cs) (revision 39e941a3f116d264000cd6f46a61f64674063933) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Creators/Input/SurfaceLineCreator.cs (.../SurfaceLineCreator.cs) (revision ccc77eb1d25d2f6e73e7b6547f2cc87b4d077713) @@ -48,7 +48,7 @@ /// Thrown when /// is an invalid value. /// Thrown when - /// is a valid value but unsupported. + /// is a valid value, but unsupported. public static SurfaceLine2 Create(MacroStabilityInwardsSurfaceLine surfaceLine, LandwardDirection landwardDirection) { if (surfaceLine == null) @@ -87,7 +87,7 @@ /// Thrown when /// is an invalid value. /// Thrown when - /// is a valid value but unsupported. + /// is a valid value, but unsupported. private static WtiStabilityLandwardDirection ConvertLandwardDirection(LandwardDirection landwardDirection) { if (!Enum.IsDefined(typeof(LandwardDirection), landwardDirection)) Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Creators/Input/UpliftVanStabilityLocationCreator.cs =================================================================== diff -u -rb8d457155428231c23023eea8dc805225bd2c95f -rccc77eb1d25d2f6e73e7b6547f2cc87b4d077713 --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Creators/Input/UpliftVanStabilityLocationCreator.cs (.../UpliftVanStabilityLocationCreator.cs) (revision b8d457155428231c23023eea8dc805225bd2c95f) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Creators/Input/UpliftVanStabilityLocationCreator.cs (.../UpliftVanStabilityLocationCreator.cs) (revision ccc77eb1d25d2f6e73e7b6547f2cc87b4d077713) @@ -44,7 +44,7 @@ /// is an invalid value. /// Thrown when , /// or - /// is a valid value but unsupported. + /// is a valid value, but unsupported. public static StabilityLocation CreateExtreme(UpliftVanCalculatorInput input) { if (input == null) @@ -76,7 +76,7 @@ /// is an invalid value. /// Thrown when , /// or - /// is a valid value but unsupported. + /// is a valid value, but unsupported. public static StabilityLocation CreateDaily(UpliftVanCalculatorInput input) { if (input == null) Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Creators/Input/WaternetStabilityLocationCreator.cs =================================================================== diff -u -r4061c28197adfa0f3dc171c74fbe300ecb3a89c4 -rccc77eb1d25d2f6e73e7b6547f2cc87b4d077713 --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Creators/Input/WaternetStabilityLocationCreator.cs (.../WaternetStabilityLocationCreator.cs) (revision 4061c28197adfa0f3dc171c74fbe300ecb3a89c4) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.KernelWrapper/Creators/Input/WaternetStabilityLocationCreator.cs (.../WaternetStabilityLocationCreator.cs) (revision ccc77eb1d25d2f6e73e7b6547f2cc87b4d077713) @@ -44,7 +44,7 @@ /// is an invalid value. /// Thrown when , /// or - /// is a valid value but unsupported. + /// is a valid value, but unsupported. public static StabilityLocation Create(WaternetCalculatorInput input) { if (input == null) Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/Calculators/Waternet/WaternetCalculatorTest.cs =================================================================== diff -u -rfc8bf1b38d4b3f9bb6f6d9dab951543b92901c8d -rccc77eb1d25d2f6e73e7b6547f2cc87b4d077713 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/Calculators/Waternet/WaternetCalculatorTest.cs (.../WaternetCalculatorTest.cs) (revision fc8bf1b38d4b3f9bb6f6d9dab951543b92901c8d) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.KernelWrapper.Test/Calculators/Waternet/WaternetCalculatorTest.cs (.../WaternetCalculatorTest.cs) (revision ccc77eb1d25d2f6e73e7b6547f2cc87b4d077713) @@ -135,6 +135,7 @@ [Test] public void Calculate_KernelWithCompleteOutput_OutputCorrectlyReturnedByCalculator() { + // Setup WaternetCalculatorInput input = WaternetCalculatorInputTestFactory.CreateValidCalculatorInput(); using (new MacroStabilityInwardsKernelFactoryConfig())