Index: Ringtoets/Integration/src/Ringtoets.Integration.IO/ExportableAggregatedFailureMechanismSectionAssemblyResult.cs =================================================================== diff -u --- Ringtoets/Integration/src/Ringtoets.Integration.IO/ExportableAggregatedFailureMechanismSectionAssemblyResult.cs (revision 0) +++ Ringtoets/Integration/src/Ringtoets.Integration.IO/ExportableAggregatedFailureMechanismSectionAssemblyResult.cs (revision 317d9ca8e3c59fd481ec2d4183742b528241127d) @@ -0,0 +1,84 @@ +using System; +using Ringtoets.Common.Data.FailureMechanism; +using Ringtoets.Integration.IO.Assembly; + +namespace Ringtoets.Integration.IO +{ + /// + /// Class that holds all the information to export a failure mechanism section assembly result. + /// + public class ExportableAggregatedFailureMechanismSectionAssemblyResult + { + /// + /// Creates a new instance of . + /// + /// The failure mechanism section. + /// The simple assembly result of the failure mechanism section. + /// The detailed assembly result of the failure mechanism section. + /// The tailor made assembly result of the failure mechanism section. + /// The combined assembly result of the failure mechanism section. + /// Thrown when any parameter is null. + public ExportableAggregatedFailureMechanismSectionAssemblyResult(FailureMechanismSection failureMechanismSection, + ExportableSectionAssemblyResult simpleAssembly, + ExportableSectionAssemblyResult detailedAssembly, + ExportableSectionAssemblyResult tailorMadeAssembly, + ExportableSectionAssemblyResult combinedAssembly) + { + if (failureMechanismSection == null) + { + throw new ArgumentNullException(nameof(failureMechanismSection)); + } + + if (simpleAssembly == null) + { + throw new ArgumentNullException(nameof(simpleAssembly)); + } + + if (detailedAssembly == null) + { + throw new ArgumentNullException(nameof(detailedAssembly)); + } + + if (tailorMadeAssembly == null) + { + throw new ArgumentNullException(nameof(tailorMadeAssembly)); + } + + if (combinedAssembly == null) + { + throw new ArgumentNullException(nameof(combinedAssembly)); + } + + FailureMechanismSection = failureMechanismSection; + SimpleAssembly = simpleAssembly; + DetailedAssembly = detailedAssembly; + TailorMadeAssembly = tailorMadeAssembly; + CombinedAssembly = combinedAssembly; + } + + /// + /// Gets the failure mechanism section. + /// + public FailureMechanismSection FailureMechanismSection { get; } + + /// + /// Gets the simple assembly result. + /// + public ExportableSectionAssemblyResult SimpleAssembly { get; } + + /// + /// Gets the detailed assembly result. + /// + public ExportableSectionAssemblyResult DetailedAssembly { get; } + + /// + /// Gets the tailor made assembly result. + /// + public ExportableSectionAssemblyResult TailorMadeAssembly { get; } + + /// + /// Gets the combined assembly result. + /// + public ExportableSectionAssemblyResult CombinedAssembly { get; } + } +} \ No newline at end of file Index: Ringtoets/Integration/src/Ringtoets.Integration.IO/Ringtoets.Integration.IO.csproj =================================================================== diff -u -re26a1087fab8d758f2c451a6ed79879c780acb56 -r317d9ca8e3c59fd481ec2d4183742b528241127d --- Ringtoets/Integration/src/Ringtoets.Integration.IO/Ringtoets.Integration.IO.csproj (.../Ringtoets.Integration.IO.csproj) (revision e26a1087fab8d758f2c451a6ed79879c780acb56) +++ Ringtoets/Integration/src/Ringtoets.Integration.IO/Ringtoets.Integration.IO.csproj (.../Ringtoets.Integration.IO.csproj) (revision 317d9ca8e3c59fd481ec2d4183742b528241127d) @@ -18,6 +18,7 @@ + Index: Ringtoets/Integration/test/Ringtoets.Integration.IO.Test/Assembly/ExportableAggregatedFailureMechanismSectionAssemblyResultTest.cs =================================================================== diff -u --- Ringtoets/Integration/test/Ringtoets.Integration.IO.Test/Assembly/ExportableAggregatedFailureMechanismSectionAssemblyResultTest.cs (revision 0) +++ Ringtoets/Integration/test/Ringtoets.Integration.IO.Test/Assembly/ExportableAggregatedFailureMechanismSectionAssemblyResultTest.cs (revision 317d9ca8e3c59fd481ec2d4183742b528241127d) @@ -0,0 +1,125 @@ +using System; +using Core.Common.TestUtil; +using NUnit.Framework; +using Ringtoets.AssemblyTool.Data; +using Ringtoets.Common.Data.FailureMechanism; +using Ringtoets.Common.Data.TestUtil; +using Ringtoets.Integration.IO.Assembly; + +namespace Ringtoets.Integration.IO.Test.Assembly +{ + [TestFixture] + public class ExportableAggregatedFailureMechanismSectionAssemblyResultTest + { + [Test] + public void Constructor_FailureMechanismSectionNull_ThrowsArgumentNullException() + { + // Call + TestDelegate call = () => new ExportableAggregatedFailureMechanismSectionAssemblyResult(null, + CreateSectionResult(), + CreateSectionResult(), + CreateSectionResult(), + CreateSectionResult()); + + // Assert + var exception = Assert.Throws(call); + Assert.AreEqual("failureMechanismSection", exception.ParamName); + } + + [Test] + public void Constructor_SimpleAssemblyNull_ThrowsArgumentNullException() + { + // Call + TestDelegate call = () => new ExportableAggregatedFailureMechanismSectionAssemblyResult( + FailureMechanismSectionTestFactory.CreateFailureMechanismSection(), + null, + CreateSectionResult(), + CreateSectionResult(), + CreateSectionResult()); + + // Assert + var exception = Assert.Throws(call); + Assert.AreEqual("simpleAssembly", exception.ParamName); + } + + [Test] + public void Constructor_DetailedAssemblyNull_ThrowsArgumentNullException() + { + // Call + TestDelegate call = () => new ExportableAggregatedFailureMechanismSectionAssemblyResult( + FailureMechanismSectionTestFactory.CreateFailureMechanismSection(), + CreateSectionResult(), + null, + CreateSectionResult(), + CreateSectionResult()); + + // Assert + var exception = Assert.Throws(call); + Assert.AreEqual("detailedAssembly", exception.ParamName); + } + + [Test] + public void Constructor_TailorMadeAssemblyNull_ThrowsArgumentNullException() + { + // Call + TestDelegate call = () => new ExportableAggregatedFailureMechanismSectionAssemblyResult( + FailureMechanismSectionTestFactory.CreateFailureMechanismSection(), + CreateSectionResult(), + CreateSectionResult(), + null, + CreateSectionResult()); + + // Assert + var exception = Assert.Throws(call); + Assert.AreEqual("tailorMadeAssembly", exception.ParamName); + } + + [Test] + public void Constructor_CombinedAssemblyNull_ThrowsArgumentNullException() + { + // Call + TestDelegate call = () => new ExportableAggregatedFailureMechanismSectionAssemblyResult( + FailureMechanismSectionTestFactory.CreateFailureMechanismSection(), + CreateSectionResult(), + CreateSectionResult(), + CreateSectionResult(), + null); + + // Assert + var exception = Assert.Throws(call); + Assert.AreEqual("combinedAssembly", exception.ParamName); + } + + [Test] + public void Constructor_ExpectedValues() + { + // Setup + FailureMechanismSection failureMechanismSection = FailureMechanismSectionTestFactory.CreateFailureMechanismSection(); + ExportableSectionAssemblyResult simpleAssembly = CreateSectionResult(); + ExportableSectionAssemblyResult detailedAssembly = CreateSectionResult(); + ExportableSectionAssemblyResult tailorMadeAssembly = CreateSectionResult(); + ExportableSectionAssemblyResult combinedAssembly = CreateSectionResult(); + + // Call + var assemblyResult = new ExportableAggregatedFailureMechanismSectionAssemblyResult(failureMechanismSection, + simpleAssembly, + detailedAssembly, + tailorMadeAssembly, + combinedAssembly); + + // Assert + Assert.AreSame(failureMechanismSection, assemblyResult.FailureMechanismSection); + Assert.AreSame(simpleAssembly, assemblyResult.SimpleAssembly); + Assert.AreSame(detailedAssembly, assemblyResult.DetailedAssembly); + Assert.AreSame(tailorMadeAssembly, assemblyResult.TailorMadeAssembly); + Assert.AreSame(combinedAssembly, assemblyResult.CombinedAssembly); + } + + private static ExportableSectionAssemblyResult CreateSectionResult() + { + var random = new Random(21); + return new ExportableSectionAssemblyResult(random.NextEnumValue(), + random.NextEnumValue()); + } + } +} \ No newline at end of file Index: Ringtoets/Integration/test/Ringtoets.Integration.IO.Test/Ringtoets.Integration.IO.Test.csproj =================================================================== diff -u -re26a1087fab8d758f2c451a6ed79879c780acb56 -r317d9ca8e3c59fd481ec2d4183742b528241127d --- Ringtoets/Integration/test/Ringtoets.Integration.IO.Test/Ringtoets.Integration.IO.Test.csproj (.../Ringtoets.Integration.IO.Test.csproj) (revision e26a1087fab8d758f2c451a6ed79879c780acb56) +++ Ringtoets/Integration/test/Ringtoets.Integration.IO.Test/Ringtoets.Integration.IO.Test.csproj (.../Ringtoets.Integration.IO.Test.csproj) (revision 317d9ca8e3c59fd481ec2d4183742b528241127d) @@ -17,6 +17,7 @@ +