Index: Riskeer/AssemblyTool/test/Riskeer.AssemblyTool.KernelWrapper.Test/Creators/AssessmentSectionAssemblyGroupCreatorTest.cs =================================================================== diff -u -rc8c434869abbdce0dfb04de4434bda8b73bd9374 -r114bb02fabe1511c635dc2e3d38f1e992b2f8c5c --- Riskeer/AssemblyTool/test/Riskeer.AssemblyTool.KernelWrapper.Test/Creators/AssessmentSectionAssemblyGroupCreatorTest.cs (.../AssessmentSectionAssemblyGroupCreatorTest.cs) (revision c8c434869abbdce0dfb04de4434bda8b73bd9374) +++ Riskeer/AssemblyTool/test/Riskeer.AssemblyTool.KernelWrapper.Test/Creators/AssessmentSectionAssemblyGroupCreatorTest.cs (.../AssessmentSectionAssemblyGroupCreatorTest.cs) (revision 114bb02fabe1511c635dc2e3d38f1e992b2f8c5c) @@ -19,7 +19,10 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. +using System; +using System.Collections.Generic; using System.ComponentModel; +using Assembly.Kernel.Model; using Assembly.Kernel.Model.Categories; using Core.Common.TestUtil; using NUnit.Framework; @@ -33,6 +36,39 @@ public class AssessmentSectionAssemblyGroupCreatorTest { [Test] + public void CreateAssessmentSectionAssemblyGroupBoundaries_AssessmentSectionCategoriesNull_ThrowsArgumentNullException() + { + // Call + void Call() => AssessmentSectionAssemblyGroupCreator.CreateAssessmentSectionAssemblyGroupBoundaries(null); + + // Assert + var exception = Assert.Throws(Call); + Assert.AreEqual("assessmentSectionCategories", exception.ParamName); + } + + [Test] + public void CreateAssessmentSectionAssemblyGroupBoundaries_WithValidAssessmentSectionCategories_ReturnsExpectedAssessmentSectionAssemblyGroups() + { + // Setup + var random = new Random(11); + + var groups = new CategoriesList(new[] + { + new AssessmentSectionCategory(random.NextEnumValue(), new Probability(0), new Probability(0.25)), + new AssessmentSectionCategory(random.NextEnumValue(), new Probability(0.25), new Probability(0.5)), + new AssessmentSectionCategory(random.NextEnumValue(), new Probability(0.5), new Probability(0.75)), + new AssessmentSectionCategory(random.NextEnumValue(), new Probability(0.75), new Probability(1)) + }); + + // Call + IEnumerable assemblyGroups = + AssessmentSectionAssemblyGroupCreator.CreateAssessmentSectionAssemblyGroupBoundaries(groups); + + // Assert + AssessmentSectionAssemblyGroupAssert.AssertAssessmentSectionAssemblyGroups(groups, assemblyGroups); + } + + [Test] public void CreateAssessmentSectionAssemblyGroup_WithInvalidAssessmentGrade_ThrowsInvalidEnumArgumentException() { // Call