Index: Ringtoets/Integration/src/Ringtoets.Integration.IO/Assembly/ExportableAggregatedFailureMechanismSectionAssemblyResult.cs =================================================================== diff -u -r63a9a574f422b3a372d8abc18899e8f1fcf579bd -rf287e92ca4b0d05761733637fab582565a30df0c --- Ringtoets/Integration/src/Ringtoets.Integration.IO/Assembly/ExportableAggregatedFailureMechanismSectionAssemblyResult.cs (.../ExportableAggregatedFailureMechanismSectionAssemblyResult.cs) (revision 63a9a574f422b3a372d8abc18899e8f1fcf579bd) +++ Ringtoets/Integration/src/Ringtoets.Integration.IO/Assembly/ExportableAggregatedFailureMechanismSectionAssemblyResult.cs (.../ExportableAggregatedFailureMechanismSectionAssemblyResult.cs) (revision f287e92ca4b0d05761733637fab582565a30df0c) @@ -5,8 +5,7 @@ /// /// Class that holds all the information to export the assembly result of a failure mechanism section. /// - public class ExportableAggregatedFailureMechanismSectionAssemblyResult : - ExportableAggregatedFailureMechanismSectionAssemblyResultBase + public class ExportableAggregatedFailureMechanismSectionAssemblyResult { /// /// Creates a new instance of . @@ -22,19 +21,62 @@ ExportableSectionAssemblyResult detailedAssembly, ExportableSectionAssemblyResult tailorMadeAssembly, ExportableSectionAssemblyResult combinedAssembly) - : base(failureMechanismSection, simpleAssembly, tailorMadeAssembly, 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 ExportableFailureMechanismSection 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/Assembly/ExportableAggregatedFailureMechanismSectionAssemblyResultWithProbability.cs =================================================================== diff -u -ra83e2a5c40411d013fed9b21c300096e098c1594 -rf287e92ca4b0d05761733637fab582565a30df0c --- Ringtoets/Integration/src/Ringtoets.Integration.IO/Assembly/ExportableAggregatedFailureMechanismSectionAssemblyResultWithProbability.cs (.../ExportableAggregatedFailureMechanismSectionAssemblyResultWithProbability.cs) (revision a83e2a5c40411d013fed9b21c300096e098c1594) +++ Ringtoets/Integration/src/Ringtoets.Integration.IO/Assembly/ExportableAggregatedFailureMechanismSectionAssemblyResultWithProbability.cs (.../ExportableAggregatedFailureMechanismSectionAssemblyResultWithProbability.cs) (revision f287e92ca4b0d05761733637fab582565a30df0c) @@ -1,13 +1,11 @@ using System; -using Ringtoets.Common.Data.FailureMechanism; namespace Ringtoets.Integration.IO.Assembly { /// /// Class that holds all the information to export a failure mechanism section assembly result with probability. /// - public class ExportableAggregatedFailureMechanismSectionAssemblyResultWithProbability : - ExportableAggregatedFailureMechanismSectionAssemblyResultBase + public class ExportableAggregatedFailureMechanismSectionAssemblyResultWithProbability { /// /// Creates a new instance of . @@ -23,19 +21,62 @@ ExportableSectionAssemblyResultWithProbability detailedAssembly, ExportableSectionAssemblyResultWithProbability tailorMadeAssembly, ExportableSectionAssemblyResultWithProbability combinedAssembly) - : base(failureMechanismSection, simpleAssembly, tailorMadeAssembly, 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 ExportableFailureMechanismSection 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/test/Ringtoets.Integration.IO.Test/Assembly/ExportableAggregatedFailureMechanismSectionAssemblyResultTest.cs =================================================================== diff -u -ra83e2a5c40411d013fed9b21c300096e098c1594 -rf287e92ca4b0d05761733637fab582565a30df0c --- Ringtoets/Integration/test/Ringtoets.Integration.IO.Test/Assembly/ExportableAggregatedFailureMechanismSectionAssemblyResultTest.cs (.../ExportableAggregatedFailureMechanismSectionAssemblyResultTest.cs) (revision a83e2a5c40411d013fed9b21c300096e098c1594) +++ Ringtoets/Integration/test/Ringtoets.Integration.IO.Test/Assembly/ExportableAggregatedFailureMechanismSectionAssemblyResultTest.cs (.../ExportableAggregatedFailureMechanismSectionAssemblyResultTest.cs) (revision f287e92ca4b0d05761733637fab582565a30df0c) @@ -12,6 +12,37 @@ 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( + CreateSection(), + null, + CreateSectionResult(), + CreateSectionResult(), + CreateSectionResult()); + + // Assert + var exception = Assert.Throws(call); + Assert.AreEqual("simpleAssembly", exception.ParamName); + } + + [Test] public void Constructor_DetailedAssemblyNull_ThrowsArgumentNullException() { // Call @@ -28,6 +59,38 @@ } [Test] + public void Constructor_TailorMadeAssemblyNull_ThrowsArgumentNullException() + { + // Call + TestDelegate call = () => new ExportableAggregatedFailureMechanismSectionAssemblyResult( + CreateSection(), + 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( + CreateSection(), + CreateSectionResult(), + CreateSectionResult(), + CreateSectionResult(), + null); + + // Assert + var exception = Assert.Throws(call); + Assert.AreEqual("combinedAssembly", exception.ParamName); + } + + [Test] public void Constructor_ExpectedValues() { // Setup @@ -45,8 +108,6 @@ combinedAssembly); // Assert - Assert.IsInstanceOf>(assemblyResult); - Assert.AreSame(failureMechanismSection, assemblyResult.FailureMechanismSection); Assert.AreSame(simpleAssembly, assemblyResult.SimpleAssembly); Assert.AreSame(detailedAssembly, assemblyResult.DetailedAssembly); Index: Ringtoets/Integration/test/Ringtoets.Integration.IO.Test/Assembly/ExportableAggregatedFailureMechanismSectionAssemblyResultWithProbabilityTest.cs =================================================================== diff -u -ra83e2a5c40411d013fed9b21c300096e098c1594 -rf287e92ca4b0d05761733637fab582565a30df0c --- Ringtoets/Integration/test/Ringtoets.Integration.IO.Test/Assembly/ExportableAggregatedFailureMechanismSectionAssemblyResultWithProbabilityTest.cs (.../ExportableAggregatedFailureMechanismSectionAssemblyResultWithProbabilityTest.cs) (revision a83e2a5c40411d013fed9b21c300096e098c1594) +++ Ringtoets/Integration/test/Ringtoets.Integration.IO.Test/Assembly/ExportableAggregatedFailureMechanismSectionAssemblyResultWithProbabilityTest.cs (.../ExportableAggregatedFailureMechanismSectionAssemblyResultWithProbabilityTest.cs) (revision f287e92ca4b0d05761733637fab582565a30df0c) @@ -12,6 +12,37 @@ 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( + CreateSection(), + null, + CreateSectionResult(), + CreateSectionResult(), + CreateSectionResult()); + + // Assert + var exception = Assert.Throws(call); + Assert.AreEqual("simpleAssembly", exception.ParamName); + } + + [Test] public void Constructor_DetailedAssemblyNull_ThrowsArgumentNullException() { // Call @@ -28,6 +59,38 @@ } [Test] + public void Constructor_TailorMadeAssemblyNull_ThrowsArgumentNullException() + { + // Call + TestDelegate call = () => new ExportableAggregatedFailureMechanismSectionAssemblyResultWithProbability( + CreateSection(), + 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( + CreateSection(), + CreateSectionResult(), + CreateSectionResult(), + CreateSectionResult(), + null); + + // Assert + var exception = Assert.Throws(call); + Assert.AreEqual("combinedAssembly", exception.ParamName); + } + + [Test] public void Constructor_ExpectedValues() { // Setup @@ -45,8 +108,6 @@ combinedAssembly); // Assert - Assert.IsInstanceOf>(assemblyResult); - Assert.AreSame(failureMechanismSection, assemblyResult.FailureMechanismSection); Assert.AreSame(simpleAssembly, assemblyResult.SimpleAssembly); Assert.AreSame(detailedAssembly, assemblyResult.DetailedAssembly);