Index: Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Plugin/ClosingStructuresPlugin.cs =================================================================== diff -u -r493f5782760f6e8a65213bbbce141be20751e7c1 -r48605dff2e892ad7fe634924e8ca8cd8674f0d9a --- Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Plugin/ClosingStructuresPlugin.cs (.../ClosingStructuresPlugin.cs) (revision 493f5782760f6e8a65213bbbce141be20751e7c1) +++ Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Plugin/ClosingStructuresPlugin.cs (.../ClosingStructuresPlugin.cs) (revision 48605dff2e892ad7fe634924e8ca8cd8674f0d9a) @@ -43,7 +43,6 @@ using Ringtoets.Common.Data.AssessmentSection; using Ringtoets.Common.Data.Calculation; using Ringtoets.Common.Data.FailureMechanism; -using Ringtoets.Common.Data.Probability; using Ringtoets.Common.Data.Structures; using Ringtoets.Common.Forms; using Ringtoets.Common.Forms.ChangeHandlers; @@ -699,25 +698,15 @@ private static object[] CalculationContextChildNodeObjects(ClosingStructuresCalculationContext context) { - var childNodes = new List + return new object[] { context.WrappedData.Comments, new ClosingStructuresInputContext(context.WrappedData.InputParameters, context.WrappedData, context.FailureMechanism, - context.AssessmentSection) + context.AssessmentSection), + new StructuresOutputContext(context.WrappedData) }; - - if (context.WrappedData.HasOutput) - { - childNodes.Add(new StructuresOutputContext(context.WrappedData)); - } - else - { - childNodes.Add(new EmptyProbabilityAssessmentOutput()); - } - - return childNodes.ToArray(); } private ContextMenuStrip CalculationContextContextMenuStrip(ClosingStructuresCalculationContext context, Index: Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Plugin.Test/TreeNodeInfos/ClosingStructuresCalculationContextTreeNodeInfoTest.cs =================================================================== diff -u -r493f5782760f6e8a65213bbbce141be20751e7c1 -r48605dff2e892ad7fe634924e8ca8cd8674f0d9a --- Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Plugin.Test/TreeNodeInfos/ClosingStructuresCalculationContextTreeNodeInfoTest.cs (.../ClosingStructuresCalculationContextTreeNodeInfoTest.cs) (revision 493f5782760f6e8a65213bbbce141be20751e7c1) +++ Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Plugin.Test/TreeNodeInfos/ClosingStructuresCalculationContextTreeNodeInfoTest.cs (.../ClosingStructuresCalculationContextTreeNodeInfoTest.cs) (revision 48605dff2e892ad7fe634924e8ca8cd8674f0d9a) @@ -44,7 +44,6 @@ using Ringtoets.Common.Data.Contribution; using Ringtoets.Common.Data.FailureMechanism; using Ringtoets.Common.Data.Hydraulics; -using Ringtoets.Common.Data.Probability; using Ringtoets.Common.Data.Structures; using Ringtoets.Common.Data.TestUtil; using Ringtoets.Common.Forms.PresentationObjects; @@ -112,41 +111,17 @@ } [Test] - public void ChildNodeObjects_CalculationWithoutOutput_ReturnCollectionWithEmptyOutputObject() + [TestCase(true)] + [TestCase(false)] + public void ChildNodeObjects_Always_ReturnsChildrenOfData(bool hasOutput) { var assessmentSection = mocks.Stub(); mocks.ReplayAll(); var failureMechanism = new ClosingStructuresFailureMechanism(); - var calculation = new StructuresCalculation(); - var calculationContext = new ClosingStructuresCalculationContext(calculation, failureMechanism, assessmentSection); - - // Call - object[] children = info.ChildNodeObjects(calculationContext).ToArray(); - - // Assert - Assert.AreEqual(3, children.Length); - - var comment = children[0] as Comment; - Assert.AreSame(calculationContext.WrappedData.Comments, comment); - - var closingStructuresInputContext = children[1] as ClosingStructuresInputContext; - Assert.IsNotNull(closingStructuresInputContext); - Assert.AreSame(calculationContext.WrappedData.InputParameters, closingStructuresInputContext.WrappedData); - - Assert.IsInstanceOf(children[2]); - } - - [Test] - public void ChildNodeObjects_CalculationWithOutput_ReturnCollectionWithOutputObject() - { - var assessmentSection = mocks.Stub(); - mocks.ReplayAll(); - - var failureMechanism = new ClosingStructuresFailureMechanism(); var calculation = new StructuresCalculation { - Output = new TestStructuresOutput() + Output = hasOutput ? new TestStructuresOutput() : null }; var calculationContext = new ClosingStructuresCalculationContext(calculation, failureMechanism, assessmentSection); Index: Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Forms/PresentationObjects/HeightStructuresContext.cs =================================================================== diff -u -re46bec50706f5ea1a7754bbaebfc892745d8604a -r48605dff2e892ad7fe634924e8ca8cd8674f0d9a --- Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Forms/PresentationObjects/HeightStructuresContext.cs (.../HeightStructuresContext.cs) (revision e46bec50706f5ea1a7754bbaebfc892745d8604a) +++ Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Forms/PresentationObjects/HeightStructuresContext.cs (.../HeightStructuresContext.cs) (revision 48605dff2e892ad7fe634924e8ca8cd8674f0d9a) @@ -65,11 +65,11 @@ /// /// Gets the assessment section of this instance. /// - public IAssessmentSection AssessmentSection { get; private set; } + public IAssessmentSection AssessmentSection { get; } /// /// Gets the failure mechanism of this instance. /// - public HeightStructuresFailureMechanism FailureMechanism { get; private set; } + public HeightStructuresFailureMechanism FailureMechanism { get; } } } \ No newline at end of file Index: Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Plugin/HeightStructuresPlugin.cs =================================================================== diff -u -r493f5782760f6e8a65213bbbce141be20751e7c1 -r48605dff2e892ad7fe634924e8ca8cd8674f0d9a --- Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Plugin/HeightStructuresPlugin.cs (.../HeightStructuresPlugin.cs) (revision 493f5782760f6e8a65213bbbce141be20751e7c1) +++ Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Plugin/HeightStructuresPlugin.cs (.../HeightStructuresPlugin.cs) (revision 48605dff2e892ad7fe634924e8ca8cd8674f0d9a) @@ -36,7 +36,6 @@ using Ringtoets.Common.Data.AssessmentSection; using Ringtoets.Common.Data.Calculation; using Ringtoets.Common.Data.FailureMechanism; -using Ringtoets.Common.Data.Probability; using Ringtoets.Common.Data.Structures; using Ringtoets.Common.Forms; using Ringtoets.Common.Forms.ChangeHandlers; @@ -711,25 +710,15 @@ private static object[] CalculationContextChildNodeObjects(HeightStructuresCalculationContext context) { - var childNodes = new List + return new object[] { context.WrappedData.Comments, new HeightStructuresInputContext(context.WrappedData.InputParameters, context.WrappedData, context.FailureMechanism, - context.AssessmentSection) + context.AssessmentSection), + new StructuresOutputContext(context.WrappedData) }; - - if (context.WrappedData.HasOutput) - { - childNodes.Add(new StructuresOutputContext(context.WrappedData)); - } - else - { - childNodes.Add(new EmptyProbabilityAssessmentOutput()); - } - - return childNodes.ToArray(); } private ContextMenuStrip CalculationContextContextMenuStrip(HeightStructuresCalculationContext context, Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Plugin.Test/TreeNodeInfos/HeightStructuresCalculationContextTreeNodeInfoTest.cs =================================================================== diff -u -r493f5782760f6e8a65213bbbce141be20751e7c1 -r48605dff2e892ad7fe634924e8ca8cd8674f0d9a --- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Plugin.Test/TreeNodeInfos/HeightStructuresCalculationContextTreeNodeInfoTest.cs (.../HeightStructuresCalculationContextTreeNodeInfoTest.cs) (revision 493f5782760f6e8a65213bbbce141be20751e7c1) +++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Plugin.Test/TreeNodeInfos/HeightStructuresCalculationContextTreeNodeInfoTest.cs (.../HeightStructuresCalculationContextTreeNodeInfoTest.cs) (revision 48605dff2e892ad7fe634924e8ca8cd8674f0d9a) @@ -41,7 +41,6 @@ using Ringtoets.Common.Data.Contribution; using Ringtoets.Common.Data.FailureMechanism; using Ringtoets.Common.Data.Hydraulics; -using Ringtoets.Common.Data.Probability; using Ringtoets.Common.Data.Structures; using Ringtoets.Common.Data.TestUtil; using Ringtoets.Common.Forms.PresentationObjects; @@ -126,42 +125,17 @@ } [Test] - public void ChildNodeObjects_CalculationWithoutOutput_ReturnCollectionWithEmptyOutputObject() + [TestCase(true)] + [TestCase(false)] + public void ChildNodeObjects_Always_ReturnsChildrenOfData(bool hasOutput) { var assessmentSection = mocks.Stub(); mocks.ReplayAll(); var failureMechanism = new HeightStructuresFailureMechanism(); - var calculation = new StructuresCalculation(); - var calculationContext = new HeightStructuresCalculationContext(calculation, failureMechanism, assessmentSection); - - // Call - object[] children = info.ChildNodeObjects(calculationContext).ToArray(); - - // Assert - Assert.AreEqual(3, children.Length); - - var comment = children[0] as Comment; - Assert.AreSame(calculationContext.WrappedData.Comments, comment); - - var heightStructuresInputContext = children[1] as HeightStructuresInputContext; - Assert.IsNotNull(heightStructuresInputContext); - Assert.AreSame(calculationContext.WrappedData.InputParameters, heightStructuresInputContext.WrappedData); - - var emptyOutput = children[2] as EmptyProbabilityAssessmentOutput; - Assert.IsNotNull(emptyOutput); - } - - [Test] - public void ChildNodeObjects_CalculationWithOutput_ReturnCollectionWithOutputObject() - { - var assessmentSection = mocks.Stub(); - mocks.ReplayAll(); - - var failureMechanism = new HeightStructuresFailureMechanism(); var calculation = new StructuresCalculation { - Output = new TestStructuresOutput() + Output = hasOutput ? new TestStructuresOutput() : null }; var calculationContext = new HeightStructuresCalculationContext(calculation, failureMechanism, assessmentSection); Index: Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.Forms/PresentationObjects/StabilityPointStructuresContext.cs =================================================================== diff -u -r638081278e33e132e3ffedd52fff0d6c00ab4728 -r48605dff2e892ad7fe634924e8ca8cd8674f0d9a --- Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.Forms/PresentationObjects/StabilityPointStructuresContext.cs (.../StabilityPointStructuresContext.cs) (revision 638081278e33e132e3ffedd52fff0d6c00ab4728) +++ Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.Forms/PresentationObjects/StabilityPointStructuresContext.cs (.../StabilityPointStructuresContext.cs) (revision 48605dff2e892ad7fe634924e8ca8cd8674f0d9a) @@ -62,11 +62,11 @@ /// /// Gets the assessment section of this instance. /// - public IAssessmentSection AssessmentSection { get; private set; } + public IAssessmentSection AssessmentSection { get; } /// /// Gets the parent failure mechanism of this instance. /// - public StabilityPointStructuresFailureMechanism FailureMechanism { get; private set; } + public StabilityPointStructuresFailureMechanism FailureMechanism { get; } } } \ No newline at end of file Index: Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.Plugin/StabilityPointStructuresPlugin.cs =================================================================== diff -u -r493f5782760f6e8a65213bbbce141be20751e7c1 -r48605dff2e892ad7fe634924e8ca8cd8674f0d9a --- Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.Plugin/StabilityPointStructuresPlugin.cs (.../StabilityPointStructuresPlugin.cs) (revision 493f5782760f6e8a65213bbbce141be20751e7c1) +++ Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.Plugin/StabilityPointStructuresPlugin.cs (.../StabilityPointStructuresPlugin.cs) (revision 48605dff2e892ad7fe634924e8ca8cd8674f0d9a) @@ -34,7 +34,6 @@ using Ringtoets.Common.Data.AssessmentSection; using Ringtoets.Common.Data.Calculation; using Ringtoets.Common.Data.FailureMechanism; -using Ringtoets.Common.Data.Probability; using Ringtoets.Common.Data.Structures; using Ringtoets.Common.Forms; using Ringtoets.Common.Forms.ChangeHandlers; @@ -709,25 +708,15 @@ private static object[] CalculationContextChildNodeObjects(StabilityPointStructuresCalculationContext context) { - var childNodes = new List + return new object[] { context.WrappedData.Comments, new StabilityPointStructuresInputContext(context.WrappedData.InputParameters, context.WrappedData, context.FailureMechanism, - context.AssessmentSection) + context.AssessmentSection), + new StructuresOutputContext(context.WrappedData) }; - - if (context.WrappedData.HasOutput) - { - childNodes.Add(new StructuresOutputContext(context.WrappedData)); - } - else - { - childNodes.Add(new EmptyProbabilityAssessmentOutput()); - } - - return childNodes.ToArray(); } private ContextMenuStrip CalculationContextContextMenuStrip(StabilityPointStructuresCalculationContext context, Index: Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Plugin.Test/TreeNodeInfos/StabilityPointStructuresCalculationContextTreeNodeInfoTest.cs =================================================================== diff -u -r493f5782760f6e8a65213bbbce141be20751e7c1 -r48605dff2e892ad7fe634924e8ca8cd8674f0d9a --- Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Plugin.Test/TreeNodeInfos/StabilityPointStructuresCalculationContextTreeNodeInfoTest.cs (.../StabilityPointStructuresCalculationContextTreeNodeInfoTest.cs) (revision 493f5782760f6e8a65213bbbce141be20751e7c1) +++ Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Plugin.Test/TreeNodeInfos/StabilityPointStructuresCalculationContextTreeNodeInfoTest.cs (.../StabilityPointStructuresCalculationContextTreeNodeInfoTest.cs) (revision 48605dff2e892ad7fe634924e8ca8cd8674f0d9a) @@ -41,7 +41,6 @@ using Ringtoets.Common.Data.Contribution; using Ringtoets.Common.Data.FailureMechanism; using Ringtoets.Common.Data.Hydraulics; -using Ringtoets.Common.Data.Probability; using Ringtoets.Common.Data.Structures; using Ringtoets.Common.Data.TestUtil; using Ringtoets.Common.Forms.PresentationObjects; @@ -111,41 +110,16 @@ } [Test] - public void ChildNodeObjects_CalculationWithoutOutput_ReturnCollectionWithEmptyOutputObject() + [TestCase(true)] + [TestCase(false)] + public void ChildNodeObjects_Always_ReturnsChildrenOfData(bool hasOutput) { var assessmentSection = mocks.Stub(); mocks.ReplayAll(); - var calculation = new StructuresCalculation(); - var failureMechanism = new StabilityPointStructuresFailureMechanism(); - var calculationContext = new StabilityPointStructuresCalculationContext(calculation, failureMechanism, assessmentSection); - - // Call - object[] children = info.ChildNodeObjects(calculationContext).ToArray(); - - // Assert - Assert.AreEqual(3, children.Length); - - var comment = children[0] as Comment; - Assert.AreSame(calculationContext.WrappedData.Comments, comment); - - var stabilityPointStructuresInputContext = children[1] as StabilityPointStructuresInputContext; - Assert.IsNotNull(stabilityPointStructuresInputContext); - Assert.AreSame(calculationContext.WrappedData.InputParameters, stabilityPointStructuresInputContext.WrappedData); - - var emptyOutput = children[2] as EmptyProbabilityAssessmentOutput; - Assert.IsNotNull(emptyOutput); - } - - [Test] - public void ChildNodeObjects_CalculationWithOutput_ReturnCollectionWithOutputObject() - { - var assessmentSection = mocks.Stub(); - mocks.ReplayAll(); - var calculation = new StructuresCalculation { - Output = new TestStructuresOutput() + Output = hasOutput ? new TestStructuresOutput() : null }; var failureMechanism = new StabilityPointStructuresFailureMechanism(); var calculationContext = new StabilityPointStructuresCalculationContext(calculation, failureMechanism, assessmentSection);