Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/TreeNodeInfos/HeightStructuresCalculationContextTreeNodeInfoTest.cs =================================================================== diff -u -rb2f617ad0d8d6457422a569685763b9718740560 -r6b6f344a9cf3e6c44b63320dfa3f5c828c4221d8 --- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/TreeNodeInfos/HeightStructuresCalculationContextTreeNodeInfoTest.cs (.../HeightStructuresCalculationContextTreeNodeInfoTest.cs) (revision b2f617ad0d8d6457422a569685763b9718740560) +++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/TreeNodeInfos/HeightStructuresCalculationContextTreeNodeInfoTest.cs (.../HeightStructuresCalculationContextTreeNodeInfoTest.cs) (revision 6b6f344a9cf3e6c44b63320dfa3f5c828c4221d8) @@ -114,12 +114,12 @@ [Test] public void ChildNodeObjects_CalculationWithoutOutput_ReturnCollectionWithEmptyOutputObject() { - var assessmentSectionMock = mocks.Stub(); + var assessmentSectionStub = mocks.Stub(); mocks.ReplayAll(); var failureMechanism = new HeightStructuresFailureMechanism(); var calculation = new HeightStructuresCalculation(); - var calculationContext = new HeightStructuresCalculationContext(calculation, failureMechanism, assessmentSectionMock); + var calculationContext = new HeightStructuresCalculationContext(calculation, failureMechanism, assessmentSectionStub); // Call var children = info.ChildNodeObjects(calculationContext).ToArray(); @@ -142,7 +142,7 @@ [Test] public void ChildNodeObjects_CalculationWithOutput_ReturnCollectionWithOutputObject() { - var assessmentSectionMock = mocks.Stub(); + var assessmentSectionStub = mocks.Stub(); mocks.ReplayAll(); var failureMechanism = new HeightStructuresFailureMechanism(); @@ -151,7 +151,7 @@ Output = new TestHeightStructuresOutput() }; - var calculationContext = new HeightStructuresCalculationContext(calculation, failureMechanism, assessmentSectionMock); + var calculationContext = new HeightStructuresCalculationContext(calculation, failureMechanism, assessmentSectionStub); // Call var children = info.ChildNodeObjects(calculationContext).ToArray(); @@ -177,9 +177,9 @@ // Setup var guiMock = mocks.StrictMock(); var failureMechanism = new HeightStructuresFailureMechanism(); - var assessmentSectionMock = mocks.Stub(); + var assessmentSectionStub = mocks.Stub(); var calculation = new HeightStructuresCalculation(); - var nodeData = new HeightStructuresCalculationContext(calculation, failureMechanism, assessmentSectionMock); + var nodeData = new HeightStructuresCalculationContext(calculation, failureMechanism, assessmentSectionStub); var menuBuilderMock = mocks.StrictMock(); menuBuilderMock.Expect(mb => mb.AddCustomItem(null)).IgnoreArguments().Return(menuBuilderMock); @@ -216,9 +216,9 @@ // Setup var guiMock = mocks.StrictMock(); var failureMechanism = new HeightStructuresFailureMechanism(); - var assessmentSectionMock = mocks.Stub(); + var assessmentSectionStub = mocks.Stub(); var calculation = new HeightStructuresCalculation(); - var nodeData = new HeightStructuresCalculationContext(calculation, failureMechanism, assessmentSectionMock); + var nodeData = new HeightStructuresCalculationContext(calculation, failureMechanism, assessmentSectionStub); var menuBuilder = new CustomItemsOnlyContextMenuBuilder(); using (var treeViewControl = new TreeViewControl()) @@ -230,7 +230,7 @@ plugin.Gui = guiMock; // Call - using (ContextMenuStrip menu = info.ContextMenuStrip(nodeData, assessmentSectionMock, treeViewControl)) + using (ContextMenuStrip menu = info.ContextMenuStrip(nodeData, assessmentSectionStub, treeViewControl)) { // Assert Assert.AreEqual(6, menu.Items.Count); @@ -261,10 +261,10 @@ { // Setup var failureMechanism = new HeightStructuresFailureMechanism(); - var assessmentSectionMock = mocks.Stub(); + var assessmentSectionStub = mocks.Stub(); var calculation = new HeightStructuresCalculation(); - var nodeData = new HeightStructuresCalculationContext(calculation, failureMechanism, assessmentSectionMock); + var nodeData = new HeightStructuresCalculationContext(calculation, failureMechanism, assessmentSectionStub); var guiMock = mocks.StrictMock(); using (var treeViewControl = new TreeViewControl()) @@ -300,10 +300,10 @@ new Point2D(0, 0) })); - var assessmentSectionMock = mocks.Stub(); + var assessmentSectionStub = mocks.Stub(); var calculation = new HeightStructuresCalculation(); - var nodeData = new HeightStructuresCalculationContext(calculation, failureMechanism, assessmentSectionMock); + var nodeData = new HeightStructuresCalculationContext(calculation, failureMechanism, assessmentSectionStub); using (var treeViewControl = new TreeViewControl()) { @@ -338,18 +338,19 @@ new Point2D(0, 0) })); - var assessmentSectionMock = mocks.Stub(); - assessmentSectionMock.HydraulicBoundaryDatabase = new HydraulicBoundaryDatabase(); + var assessmentSectionStub = mocks.Stub(); var calculation = new HeightStructuresCalculation(); - var nodeData = new HeightStructuresCalculationContext(calculation, failureMechanism, assessmentSectionMock); + var nodeData = new HeightStructuresCalculationContext(calculation, failureMechanism, assessmentSectionStub); using (var treeViewControl = new TreeViewControl()) { guiMock.Expect(cmp => cmp.Get(nodeData, treeViewControl)).Return(new CustomItemsOnlyContextMenuBuilder()); mocks.ReplayAll(); + assessmentSectionStub.HydraulicBoundaryDatabase = new HydraulicBoundaryDatabase(); + plugin.Gui = guiMock; // Call @@ -386,18 +387,19 @@ new Point2D(0, 0) })); - var assessmentSectionMock = mocks.Stub(); - assessmentSectionMock.HydraulicBoundaryDatabase = hydraulicBoundaryDatabase; + var assessmentSectionStub = mocks.Stub(); var calculation = new HeightStructuresCalculation(); - var nodeData = new HeightStructuresCalculationContext(calculation, failureMechanism, assessmentSectionMock); + var nodeData = new HeightStructuresCalculationContext(calculation, failureMechanism, assessmentSectionStub); using (var treeViewControl = new TreeViewControl()) { guiMock.Expect(cmp => cmp.Get(nodeData, treeViewControl)).Return(new CustomItemsOnlyContextMenuBuilder()); mocks.ReplayAll(); + assessmentSectionStub.HydraulicBoundaryDatabase = hydraulicBoundaryDatabase; + plugin.Gui = guiMock; // Call @@ -417,10 +419,10 @@ { // Setup var failureMechanism = new HeightStructuresFailureMechanism(); - var assessmentSectionMock = mocks.Stub(); + var assessmentSectionStub = mocks.Stub(); var calculation = new HeightStructuresCalculation(); - var nodeData = new HeightStructuresCalculationContext(calculation, failureMechanism, assessmentSectionMock); + var nodeData = new HeightStructuresCalculationContext(calculation, failureMechanism, assessmentSectionStub); var guiMock = mocks.StrictMock(); using (var treeViewControl = new TreeViewControl()) @@ -456,10 +458,10 @@ new Point2D(0, 0) })); - var assessmentSectionMock = mocks.Stub(); + var assessmentSectionStub = mocks.Stub(); var calculation = new HeightStructuresCalculation(); - var nodeData = new HeightStructuresCalculationContext(calculation, failureMechanism, assessmentSectionMock); + var nodeData = new HeightStructuresCalculationContext(calculation, failureMechanism, assessmentSectionStub); using (var treeViewControl = new TreeViewControl()) { @@ -494,18 +496,19 @@ new Point2D(0, 0) })); - var assessmentSectionMock = mocks.Stub(); - assessmentSectionMock.HydraulicBoundaryDatabase = new HydraulicBoundaryDatabase(); + var assessmentSectionStub = mocks.Stub(); var calculation = new HeightStructuresCalculation(); - var nodeData = new HeightStructuresCalculationContext(calculation, failureMechanism, assessmentSectionMock); + var nodeData = new HeightStructuresCalculationContext(calculation, failureMechanism, assessmentSectionStub); using (var treeViewControl = new TreeViewControl()) { guiMock.Expect(cmp => cmp.Get(nodeData, treeViewControl)).Return(new CustomItemsOnlyContextMenuBuilder()); mocks.ReplayAll(); + assessmentSectionStub.HydraulicBoundaryDatabase = new HydraulicBoundaryDatabase(); + plugin.Gui = guiMock; // Call @@ -542,18 +545,19 @@ new Point2D(0, 0) })); - var assessmentSectionMock = mocks.Stub(); - assessmentSectionMock.HydraulicBoundaryDatabase = hydraulicBoundaryDatabase; + var assessmentSectionStub = mocks.Stub(); var calculation = new HeightStructuresCalculation(); - var nodeData = new HeightStructuresCalculationContext(calculation, failureMechanism, assessmentSectionMock); + var nodeData = new HeightStructuresCalculationContext(calculation, failureMechanism, assessmentSectionStub); using (var treeViewControl = new TreeViewControl()) { guiMock.Expect(cmp => cmp.Get(nodeData, treeViewControl)).Return(new CustomItemsOnlyContextMenuBuilder()); mocks.ReplayAll(); + assessmentSectionStub.HydraulicBoundaryDatabase = hydraulicBoundaryDatabase; + plugin.Gui = guiMock; // Call @@ -596,8 +600,7 @@ }; hydraulicBoundaryDatabase.Locations.Add(hydraulicBoundaryLocation); - var assessmentSectionMock = mocks.Stub(); - assessmentSectionMock.HydraulicBoundaryDatabase = hydraulicBoundaryDatabase; + var assessmentSectionStub = mocks.Stub(); var calculation = new HeightStructuresCalculation { @@ -609,7 +612,7 @@ } }; - var calculationContext = new HeightStructuresCalculationContext(calculation, failureMechanism, assessmentSectionMock); + var calculationContext = new HeightStructuresCalculationContext(calculation, failureMechanism, assessmentSectionStub); using (var treeViewControl = new TreeViewControl()) { @@ -618,6 +621,8 @@ mocks.ReplayAll(); + assessmentSectionStub.HydraulicBoundaryDatabase = hydraulicBoundaryDatabase; + plugin.Gui = gui; calculation.Attach(observerMock); @@ -677,8 +682,7 @@ }; hydraulicBoundaryDatabase.Locations.Add(hydraulicBoundaryLocation); - var assessmentSectionMock = mocks.Stub(); - assessmentSectionMock.HydraulicBoundaryDatabase = hydraulicBoundaryDatabase; + var assessmentSectionStub = mocks.Stub(); var calculation = new HeightStructuresCalculation { @@ -688,14 +692,16 @@ } }; - var calculationContext = new HeightStructuresCalculationContext(calculation, failureMechanism, assessmentSectionMock); + var calculationContext = new HeightStructuresCalculationContext(calculation, failureMechanism, assessmentSectionStub); using (var treeViewControl = new TreeViewControl()) { gui.Expect(g => g.Get(calculationContext, treeViewControl)).Return(new CustomItemsOnlyContextMenuBuilder()); mocks.ReplayAll(); + assessmentSectionStub.HydraulicBoundaryDatabase = hydraulicBoundaryDatabase; + plugin.Gui = gui; calculation.Attach(observerMock); @@ -725,13 +731,13 @@ var failureMechanism = new HeightStructuresFailureMechanism(); var elementToBeRemoved = new HeightStructuresCalculation(); var observerMock = mocks.StrictMock(); - var assessmentSectionMock = mocks.Stub(); + var assessmentSectionStub = mocks.Stub(); var calculationContext = new HeightStructuresCalculationContext(elementToBeRemoved, failureMechanism, - assessmentSectionMock); + assessmentSectionStub); var groupContext = new HeightStructuresCalculationGroupContext(group, failureMechanism, - assessmentSectionMock); + assessmentSectionStub); observerMock.Expect(o => o.UpdateObserver());