Index: Ringtoets/Integration/src/Ringtoets.Integration.IO/ExportableAggregatedFailureMechanismSectionAssemblyResultWithProbability.cs =================================================================== diff -u --- Ringtoets/Integration/src/Ringtoets.Integration.IO/ExportableAggregatedFailureMechanismSectionAssemblyResultWithProbability.cs (revision 0) +++ Ringtoets/Integration/src/Ringtoets.Integration.IO/ExportableAggregatedFailureMechanismSectionAssemblyResultWithProbability.cs (revision e26a1087fab8d758f2c451a6ed79879c780acb56) @@ -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 with probability. + /// + public class ExportableAggregatedFailureMechanismSectionAssemblyResultWithProbability + { + /// + /// 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 ExportableAggregatedFailureMechanismSectionAssemblyResultWithProbability(FailureMechanismSection failureMechanismSection, + ExportableSectionAssemblyResultWithProbability simpleAssembly, + ExportableSectionAssemblyResultWithProbability detailedAssembly, + ExportableSectionAssemblyResultWithProbability tailorMadeAssembly, + ExportableSectionAssemblyResultWithProbability 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 ExportableSectionAssemblyResultWithProbability SimpleAssembly { get; } + + /// + /// Gets the detailed assembly result. + /// + public ExportableSectionAssemblyResultWithProbability DetailedAssembly { get; } + + /// + /// Gets the tailor made assembly result. + /// + public ExportableSectionAssemblyResultWithProbability TailorMadeAssembly { get; } + + /// + /// Gets the combined assembly result. + /// + public ExportableSectionAssemblyResultWithProbability CombinedAssembly { get; } + } +} \ No newline at end of file Index: Ringtoets/Integration/src/Ringtoets.Integration.IO/Ringtoets.Integration.IO.csproj =================================================================== diff -u -r197979e09af31fe8e78437da192ed99335852cbf -re26a1087fab8d758f2c451a6ed79879c780acb56 --- Ringtoets/Integration/src/Ringtoets.Integration.IO/Ringtoets.Integration.IO.csproj (.../Ringtoets.Integration.IO.csproj) (revision 197979e09af31fe8e78437da192ed99335852cbf) +++ Ringtoets/Integration/src/Ringtoets.Integration.IO/Ringtoets.Integration.IO.csproj (.../Ringtoets.Integration.IO.csproj) (revision e26a1087fab8d758f2c451a6ed79879c780acb56) @@ -18,6 +18,7 @@ + Index: Ringtoets/Integration/test/Ringtoets.Integration.IO.Test/Assembly/ExportableAggregatedFailureMechanismSectionAssemblyResultWithProbabilityTest.cs =================================================================== diff -u --- Ringtoets/Integration/test/Ringtoets.Integration.IO.Test/Assembly/ExportableAggregatedFailureMechanismSectionAssemblyResultWithProbabilityTest.cs (revision 0) +++ Ringtoets/Integration/test/Ringtoets.Integration.IO.Test/Assembly/ExportableAggregatedFailureMechanismSectionAssemblyResultWithProbabilityTest.cs (revision e26a1087fab8d758f2c451a6ed79879c780acb56) @@ -0,0 +1,126 @@ +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 ExportableAggregatedFailureMechanismSectionAssemblyResultWithProbabilityTest + { + [Test] + public void Constructor_FailureMechanismSectionNull_ThrowsArgumentNullException() + { + // Call + TestDelegate call = () => new ExportableAggregatedFailureMechanismSectionAssemblyResultWithProbability(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 ExportableAggregatedFailureMechanismSectionAssemblyResultWithProbability( + 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 ExportableAggregatedFailureMechanismSectionAssemblyResultWithProbability( + 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 ExportableAggregatedFailureMechanismSectionAssemblyResultWithProbability( + 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 ExportableAggregatedFailureMechanismSectionAssemblyResultWithProbability( + 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(); + ExportableSectionAssemblyResultWithProbability simpleAssembly = CreateSectionResult(); + ExportableSectionAssemblyResultWithProbability detailedAssembly = CreateSectionResult(); + ExportableSectionAssemblyResultWithProbability tailorMadeAssembly = CreateSectionResult(); + ExportableSectionAssemblyResultWithProbability combinedAssembly = CreateSectionResult(); + + // Call + var assemblyResult = new ExportableAggregatedFailureMechanismSectionAssemblyResultWithProbability(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 ExportableSectionAssemblyResultWithProbability CreateSectionResult() + { + var random = new Random(21); + return new ExportableSectionAssemblyResultWithProbability(random.NextEnumValue(), + random.NextEnumValue(), + random.NextDouble()); + } + } +} \ No newline at end of file Index: Ringtoets/Integration/test/Ringtoets.Integration.IO.Test/Ringtoets.Integration.IO.Test.csproj =================================================================== diff -u -r197979e09af31fe8e78437da192ed99335852cbf -re26a1087fab8d758f2c451a6ed79879c780acb56 --- Ringtoets/Integration/test/Ringtoets.Integration.IO.Test/Ringtoets.Integration.IO.Test.csproj (.../Ringtoets.Integration.IO.Test.csproj) (revision 197979e09af31fe8e78437da192ed99335852cbf) +++ Ringtoets/Integration/test/Ringtoets.Integration.IO.Test/Ringtoets.Integration.IO.Test.csproj (.../Ringtoets.Integration.IO.Test.csproj) (revision e26a1087fab8d758f2c451a6ed79879c780acb56) @@ -17,6 +17,7 @@ +