Index: Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Forms.Test/TreeNodeInfos/ClosingStructuresContextTreeNodeInfoTest.cs =================================================================== diff -u -r3f40e34c76b06d66a6426c7e07fb3a101b4952cb -rd705284acf98d459d09b5b2afd48ec3a629c9a3f --- Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Forms.Test/TreeNodeInfos/ClosingStructuresContextTreeNodeInfoTest.cs (.../ClosingStructuresContextTreeNodeInfoTest.cs) (revision 3f40e34c76b06d66a6426c7e07fb3a101b4952cb) +++ Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Forms.Test/TreeNodeInfos/ClosingStructuresContextTreeNodeInfoTest.cs (.../ClosingStructuresContextTreeNodeInfoTest.cs) (revision d705284acf98d459d09b5b2afd48ec3a629c9a3f) @@ -21,7 +21,6 @@ using System.Drawing; using System.Linq; -using Core.Common.Base; using Core.Common.Controls.TreeView; using Core.Common.Gui; using Core.Common.Gui.ContextMenu; @@ -88,9 +87,9 @@ var assessmentSection = mocks.Stub(); mocks.ReplayAll(); - var closingStructures = new ObservableList(); + var failureMechanism = new ClosingStructuresFailureMechanism(); - var closingStructuresContext = new ClosingStructuresContext(closingStructures, assessmentSection); + var closingStructuresContext = new ClosingStructuresContext(failureMechanism.ClosingStructures, failureMechanism, assessmentSection); // Call string text = info.Text(closingStructuresContext); @@ -109,9 +108,9 @@ var assessmentSection = mocks.Stub(); mocks.ReplayAll(); - var closingStructures = new ObservableList(); + var failureMechanism = new ClosingStructuresFailureMechanism(); - var closingStructuresContext = new ClosingStructuresContext(closingStructures, assessmentSection); + var closingStructuresContext = new ClosingStructuresContext(failureMechanism.ClosingStructures, failureMechanism, assessmentSection); // Call Image image = info.Image(closingStructuresContext); @@ -129,15 +128,18 @@ var asssessmentSection = mocks.Stub(); mocks.ReplayAll(); - var closingStructures = new ObservableList + var failureMechanism = new ClosingStructuresFailureMechanism { - new TestClosingStructure() + ClosingStructures = + { + new TestClosingStructure() + } }; // Precondition - CollectionAssert.IsNotEmpty(closingStructures); + CollectionAssert.IsNotEmpty(failureMechanism.ClosingStructures); - var closingStructuresContext = new ClosingStructuresContext(closingStructures, asssessmentSection); + var closingStructuresContext = new ClosingStructuresContext(failureMechanism.ClosingStructures, failureMechanism, asssessmentSection); // Call Color color = info.ForeColor(closingStructuresContext); @@ -157,13 +159,16 @@ ClosingStructure closingStructure1 = new TestClosingStructure(); ClosingStructure closingStructure2 = new TestClosingStructure(); - var closingStructures = new ObservableList + var failureMechanism = new ClosingStructuresFailureMechanism { - closingStructure1, - closingStructure2 + ClosingStructures = + { + closingStructure1, + closingStructure2 + } }; - var closingStructuresContext = new ClosingStructuresContext(closingStructures, assessmentSection); + var closingStructuresContext = new ClosingStructuresContext(failureMechanism.ClosingStructures, failureMechanism, assessmentSection); // Call var children = info.ChildNodeObjects(closingStructuresContext); @@ -183,12 +188,12 @@ var asssessmentSection = mocks.Stub(); mocks.ReplayAll(); - var closingStructures = new ObservableList(); + var failureMechanism = new ClosingStructuresFailureMechanism(); // Precondition - CollectionAssert.IsEmpty(closingStructures); + CollectionAssert.IsEmpty(failureMechanism.ClosingStructures); - var closingStructuresContext = new ClosingStructuresContext(closingStructures, asssessmentSection); + var closingStructuresContext = new ClosingStructuresContext(failureMechanism.ClosingStructures, failureMechanism, asssessmentSection); // Call Color color = info.ForeColor(closingStructuresContext); @@ -204,6 +209,8 @@ // Setup var mocks = new MockRepository(); var menuBuilderMock = mocks.StrictMock(); + menuBuilderMock.Expect(mb => mb.AddDeleteChildrenItem()).Return(menuBuilderMock); + menuBuilderMock.Expect(mb => mb.AddSeparator()).Return(menuBuilderMock); menuBuilderMock.Expect(mb => mb.AddImportItem()).Return(menuBuilderMock); menuBuilderMock.Expect(mb => mb.AddSeparator()).Return(menuBuilderMock); menuBuilderMock.Expect(mb => mb.AddCollapseAllItem()).Return(menuBuilderMock);