Index: Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Plugin.Test/TreeNodeInfos/DuneLocationCalculationsContextTreeNodeInfoTest.cs =================================================================== diff -u -rd02138fd08881584c9ec57b6d87f6426c6e43eb2 -r3f33a67c2e73865c56f405756b30d73d8cb1862e --- Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Plugin.Test/TreeNodeInfos/DuneLocationCalculationsContextTreeNodeInfoTest.cs (.../DuneLocationCalculationsContextTreeNodeInfoTest.cs) (revision d02138fd08881584c9ec57b6d87f6426c6e43eb2) +++ Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Plugin.Test/TreeNodeInfos/DuneLocationCalculationsContextTreeNodeInfoTest.cs (.../DuneLocationCalculationsContextTreeNodeInfoTest.cs) (revision 3f33a67c2e73865c56f405756b30d73d8cb1862e) @@ -227,20 +227,22 @@ Contribution = 10 }; - var builder = new CustomItemsOnlyContextMenuBuilder(); - var context = new DuneLocationCalculationsContext(new ObservableList(), + var duneLocationCalculations = new ObservableList + { + new DuneLocationCalculation(new TestDuneLocation()) + }; + var context = new DuneLocationCalculationsContext(duneLocationCalculations, failureMechanism, assessmentSection); + var builder = new CustomItemsOnlyContextMenuBuilder(); var gui = mocks.Stub(); gui.Stub(cmp => cmp.Get(context, treeViewControl)).Return(builder); mocks.ReplayAll(); plugin.Gui = gui; - failureMechanism.DuneLocations.Add(new TestDuneLocation()); - // Call using (ContextMenuStrip menu = info.ContextMenuStrip(context, null, treeViewControl)) { @@ -367,20 +369,22 @@ Contribution = 10 }; - var builder = new CustomItemsOnlyContextMenuBuilder(); - var context = new DuneLocationCalculationsContext(new ObservableList(), + var duneLocationCalculations = new ObservableList + { + new DuneLocationCalculation(new TestDuneLocation()) + }; + var context = new DuneLocationCalculationsContext(duneLocationCalculations, failureMechanism, assessmentSection); + var builder = new CustomItemsOnlyContextMenuBuilder(); var gui = mocks.Stub(); gui.Stub(cmp => cmp.Get(context, treeViewControl)).Return(builder); mocks.ReplayAll(); plugin.Gui = gui; - failureMechanism.DuneLocations.Add(new TestDuneLocation()); - // Call using (ContextMenuStrip menu = info.ContextMenuStrip(context, null, treeViewControl)) { @@ -448,20 +452,20 @@ var gui = mocks.Stub(); gui.Stub(cmp => cmp.Get(context, treeViewControl)).Return(builder); gui.Stub(g => g.MainWindow).Return(mainWindow); - var locationObserver = mocks.StrictMock(); - locationObserver.Expect(o => o.UpdateObserver()).Repeat.Times(failureMechanism.DuneLocations.Count); - var locationsObsever = mocks.StrictMock(); + var calculationObserver = mocks.StrictMock(); + calculationObserver.Expect(o => o.UpdateObserver()).Repeat.Times(duneLocationCalculations.Count); + var calculationsObserver = mocks.StrictMock(); - int nrOfCalculators = failureMechanism.DuneLocations.Count; + int nrOfCalculators = duneLocationCalculations.Count; var calculatorFactory = mocks.Stub(); calculatorFactory.Expect(cf => cf.CreateDunesBoundaryConditionsCalculator(testDataPath, string.Empty)) .Return(new TestDunesBoundaryConditionsCalculator()) .Repeat .Times(nrOfCalculators); mocks.ReplayAll(); - failureMechanism.DuneLocations.Attach(locationsObsever); - failureMechanism.DuneLocations.ForEachElementDo(location => location.Attach(locationObserver)); + duneLocationCalculations.Attach(calculationsObserver); + duneLocationCalculations.ForEachElementDo(location => location.Attach(calculationObserver)); plugin.Gui = gui; plugin.Activate();