Index: Ringtoets/Common/src/Ringtoets.Common.Forms/Properties/Resources.Designer.cs =================================================================== diff -u -rfd98bcf5d1811dbcad2cc0e292a4349f8402b83a -r7343a55e81349863d0e5d7bec5c7f0b3577adf65 --- Ringtoets/Common/src/Ringtoets.Common.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision fd98bcf5d1811dbcad2cc0e292a4349f8402b83a) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 7343a55e81349863d0e5d7bec5c7f0b3577adf65) @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.34209 +// Runtime Version:4.0.30319.17929 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -208,6 +208,15 @@ } /// + /// Looks up a localized string similar to Resultaat. + /// + public static string CalculationOutput_DisplayName { + get { + return ResourceManager.GetString("CalculationOutput_DisplayName", resourceCulture); + } + } + + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// public static System.Drawing.Bitmap Checkbox_empty { Index: Ringtoets/Common/src/Ringtoets.Common.Forms/Properties/Resources.resx =================================================================== diff -u -rfd98bcf5d1811dbcad2cc0e292a4349f8402b83a -r7343a55e81349863d0e5d7bec5c7f0b3577adf65 --- Ringtoets/Common/src/Ringtoets.Common.Forms/Properties/Resources.resx (.../Resources.resx) (revision fd98bcf5d1811dbcad2cc0e292a4349f8402b83a) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/Properties/Resources.resx (.../Resources.resx) (revision 7343a55e81349863d0e5d7bec5c7f0b3577adf65) @@ -298,4 +298,7 @@ Voeg een nieuwe berekeningsmap toe aan deze berekeningsmap. + + Resultaat + \ No newline at end of file Index: Ringtoets/Common/src/Ringtoets.Common.Forms/TreeNodeInfos/CalculationTreeNodeInfoFactory.cs =================================================================== diff -u -r2c8727ab981f791b6324428b063c414c45a607a3 -r7343a55e81349863d0e5d7bec5c7f0b3577adf65 --- Ringtoets/Common/src/Ringtoets.Common.Forms/TreeNodeInfos/CalculationTreeNodeInfoFactory.cs (.../CalculationTreeNodeInfoFactory.cs) (revision 2c8727ab981f791b6324428b063c414c45a607a3) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/TreeNodeInfos/CalculationTreeNodeInfoFactory.cs (.../CalculationTreeNodeInfoFactory.cs) (revision 7343a55e81349863d0e5d7bec5c7f0b3577adf65) @@ -80,16 +80,20 @@ /// Creates a object for a calculation context of the type . /// /// The icon of the . + /// The function for obtaining the child node objects. /// The type of calculation context to create a object for. /// A object. - public static TreeNodeInfo CreateCalculationContextTreeNodeInfo(Bitmap icon) + public static TreeNodeInfo CreateCalculationContextTreeNodeInfo( + Bitmap icon, + Func childeNodeObjects) where TCalculationContext : ICalculationContext { return new TreeNodeInfo { Text = context => context.WrappedData.Name, Image = context => icon, - EnsureVisibleOnCreate = (context, parent) => true + EnsureVisibleOnCreate = (context, parent) => true, + ChildNodeObjects = childeNodeObjects }; } Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/TreeNodeInfos/CalculationTreeNodeInfoFactoryTest.cs =================================================================== diff -u -r2c8727ab981f791b6324428b063c414c45a607a3 -r7343a55e81349863d0e5d7bec5c7f0b3577adf65 --- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/TreeNodeInfos/CalculationTreeNodeInfoFactoryTest.cs (.../CalculationTreeNodeInfoFactoryTest.cs) (revision 2c8727ab981f791b6324428b063c414c45a607a3) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/TreeNodeInfos/CalculationTreeNodeInfoFactoryTest.cs (.../CalculationTreeNodeInfoFactoryTest.cs) (revision 7343a55e81349863d0e5d7bec5c7f0b3577adf65) @@ -981,11 +981,17 @@ [Test] public void CreateCalculationContextTreeNodeInfo_Always_ExpectedPropertiesSet() { + // Setup + var icon = RingtoetsFormsResources.CalculateIcon; + Func childNodeObjects = context => new object[0]; + // Call - var treeNodeInfo = CalculationTreeNodeInfoFactory.CreateCalculationContextTreeNodeInfo(null); + var treeNodeInfo = CalculationTreeNodeInfoFactory.CreateCalculationContextTreeNodeInfo(icon, childNodeObjects); // Assert Assert.AreEqual(typeof(TestCalculationContext), treeNodeInfo.TagType); + TestHelper.AssertImagesAreEqual(icon, treeNodeInfo.Image(null)); + Assert.AreSame(childNodeObjects, treeNodeInfo.ChildNodeObjects); Assert.IsNull(treeNodeInfo.ForeColor); Assert.IsNull(treeNodeInfo.CanCheck); Assert.IsNull(treeNodeInfo.IsChecked); @@ -1008,7 +1014,7 @@ }; var context = new TestCalculationContext(calculation, failureMechanismMock); - var treeNodeInfo = CalculationTreeNodeInfoFactory.CreateCalculationContextTreeNodeInfo(null); + var treeNodeInfo = CalculationTreeNodeInfoFactory.CreateCalculationContextTreeNodeInfo(null, null); // Call var text = treeNodeInfo.Text(context); @@ -1019,24 +1025,10 @@ } [Test] - public void ImageOfCalculationContextTreeNodeInfo_Always_ReturnsIcon() - { - // Setup - var icon = RingtoetsFormsResources.CalculateIcon; - var treeNodeInfo = CalculationTreeNodeInfoFactory.CreateCalculationContextTreeNodeInfo(icon); - - // Call - var image = treeNodeInfo.Image(null); - - // Assert - TestHelper.AssertImagesAreEqual(icon, image); - } - - [Test] public void EnsureVisibleOnCreateOfCalculationContextTreeNodeInfo_Always_ReturnsTrue() { // Setup - var treeNodeInfo = CalculationTreeNodeInfoFactory.CreateCalculationContextTreeNodeInfo(null); + var treeNodeInfo = CalculationTreeNodeInfoFactory.CreateCalculationContextTreeNodeInfo(null, null); // Call var result = treeNodeInfo.EnsureVisibleOnCreate(null, null); Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/Properties/Resources.Designer.cs =================================================================== diff -u -r2a3b5c8305492fff0fa77b78fa3b2f5e9f8091a5 -r7343a55e81349863d0e5d7bec5c7f0b3577adf65 --- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 2a3b5c8305492fff0fa77b78fa3b2f5e9f8091a5) +++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 7343a55e81349863d0e5d7bec5c7f0b3577adf65) @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.42000 +// Runtime Version:4.0.30319.17929 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -524,15 +524,6 @@ } /// - /// Looks up a localized string similar to Resultaat. - /// - public static string GrassCoverErosionInwardsOutput_DisplayName { - get { - return ResourceManager.GetString("GrassCoverErosionInwardsOutput_DisplayName", resourceCulture); - } - } - - /// /// Looks up a localized string similar to Het soort kansverdeling waarin deze parameter gedefinieerd wordt.. /// public static string NormalDistribution_DestributionType_Description { Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/Properties/Resources.resx =================================================================== diff -u -r2a3b5c8305492fff0fa77b78fa3b2f5e9f8091a5 -r7343a55e81349863d0e5d7bec5c7f0b3577adf65 --- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/Properties/Resources.resx (.../Resources.resx) (revision 2a3b5c8305492fff0fa77b78fa3b2f5e9f8091a5) +++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/Properties/Resources.resx (.../Resources.resx) (revision 7343a55e81349863d0e5d7bec5c7f0b3577adf65) @@ -157,9 +157,6 @@ De berekening - - Resultaat - Invoer Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Plugin/GrassCoverErosionInwardsGuiPlugin.cs =================================================================== diff -u -r2c8727ab981f791b6324428b063c414c45a607a3 -r7343a55e81349863d0e5d7bec5c7f0b3577adf65 --- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Plugin/GrassCoverErosionInwardsGuiPlugin.cs (.../GrassCoverErosionInwardsGuiPlugin.cs) (revision 2c8727ab981f791b6324428b063c414c45a607a3) +++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Plugin/GrassCoverErosionInwardsGuiPlugin.cs (.../GrassCoverErosionInwardsGuiPlugin.cs) (revision 7343a55e81349863d0e5d7bec5c7f0b3577adf65) @@ -76,7 +76,8 @@ CalculationGroupContextOnNodeRemoved); yield return CalculationTreeNodeInfoFactory.CreateCalculationContextTreeNodeInfo( - GrassCoverErosionInwardsFormsResources.CalculationIcon); + GrassCoverErosionInwardsFormsResources.CalculationIcon, + CalculationContextChildNodeObjects); // yield return new TreeNodeInfo // { @@ -100,7 +101,7 @@ yield return new TreeNodeInfo { - Text = emptyPipingOutput => GrassCoverErosionInwardsFormsResources.GrassCoverErosionInwardsOutput_DisplayName, + Text = emptyPipingOutput => RingtoetsCommonFormsResources.CalculationOutput_DisplayName, Image = emptyPipingOutput => RingtoetsCommonFormsResources.GenericInputOutputIcon, ForeColor = emptyPipingOutput => Color.FromKnownColor(KnownColor.GrayText), ContextMenuStrip = (nodeData, parentData, treeViewControl) => Gui.Get(nodeData, treeViewControl) Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/TreeNodeInfos/EmptyGrassCoverErosionInwardsOutputTreeNodeTest.cs =================================================================== diff -u -r11e4cd9d892da070b3374027f419d2abc3ea4df9 -r7343a55e81349863d0e5d7bec5c7f0b3577adf65 --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/TreeNodeInfos/EmptyGrassCoverErosionInwardsOutputTreeNodeTest.cs (.../EmptyGrassCoverErosionInwardsOutputTreeNodeTest.cs) (revision 11e4cd9d892da070b3374027f419d2abc3ea4df9) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/TreeNodeInfos/EmptyGrassCoverErosionInwardsOutputTreeNodeTest.cs (.../EmptyGrassCoverErosionInwardsOutputTreeNodeTest.cs) (revision 7343a55e81349863d0e5d7bec5c7f0b3577adf65) @@ -76,7 +76,7 @@ var text = info.Text(null); // Assert - Assert.AreEqual(GrassCoverErosionInwardsFormsResources.GrassCoverErosionInwardsOutput_DisplayName, text); + Assert.AreEqual(RingtoetsCommonFormsResources.CalculationOutput_DisplayName, text); } [Test] Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/TreeNodeInfos/GrassCoverErosionInwardsCalculationContextTreeNodeInfoTest.cs =================================================================== diff -u -r2c8727ab981f791b6324428b063c414c45a607a3 -r7343a55e81349863d0e5d7bec5c7f0b3577adf65 --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/TreeNodeInfos/GrassCoverErosionInwardsCalculationContextTreeNodeInfoTest.cs (.../GrassCoverErosionInwardsCalculationContextTreeNodeInfoTest.cs) (revision 2c8727ab981f791b6324428b063c414c45a607a3) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/TreeNodeInfos/GrassCoverErosionInwardsCalculationContextTreeNodeInfoTest.cs (.../GrassCoverErosionInwardsCalculationContextTreeNodeInfoTest.cs) (revision 7343a55e81349863d0e5d7bec5c7f0b3577adf65) @@ -73,30 +73,30 @@ TestHelper.AssertImagesAreEqual(GrassCoverErosionInwardsFormsResources.CalculationIcon, image); } -// [Test] -// public void ChildNodeObjects_WithOutputData_ReturnOutputChildNode() -// { -// var calculation = mocksRepository.StrictMock(new GeneralGrassCoverErosionInwardsInput()); -// var failureMechanism = mocksRepository.StrictMock(); -// var assessmentSectionMock = mocksRepository.StrictMock(); -// mocksRepository.ReplayAll(); -// -// var calculationContext = new GrassCoverErosionInwardsCalculationContext(calculation, failureMechanism, assessmentSectionMock); -// -// // Call -// var children = info.ChildNodeObjects(calculationContext).ToArray(); -// -// // Assert -// Assert.AreEqual(3, children.Length); -// var commentContext = children[0] as CommentContext; -// Assert.IsNotNull(commentContext); -// Assert.AreSame(calculationContext.WrappedData, commentContext.CommentContainer); -// -// var grassCoverErosionInwardsCalculationContext = (GrassCoverErosionInwardsInputContext) children[1]; -// Assert.AreSame(calculationContext.WrappedData.InputParameters, grassCoverErosionInwardsCalculationContext.WrappedData); -// -// var emptyOutput = (EmptyGrassCoverErosionInwardsOutput) children[2]; -// Assert.IsNotNull(emptyOutput); -// } + [Test] + public void ChildNodeObjects_WithOutputData_ReturnOutputChildNode() + { + var calculation = mocksRepository.StrictMock(new GeneralGrassCoverErosionInwardsInput()); + var failureMechanism = mocksRepository.StrictMock(); + var assessmentSectionMock = mocksRepository.StrictMock(); + mocksRepository.ReplayAll(); + + var calculationContext = new GrassCoverErosionInwardsCalculationContext(calculation, failureMechanism, assessmentSectionMock); + + // Call + var children = info.ChildNodeObjects(calculationContext).ToArray(); + + // Assert + Assert.AreEqual(3, children.Length); + var commentContext = children[0] as CommentContext; + Assert.IsNotNull(commentContext); + Assert.AreSame(calculationContext.WrappedData, commentContext.CommentContainer); + + var grassCoverErosionInwardsCalculationContext = (GrassCoverErosionInwardsInputContext) children[1]; + Assert.AreSame(calculationContext.WrappedData.InputParameters, grassCoverErosionInwardsCalculationContext.WrappedData); + + var emptyOutput = (EmptyGrassCoverErosionInwardsOutput) children[2]; + Assert.IsNotNull(emptyOutput); + } } } \ No newline at end of file Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/Properties/Resources.Designer.cs =================================================================== diff -u -rfd98bcf5d1811dbcad2cc0e292a4349f8402b83a -r7343a55e81349863d0e5d7bec5c7f0b3577adf65 --- Ringtoets/Piping/src/Ringtoets.Piping.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision fd98bcf5d1811dbcad2cc0e292a4349f8402b83a) +++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 7343a55e81349863d0e5d7bec5c7f0b3577adf65) @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.34209 +// Runtime Version:4.0.30319.17929 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -1168,15 +1168,6 @@ } /// - /// Looks up a localized string similar to Piping resultaat. - /// - public static string PipingOutput_DisplayName { - get { - return ResourceManager.GetString("PipingOutput_DisplayName", resourceCulture); - } - } - - /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// public static System.Drawing.Bitmap PipingOutputIcon { Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/Properties/Resources.resx =================================================================== diff -u -rfd98bcf5d1811dbcad2cc0e292a4349f8402b83a -r7343a55e81349863d0e5d7bec5c7f0b3577adf65 --- Ringtoets/Piping/src/Ringtoets.Piping.Forms/Properties/Resources.resx (.../Resources.resx) (revision fd98bcf5d1811dbcad2cc0e292a4349f8402b83a) +++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/Properties/Resources.resx (.../Resources.resx) (revision 7343a55e81349863d0e5d7bec5c7f0b3577adf65) @@ -247,9 +247,6 @@ ..\Resources\control_equalizer_blue.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - Piping resultaat - De veiligheidsfactor voor het heave faalmechanisme. Index: Ringtoets/Piping/src/Ringtoets.Piping.Plugin/PipingGuiPlugin.cs =================================================================== diff -u -r2c8727ab981f791b6324428b063c414c45a607a3 -r7343a55e81349863d0e5d7bec5c7f0b3577adf65 --- Ringtoets/Piping/src/Ringtoets.Piping.Plugin/PipingGuiPlugin.cs (.../PipingGuiPlugin.cs) (revision 2c8727ab981f791b6324428b063c414c45a607a3) +++ Ringtoets/Piping/src/Ringtoets.Piping.Plugin/PipingGuiPlugin.cs (.../PipingGuiPlugin.cs) (revision 7343a55e81349863d0e5d7bec5c7f0b3577adf65) @@ -110,9 +110,6 @@ // yield return new TreeNodeInfo // { -// Text = pipingCalculationContext => pipingCalculationContext.WrappedData.Name, -// Image = pipingCalculationContext => PipingFormsResources.PipingIcon, -// EnsureVisibleOnCreate = (pipingCalculationContext, parent) => true, // ContextMenuStrip = PipingCalculationContextContextMenuStrip, // ChildNodeObjects = PipingCalculationContextChildNodeObjects, // CanRename = (pipingCalculationContext, parentData) => true, @@ -123,7 +120,8 @@ // }; yield return CalculationTreeNodeInfoFactory.CreateCalculationContextTreeNodeInfo( - PipingFormsResources.PipingIcon); + PipingFormsResources.PipingIcon, + PipingCalculationContextChildNodeObjects); yield return CalculationTreeNodeInfoFactory.CreateCalculationGroupContextTreeNodeInfo( PipingCalculationGroupContextChildNodeObjects, @@ -203,7 +201,7 @@ yield return new TreeNodeInfo { - Text = pipingOutput => PipingFormsResources.PipingOutput_DisplayName, + Text = pipingOutput => RingtoetsCommonFormsResources.CalculationOutput_DisplayName, Image = pipingOutput => PipingFormsResources.PipingOutputIcon, ContextMenuStrip = (nodeData, parentData, treeViewControl) => Gui.Get(nodeData, treeViewControl) .AddExportItem() @@ -214,7 +212,7 @@ yield return new TreeNodeInfo { - Text = emptyPipingOutput => PipingFormsResources.PipingOutput_DisplayName, + Text = emptyPipingOutput => RingtoetsCommonFormsResources.CalculationOutput_DisplayName, Image = emptyPipingOutput => PipingFormsResources.PipingOutputIcon, ForeColor = emptyPipingOutput => Color.FromKnownColor(KnownColor.GrayText), ContextMenuStrip = (nodeData, parentData, treeViewControl) => Gui.Get(nodeData, treeViewControl) Index: Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/TreeNodeInfos/EmptyPipingOutputTreeNodeInfoTest.cs =================================================================== diff -u -rc96f5829ddb898717ba2e98091a2219308f05d3e -r7343a55e81349863d0e5d7bec5c7f0b3577adf65 --- Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/TreeNodeInfos/EmptyPipingOutputTreeNodeInfoTest.cs (.../EmptyPipingOutputTreeNodeInfoTest.cs) (revision c96f5829ddb898717ba2e98091a2219308f05d3e) +++ Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/TreeNodeInfos/EmptyPipingOutputTreeNodeInfoTest.cs (.../EmptyPipingOutputTreeNodeInfoTest.cs) (revision 7343a55e81349863d0e5d7bec5c7f0b3577adf65) @@ -9,6 +9,7 @@ using Ringtoets.Piping.Forms.PresentationObjects; using Ringtoets.Piping.Plugin; using PipingFormsResources = Ringtoets.Piping.Forms.Properties.Resources; +using RingtoetsCommonFormsResources = Ringtoets.Common.Forms.Properties.Resources; namespace Ringtoets.Piping.Forms.Test.TreeNodeInfos { @@ -54,7 +55,7 @@ var text = info.Text(null); // Assert - Assert.AreEqual(PipingFormsResources.PipingOutput_DisplayName, text); + Assert.AreEqual(RingtoetsCommonFormsResources.CalculationOutput_DisplayName, text); } [Test] Index: Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/TreeNodeInfos/PipingCalculationScenarioContextTreeNodeInfoTest.cs =================================================================== diff -u -r2c8727ab981f791b6324428b063c414c45a607a3 -r7343a55e81349863d0e5d7bec5c7f0b3577adf65 --- Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/TreeNodeInfos/PipingCalculationScenarioContextTreeNodeInfoTest.cs (.../PipingCalculationScenarioContextTreeNodeInfoTest.cs) (revision 2c8727ab981f791b6324428b063c414c45a607a3) +++ Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/TreeNodeInfos/PipingCalculationScenarioContextTreeNodeInfoTest.cs (.../PipingCalculationScenarioContextTreeNodeInfoTest.cs) (revision 7343a55e81349863d0e5d7bec5c7f0b3577adf65) @@ -67,84 +67,84 @@ TestHelper.AssertImagesAreEqual(PipingFormsResources.PipingIcon, image); } + [Test] + public void ChildNodeObjects_WithOutputData_ReturnOutputChildNode() + { + // Setup + var calculation = new PipingCalculationScenario(new GeneralPipingInput(), new NormProbabilityPipingInput()) + { + Output = new PipingOutput(0.0, 0.0, 0.0, 0.0, 0.0, 0.0) + }; + + var pipingFailureMechanismMock = mocks.StrictMock(); + var assessmentSectionMock = mocks.StrictMock(); + mocks.ReplayAll(); + + var pipingCalculationContext = new PipingCalculationScenarioContext(calculation, + new[] + { + new RingtoetsPipingSurfaceLine() + }, + new[] + { + new TestStochasticSoilModel() + }, + pipingFailureMechanismMock, + assessmentSectionMock); + + // Call + var children = info.ChildNodeObjects(pipingCalculationContext).ToArray(); + + // Assert + Assert.AreEqual(4, children.Length); + var commentContext = children[0] as CommentContext; + Assert.IsNotNull(commentContext); + Assert.AreSame(pipingCalculationContext.WrappedData, commentContext.CommentContainer); + + var pipingInputContext = (PipingInputContext) children[1]; + Assert.AreSame(pipingCalculationContext.WrappedData.InputParameters, pipingInputContext.WrappedData); + CollectionAssert.AreEqual(pipingCalculationContext.AvailablePipingSurfaceLines, pipingInputContext.AvailablePipingSurfaceLines); + CollectionAssert.AreEqual(pipingCalculationContext.AvailableStochasticSoilModels, pipingInputContext.AvailableStochasticSoilModels); + Assert.AreSame(pipingCalculationContext.WrappedData.SemiProbabilisticOutput, children[2]); + Assert.IsInstanceOf(children[3]); + } + + [Test] + public void ChildNodeObjects_WithoutOutput_ReturnNoChildNodes() + { + // Setup + var pipingFailureMechanismMock = mocks.StrictMock(); + var assessmentSectionMock = mocks.StrictMock(); + mocks.ReplayAll(); + + var pipingCalculationContext = new PipingCalculationScenarioContext(new PipingCalculationScenario(new GeneralPipingInput(), new NormProbabilityPipingInput()), + Enumerable.Empty(), + Enumerable.Empty(), + pipingFailureMechanismMock, + assessmentSectionMock); + + // Precondition + Assert.IsFalse(pipingCalculationContext.WrappedData.HasOutput); + + // Call + var children = info.ChildNodeObjects(pipingCalculationContext).ToArray(); + + // Assert + Assert.AreEqual(4, children.Length); + var commentContext = children[0] as CommentContext; + Assert.IsNotNull(commentContext); + Assert.AreSame(pipingCalculationContext.WrappedData, commentContext.CommentContainer); + + var pipingInputContext = (PipingInputContext) children[1]; + Assert.AreSame(pipingCalculationContext.WrappedData.InputParameters, pipingInputContext.WrappedData); + CollectionAssert.AreEqual(pipingCalculationContext.AvailablePipingSurfaceLines, pipingInputContext.AvailablePipingSurfaceLines); + CollectionAssert.AreEqual(pipingCalculationContext.AvailableStochasticSoilModels, pipingInputContext.AvailableStochasticSoilModels); + + Assert.IsInstanceOf(children[2]); + Assert.IsInstanceOf(children[3]); + } + // [Test] -// public void ChildNodeObjects_WithOutputData_ReturnOutputChildNode() -// { -// // Setup -// var calculation = new PipingCalculationScenario(new GeneralPipingInput(), new NormProbabilityPipingInput()) -// { -// Output = new PipingOutput(0.0, 0.0, 0.0, 0.0, 0.0, 0.0) -// }; -// -// var pipingFailureMechanismMock = mocks.StrictMock(); -// var assessmentSectionMock = mocks.StrictMock(); -// mocks.ReplayAll(); -// -// var pipingCalculationContext = new PipingCalculationScenarioContext(calculation, -// new[] -// { -// new RingtoetsPipingSurfaceLine() -// }, -// new[] -// { -// new TestStochasticSoilModel() -// }, -// pipingFailureMechanismMock, -// assessmentSectionMock); -// -// // Call -// var children = info.ChildNodeObjects(pipingCalculationContext).ToArray(); -// -// // Assert -// Assert.AreEqual(4, children.Length); -// var commentContext = children[0] as CommentContext; -// Assert.IsNotNull(commentContext); -// Assert.AreSame(pipingCalculationContext.WrappedData, commentContext.CommentContainer); -// -// var pipingInputContext = (PipingInputContext) children[1]; -// Assert.AreSame(pipingCalculationContext.WrappedData.InputParameters, pipingInputContext.WrappedData); -// CollectionAssert.AreEqual(pipingCalculationContext.AvailablePipingSurfaceLines, pipingInputContext.AvailablePipingSurfaceLines); -// CollectionAssert.AreEqual(pipingCalculationContext.AvailableStochasticSoilModels, pipingInputContext.AvailableStochasticSoilModels); -// Assert.AreSame(pipingCalculationContext.WrappedData.SemiProbabilisticOutput, children[2]); -// Assert.IsInstanceOf(children[3]); -// } -// -// [Test] -// public void ChildNodeObjects_WithoutOutput_ReturnNoChildNodes() -// { -// // Setup -// var pipingFailureMechanismMock = mocks.StrictMock(); -// var assessmentSectionMock = mocks.StrictMock(); -// mocks.ReplayAll(); -// -// var pipingCalculationContext = new PipingCalculationScenarioContext(new PipingCalculationScenario(new GeneralPipingInput(), new NormProbabilityPipingInput()), -// Enumerable.Empty(), -// Enumerable.Empty(), -// pipingFailureMechanismMock, -// assessmentSectionMock); -// -// // Precondition -// Assert.IsFalse(pipingCalculationContext.WrappedData.HasOutput); -// -// // Call -// var children = info.ChildNodeObjects(pipingCalculationContext).ToArray(); -// -// // Assert -// Assert.AreEqual(4, children.Length); -// var commentContext = children[0] as CommentContext; -// Assert.IsNotNull(commentContext); -// Assert.AreSame(pipingCalculationContext.WrappedData, commentContext.CommentContainer); -// -// var pipingInputContext = (PipingInputContext) children[1]; -// Assert.AreSame(pipingCalculationContext.WrappedData.InputParameters, pipingInputContext.WrappedData); -// CollectionAssert.AreEqual(pipingCalculationContext.AvailablePipingSurfaceLines, pipingInputContext.AvailablePipingSurfaceLines); -// CollectionAssert.AreEqual(pipingCalculationContext.AvailableStochasticSoilModels, pipingInputContext.AvailableStochasticSoilModels); -// -// Assert.IsInstanceOf(children[2]); -// Assert.IsInstanceOf(children[3]); -// } -// -// [Test] // public void CanRenameNode_Always_ReturnTrue() // { // // Call Index: Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/TreeNodeInfos/PipingSemiProbabilisticOutputTreeNodeInfoTest.cs =================================================================== diff -u -r37e31f1893a9cfe14e9f05779eb6a0e12f6d7b6b -r7343a55e81349863d0e5d7bec5c7f0b3577adf65 --- Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/TreeNodeInfos/PipingSemiProbabilisticOutputTreeNodeInfoTest.cs (.../PipingSemiProbabilisticOutputTreeNodeInfoTest.cs) (revision 37e31f1893a9cfe14e9f05779eb6a0e12f6d7b6b) +++ Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/TreeNodeInfos/PipingSemiProbabilisticOutputTreeNodeInfoTest.cs (.../PipingSemiProbabilisticOutputTreeNodeInfoTest.cs) (revision 7343a55e81349863d0e5d7bec5c7f0b3577adf65) @@ -9,6 +9,8 @@ using Ringtoets.Piping.Forms.Properties; using Ringtoets.Piping.Plugin; +using RingtoetsCommonFormsResources = Ringtoets.Common.Forms.Properties.Resources; + namespace Ringtoets.Piping.Forms.Test.TreeNodeInfos { [TestFixture] @@ -59,7 +61,7 @@ var text = info.Text(pipingOutput); // Assert - Assert.AreEqual(Resources.PipingOutput_DisplayName, text); + Assert.AreEqual(RingtoetsCommonFormsResources.CalculationOutput_DisplayName, text); mocks.VerifyAll(); }