Index: Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Plugin.Test/TreeNodeInfos/ClosingStructuresCalculationGroupContextTreeNodeInfoTest.cs =================================================================== diff -u -r6ce3cfa19ef59b12462bae4a77e9a7ee5a05e28c -r74e4e0c7b938a3c3080ff6b4a09eb01a961fed6a --- Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Plugin.Test/TreeNodeInfos/ClosingStructuresCalculationGroupContextTreeNodeInfoTest.cs (.../ClosingStructuresCalculationGroupContextTreeNodeInfoTest.cs) (revision 6ce3cfa19ef59b12462bae4a77e9a7ee5a05e28c) +++ Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Plugin.Test/TreeNodeInfos/ClosingStructuresCalculationGroupContextTreeNodeInfoTest.cs (.../ClosingStructuresCalculationGroupContextTreeNodeInfoTest.cs) (revision 74e4e0c7b938a3c3080ff6b4a09eb01a961fed6a) @@ -438,7 +438,6 @@ failureMechanism.CalculationsGroup.Children.Add(new StructuresCalculation()); var assessmentSection = mocks.Stub(); - assessmentSection.HydraulicBoundaryDatabase = null; var nodeData = new ClosingStructuresCalculationGroupContext(group, failureMechanism, @@ -538,16 +537,16 @@ string validFilePath = Path.Combine(testDataPath, "complete.sqlite"); - var hydraulicBoundaryDatabase = new HydraulicBoundaryDatabase + var failureMechanism = new ClosingStructuresFailureMechanism(); + failureMechanism.CalculationsGroup.Children.Add(new StructuresCalculation()); + + var assessmentSection = mocks.Stub(); + assessmentSection.HydraulicBoundaryDatabase = new HydraulicBoundaryDatabase { FilePath = validFilePath, Version = "1.0" }; - var failureMechanism = new ClosingStructuresFailureMechanism(); - failureMechanism.CalculationsGroup.Children.Add(new StructuresCalculation()); - - var assessmentSection = mocks.Stub(); var nodeData = new ClosingStructuresCalculationGroupContext(group, failureMechanism, assessmentSection); @@ -561,8 +560,6 @@ mocks.ReplayAll(); - assessmentSection.HydraulicBoundaryDatabase = hydraulicBoundaryDatabase; - // Call using (ContextMenuStrip menu = info.ContextMenuStrip(nodeData, null, treeViewControl)) { @@ -596,16 +593,16 @@ string validFilePath = Path.Combine(testDataPath, "complete.sqlite"); - var hydraulicBoundaryDatabase = new HydraulicBoundaryDatabase + var failureMechanism = new TestClosingStructuresFailureMechanism(); + failureMechanism.CalculationsGroup.Children.Add(new StructuresCalculation()); + + var assessmentSection = mocks.Stub(); + assessmentSection.HydraulicBoundaryDatabase = new HydraulicBoundaryDatabase { FilePath = validFilePath, Version = "1.0" }; - var failureMechanism = new TestClosingStructuresFailureMechanism(); - failureMechanism.CalculationsGroup.Children.Add(new StructuresCalculation()); - - var assessmentSection = mocks.Stub(); var nodeData = new ClosingStructuresCalculationGroupContext(group, failureMechanism, assessmentSection); @@ -619,8 +616,6 @@ mocks.ReplayAll(); - assessmentSection.HydraulicBoundaryDatabase = hydraulicBoundaryDatabase; - // Call using (ContextMenuStrip menu = info.ContextMenuStrip(nodeData, null, treeViewControl)) { @@ -654,7 +649,6 @@ HydraulicBoundaryLocation = new HydraulicBoundaryLocation(-1, "nonExisting", 1, 2) } }); - failureMechanism.CalculationsGroup.Children.Add(new TestClosingStructuresCalculation { Name = "B", @@ -670,8 +664,10 @@ hydraulicBoundaryDatabase.FilePath = validFilePath; var assessmentSection = mocks.Stub(); + assessmentSection.HydraulicBoundaryDatabase = hydraulicBoundaryDatabase; assessmentSection.Stub(a => a.Id).Return(string.Empty); assessmentSection.Stub(a => a.FailureMechanismContribution).Return(new FailureMechanismContribution(Enumerable.Empty(), 1, 1)); + var groupContext = new ClosingStructuresCalculationGroupContext(failureMechanism.CalculationsGroup, failureMechanism, assessmentSection); @@ -684,8 +680,6 @@ mocks.ReplayAll(); - assessmentSection.HydraulicBoundaryDatabase = hydraulicBoundaryDatabase; - plugin.Gui = gui; DialogBoxHandler = (name, wnd) => @@ -735,7 +729,6 @@ HydraulicBoundaryLocation = new HydraulicBoundaryLocation(-1, "nonExisting", 1, 2) } }); - failureMechanism.CalculationsGroup.Children.Add(new TestClosingStructuresCalculation { Name = "B",