Index: Riskeer/AssemblyTool/src/Riskeer.AssemblyTool.KernelWrapper/Creators/AssemblyCategoryCreator.cs =================================================================== diff -u -r921a4a5b07e757058cfdf6a9be5d256cd08c8c12 -r4897c7f3c1eb1d659f0df8bb5b3ca83ea1995863 --- Riskeer/AssemblyTool/src/Riskeer.AssemblyTool.KernelWrapper/Creators/AssemblyCategoryCreator.cs (.../AssemblyCategoryCreator.cs) (revision 921a4a5b07e757058cfdf6a9be5d256cd08c8c12) +++ Riskeer/AssemblyTool/src/Riskeer.AssemblyTool.KernelWrapper/Creators/AssemblyCategoryCreator.cs (.../AssemblyCategoryCreator.cs) (revision 4897c7f3c1eb1d659f0df8bb5b3ca83ea1995863) @@ -20,7 +20,9 @@ // All rights reserved. using System; +using System.Collections.Generic; using System.ComponentModel; +using System.Linq; using Assembly.Kernel.Model.Categories; using Riskeer.AssemblyTool.Data; @@ -32,6 +34,33 @@ public static class AssemblyCategoryCreator { /// + /// Creates a collection of + /// based on the information given in the . + /// + /// The with + /// to create the result for. + /// A collection of + /// with information taken from the . + /// Thrown when is null. + /// Thrown when + /// contains an invalid value. + /// Thrown when + /// contains a valid value, but unsupported. + public static IEnumerable CreateAssessmentSectionAssemblyCategories(CategoriesList categories) + { + if (categories == null) + { + throw new ArgumentNullException(nameof(categories)); + } + + return categories.Categories.Select( + categoriesOutput => new AssessmentSectionAssemblyGroupBoundaries( + categoriesOutput.LowerLimit, + categoriesOutput.UpperLimit, + CreateAssessmentSectionAssemblyCategory(categoriesOutput.Category))).ToArray(); + } + + /// /// Creates a based on . /// /// The to convert.