Index: Ringtoets/Integration/src/Ringtoets.Integration.IO/Creators/SerializableAssemblyCreator.cs =================================================================== diff -u -r66867c059a3d1c4846828871cdf6d354b2b608a6 -rf33ee67efb62e6be7e9d804bd8db91a5ebda75d7 --- Ringtoets/Integration/src/Ringtoets.Integration.IO/Creators/SerializableAssemblyCreator.cs (.../SerializableAssemblyCreator.cs) (revision 66867c059a3d1c4846828871cdf6d354b2b608a6) +++ Ringtoets/Integration/src/Ringtoets.Integration.IO/Creators/SerializableAssemblyCreator.cs (.../SerializableAssemblyCreator.cs) (revision f33ee67efb62e6be7e9d804bd8db91a5ebda75d7) @@ -68,7 +68,7 @@ serializableAssessmentProcess, SerializableFailureMechanismResultCreator.Create(assessmentSection.FailureMechanismAssemblyWithProbability), SerializableFailureMechanismResultCreator.Create(assessmentSection.FailureMechanismAssemblyWithoutProbability), - new SerializableAssessmentSectionAssemblyResult()), + SerializableAssessmentSectionAssemblyResultCreator.Create(assessmentSection.AssessmentSectionAssembly)), Enumerable.Empty(), Enumerable.Empty(), Enumerable.Empty(), Index: Ringtoets/Integration/src/Ringtoets.Integration.IO/Creators/SerializableAssessmentSectionAssemblyResultCreator.cs =================================================================== diff -u --- Ringtoets/Integration/src/Ringtoets.Integration.IO/Creators/SerializableAssessmentSectionAssemblyResultCreator.cs (revision 0) +++ Ringtoets/Integration/src/Ringtoets.Integration.IO/Creators/SerializableAssessmentSectionAssemblyResultCreator.cs (revision f33ee67efb62e6be7e9d804bd8db91a5ebda75d7) @@ -0,0 +1,52 @@ +// 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 Ringtoets.AssemblyTool.IO.Model.DataTypes; +using Ringtoets.Integration.IO.Assembly; + +namespace Ringtoets.Integration.IO.Creators +{ + /// + /// Creator to create instances of + /// + public static class SerializableAssessmentSectionAssemblyResultCreator + { + /// + /// Creates an instance of based + /// on an . + /// + /// The to create a + /// a for. + /// A , + /// Thrown when is null. + public static SerializableAssessmentSectionAssemblyResult Create(ExportableAssessmentSectionAssemblyResult result) + { + if (result == null) + { + throw new ArgumentNullException(nameof(result)); + } + + return new SerializableAssessmentSectionAssemblyResult(SerializableAssemblyMethodCreator.Create(result.AssemblyMethod), + SerializableAssessmentSectionCategoryGroupCreator.Create(result.AssemblyCategory)); + } + } +} \ No newline at end of file Index: Ringtoets/Integration/src/Ringtoets.Integration.IO/Ringtoets.Integration.IO.csproj =================================================================== diff -u -r66867c059a3d1c4846828871cdf6d354b2b608a6 -rf33ee67efb62e6be7e9d804bd8db91a5ebda75d7 --- Ringtoets/Integration/src/Ringtoets.Integration.IO/Ringtoets.Integration.IO.csproj (.../Ringtoets.Integration.IO.csproj) (revision 66867c059a3d1c4846828871cdf6d354b2b608a6) +++ Ringtoets/Integration/src/Ringtoets.Integration.IO/Ringtoets.Integration.IO.csproj (.../Ringtoets.Integration.IO.csproj) (revision f33ee67efb62e6be7e9d804bd8db91a5ebda75d7) @@ -37,6 +37,7 @@ + Index: Ringtoets/Integration/test/Ringtoets.Integration.IO.Test/Creators/SerializableAssemblyCreatorTest.cs =================================================================== diff -u -r66867c059a3d1c4846828871cdf6d354b2b608a6 -rf33ee67efb62e6be7e9d804bd8db91a5ebda75d7 --- Ringtoets/Integration/test/Ringtoets.Integration.IO.Test/Creators/SerializableAssemblyCreatorTest.cs (.../SerializableAssemblyCreatorTest.cs) (revision 66867c059a3d1c4846828871cdf6d354b2b608a6) +++ Ringtoets/Integration/test/Ringtoets.Integration.IO.Test/Creators/SerializableAssemblyCreatorTest.cs (.../SerializableAssemblyCreatorTest.cs) (revision f33ee67efb62e6be7e9d804bd8db91a5ebda75d7) @@ -171,6 +171,12 @@ serializableAssemblyResultWithProbability.AssemblyMethod); Assert.AreEqual(expectedFailureMechanismAssemblyResultWithProbability.Probability, serializableAssemblyResultWithProbability.Probability); + + SerializableAssessmentSectionAssemblyResult serializableAssessmentSectionAssemblyResult = serializableTotalAssembly.AssessmentSectionAssemblyResult; + Assert.AreEqual(SerializableAssemblyMethodCreator.Create(expectedAssessmentSectionAssemblyResult.AssemblyMethod), + serializableAssessmentSectionAssemblyResult.AssemblyMethod); + Assert.AreEqual(SerializableAssessmentSectionCategoryGroupCreator.Create(expectedAssessmentSectionAssemblyResult.AssemblyCategory), + serializableAssessmentSectionAssemblyResult.CategoryGroup); } } } \ No newline at end of file Index: Ringtoets/Integration/test/Ringtoets.Integration.IO.Test/Creators/SerializableAssessmentSectionAssemblyResultCreatorTest.cs =================================================================== diff -u --- Ringtoets/Integration/test/Ringtoets.Integration.IO.Test/Creators/SerializableAssessmentSectionAssemblyResultCreatorTest.cs (revision 0) +++ Ringtoets/Integration/test/Ringtoets.Integration.IO.Test/Creators/SerializableAssessmentSectionAssemblyResultCreatorTest.cs (revision f33ee67efb62e6be7e9d804bd8db91a5ebda75d7) @@ -0,0 +1,65 @@ +// 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.AssemblyTool.Data; +using Ringtoets.AssemblyTool.IO.Model.DataTypes; +using Ringtoets.Integration.IO.Assembly; +using Ringtoets.Integration.IO.Creators; + +namespace Ringtoets.Integration.IO.Test.Creators +{ + [TestFixture] + public class SerializableAssessmentSectionAssemblyResultCreatorTest + { + [Test] + public void Create_AssessmentSectionAssemblyResultNull_ThrowsArgumentNullException() + { + // Call + TestDelegate call = () => SerializableAssessmentSectionAssemblyResultCreator.Create(null); + + // Assert + var exception = Assert.Throws(call); + Assert.AreEqual("result", exception.ParamName); + } + + [Test] + public void Create_WithAssessmentSectionAssemblyResult_ReturnsSerializableAssessmentSectionAssemblyResult() + { + // Setup + var random = new Random(21); + var result = new ExportableAssessmentSectionAssemblyResult(random.NextEnumValue(), + random.NextEnumValue()); + + // Call + SerializableAssessmentSectionAssemblyResult serializableResult = + SerializableAssessmentSectionAssemblyResultCreator.Create(result); + + // Assert + Assert.AreEqual(SerializableAssemblyMethodCreator.Create(result.AssemblyMethod), + serializableResult.AssemblyMethod); + Assert.AreEqual(SerializableAssessmentSectionCategoryGroupCreator.Create(result.AssemblyCategory), + serializableResult.CategoryGroup); + } + } +} \ No newline at end of file Index: Ringtoets/Integration/test/Ringtoets.Integration.IO.Test/Ringtoets.Integration.IO.Test.csproj =================================================================== diff -u -r1c96cd96d2dc97f661604e627f31b47ab4c8e547 -rf33ee67efb62e6be7e9d804bd8db91a5ebda75d7 --- Ringtoets/Integration/test/Ringtoets.Integration.IO.Test/Ringtoets.Integration.IO.Test.csproj (.../Ringtoets.Integration.IO.Test.csproj) (revision 1c96cd96d2dc97f661604e627f31b47ab4c8e547) +++ Ringtoets/Integration/test/Ringtoets.Integration.IO.Test/Ringtoets.Integration.IO.Test.csproj (.../Ringtoets.Integration.IO.Test.csproj) (revision f33ee67efb62e6be7e9d804bd8db91a5ebda75d7) @@ -39,6 +39,7 @@ +