Index: Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Forms/PresentationObjects/ClosingStructuresCalculationContext.cs =================================================================== diff -u -r8b60c9e846480f3ffeeb263bfea5d3367bf6bee3 -r94a8faf16d9871c71e343cf4bb5e68531459fb20 --- Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Forms/PresentationObjects/ClosingStructuresCalculationContext.cs (.../ClosingStructuresCalculationContext.cs) (revision 8b60c9e846480f3ffeeb263bfea5d3367bf6bee3) +++ Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Forms/PresentationObjects/ClosingStructuresCalculationContext.cs (.../ClosingStructuresCalculationContext.cs) (revision 94a8faf16d9871c71e343cf4bb5e68531459fb20) @@ -32,8 +32,7 @@ /// Presentation object for all data required to configure an instance of /// in order to prepare it for performing a calculation. /// - public class ClosingStructuresCalculationContext : FailureMechanismItemContextBase, ClosingStructuresFailureMechanism>, - ICalculationContext, ClosingStructuresFailureMechanism> + public class ClosingStructuresCalculationContext : StructuresCalculationContext { /// /// Creates a new instance of . @@ -47,16 +46,6 @@ CalculationGroup parent, ClosingStructuresFailureMechanism failureMechanism, IAssessmentSection assessmentSection) - : base(wrappedData, failureMechanism, assessmentSection) - { - if (parent == null) - { - throw new ArgumentNullException(nameof(parent)); - } - - Parent = parent; - } - - public CalculationGroup Parent { get; } + : base(wrappedData, parent, failureMechanism, assessmentSection) {} } } \ No newline at end of file Index: Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Forms.Test/PresentationObjects/ClosingStructuresCalculationContextTest.cs =================================================================== diff -u -r66a3c8b86b4ada9239a31cfc47e6c1979c11e000 -r94a8faf16d9871c71e343cf4bb5e68531459fb20 --- Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Forms.Test/PresentationObjects/ClosingStructuresCalculationContextTest.cs (.../ClosingStructuresCalculationContextTest.cs) (revision 66a3c8b86b4ada9239a31cfc47e6c1979c11e000) +++ Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Forms.Test/PresentationObjects/ClosingStructuresCalculationContextTest.cs (.../ClosingStructuresCalculationContextTest.cs) (revision 94a8faf16d9871c71e343cf4bb5e68531459fb20) @@ -19,7 +19,6 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. -using System; using NUnit.Framework; using Rhino.Mocks; using Ringtoets.ClosingStructures.Data; @@ -50,33 +49,12 @@ var context = new ClosingStructuresCalculationContext(calculation, parent, failureMechanism, assessmentSection); // Assert - Assert.IsInstanceOf, ClosingStructuresFailureMechanism>>(context); - Assert.IsInstanceOf, ClosingStructuresFailureMechanism>>(context); + Assert.IsInstanceOf>(context); Assert.AreSame(calculation, context.WrappedData); Assert.AreSame(parent, context.Parent); Assert.AreSame(failureMechanism, context.FailureMechanism); Assert.AreSame(assessmentSection, context.AssessmentSection); mocksRepository.VerifyAll(); } - - [Test] - public void ParameteredConstructor_ParentNull_ThrowsArgumentNullException() - { - // Setup - var mockRepository = new MockRepository(); - var assessmentSection = mockRepository.Stub(); - mockRepository.ReplayAll(); - - var calculation = new StructuresCalculation(); - var failureMechanism = new ClosingStructuresFailureMechanism(); - - // Call - TestDelegate call = () => new ClosingStructuresCalculationContext(calculation, null, failureMechanism, assessmentSection); - - // Assert - var exception = Assert.Throws(call); - Assert.AreEqual("parent", exception.ParamName); - mockRepository.VerifyAll(); - } } } \ No newline at end of file Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/PresentationObjects/HeightStructuresCalculationContextTest.cs =================================================================== diff -u -r66a3c8b86b4ada9239a31cfc47e6c1979c11e000 -r94a8faf16d9871c71e343cf4bb5e68531459fb20 --- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/PresentationObjects/HeightStructuresCalculationContextTest.cs (.../HeightStructuresCalculationContextTest.cs) (revision 66a3c8b86b4ada9239a31cfc47e6c1979c11e000) +++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/PresentationObjects/HeightStructuresCalculationContextTest.cs (.../HeightStructuresCalculationContextTest.cs) (revision 94a8faf16d9871c71e343cf4bb5e68531459fb20) @@ -19,7 +19,6 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. -using System; using NUnit.Framework; using Rhino.Mocks; using Ringtoets.Common.Data.AssessmentSection; @@ -50,33 +49,12 @@ var context = new HeightStructuresCalculationContext(calculation, parent, failureMechanism, assessmentSection); // Assert - Assert.IsInstanceOf, HeightStructuresFailureMechanism>>(context); - Assert.IsInstanceOf, HeightStructuresFailureMechanism>>(context); + Assert.IsInstanceOf>(context); Assert.AreSame(calculation, context.WrappedData); Assert.AreSame(parent, context.Parent); Assert.AreSame(failureMechanism, context.FailureMechanism); Assert.AreSame(assessmentSection, context.AssessmentSection); mocksRepository.VerifyAll(); } - - [Test] - public void ParameteredConstructor_ParentNull_ThrowsArgumentNullException() - { - // Setup - var mockRepository = new MockRepository(); - var assessmentSection = mockRepository.Stub(); - mockRepository.ReplayAll(); - - var calculation = new StructuresCalculation(); - var failureMechanism = new HeightStructuresFailureMechanism(); - - // Call - TestDelegate call = () => new HeightStructuresCalculationContext(calculation, null, failureMechanism, assessmentSection); - - // Assert - var exception = Assert.Throws(call); - Assert.AreEqual("parent", exception.ParamName); - mockRepository.VerifyAll(); - } } } \ No newline at end of file Index: Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.Forms/PresentationObjects/StabilityPointStructuresCalculationContext.cs =================================================================== diff -u -r8b60c9e846480f3ffeeb263bfea5d3367bf6bee3 -r94a8faf16d9871c71e343cf4bb5e68531459fb20 --- Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.Forms/PresentationObjects/StabilityPointStructuresCalculationContext.cs (.../StabilityPointStructuresCalculationContext.cs) (revision 8b60c9e846480f3ffeeb263bfea5d3367bf6bee3) +++ Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.Forms/PresentationObjects/StabilityPointStructuresCalculationContext.cs (.../StabilityPointStructuresCalculationContext.cs) (revision 94a8faf16d9871c71e343cf4bb5e68531459fb20) @@ -32,8 +32,7 @@ /// Presentation object for all data required to configure an instance of /// in order to prepare it for performing a calculation. /// - public class StabilityPointStructuresCalculationContext : FailureMechanismItemContextBase, StabilityPointStructuresFailureMechanism>, - ICalculationContext, StabilityPointStructuresFailureMechanism> + public class StabilityPointStructuresCalculationContext : StructuresCalculationContext { /// /// Creates a new instance of . @@ -47,16 +46,6 @@ CalculationGroup parent, StabilityPointStructuresFailureMechanism failureMechanism, IAssessmentSection assessmentSection) - : base(calculation, failureMechanism, assessmentSection) - { - if (parent == null) - { - throw new ArgumentNullException(nameof(parent)); - } - - Parent = parent; - } - - public CalculationGroup Parent { get; } + : base(calculation, parent, failureMechanism, assessmentSection) {} } } \ No newline at end of file Index: Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Forms.Test/PresentationObjects/StabilityPointStructuresCalculationContextTest.cs =================================================================== diff -u -r66a3c8b86b4ada9239a31cfc47e6c1979c11e000 -r94a8faf16d9871c71e343cf4bb5e68531459fb20 --- Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Forms.Test/PresentationObjects/StabilityPointStructuresCalculationContextTest.cs (.../StabilityPointStructuresCalculationContextTest.cs) (revision 66a3c8b86b4ada9239a31cfc47e6c1979c11e000) +++ Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Forms.Test/PresentationObjects/StabilityPointStructuresCalculationContextTest.cs (.../StabilityPointStructuresCalculationContextTest.cs) (revision 94a8faf16d9871c71e343cf4bb5e68531459fb20) @@ -19,7 +19,6 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. -using System; using NUnit.Framework; using Rhino.Mocks; using Ringtoets.Common.Data.AssessmentSection; @@ -50,33 +49,12 @@ var context = new StabilityPointStructuresCalculationContext(calculation, parent, failureMechanism, assessmentSection); // Assert - Assert.IsInstanceOf, StabilityPointStructuresFailureMechanism>>(context); - Assert.IsInstanceOf, StabilityPointStructuresFailureMechanism>>(context); + Assert.IsInstanceOf>(context); Assert.AreSame(calculation, context.WrappedData); Assert.AreSame(parent, context.Parent); Assert.AreSame(failureMechanism, context.FailureMechanism); Assert.AreSame(assessmentSection, context.AssessmentSection); mocksRepository.VerifyAll(); } - - [Test] - public void ParameteredConstructor_ParentNull_ThrowsArgumentNullException() - { - // Setup - var mockRepository = new MockRepository(); - var assessmentSection = mockRepository.Stub(); - mockRepository.ReplayAll(); - - var calculation = new StructuresCalculation(); - var failureMechanism = new StabilityPointStructuresFailureMechanism(); - - // Call - TestDelegate call = () => new StabilityPointStructuresCalculationContext(calculation, null, failureMechanism, assessmentSection); - - // Assert - var exception = Assert.Throws(call); - Assert.AreEqual("parent", exception.ParamName); - mockRepository.VerifyAll(); - } } } \ No newline at end of file