Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/TreeNodeInfos/MacroStabilityInwardsScenariosContextTreeNodeInfoTest.cs =================================================================== diff -u -r0d67fae590a8c774697ae6836565dc1a03cf451b -r5a67fdd92b4e69e1fde669dd27605d0eeaad734b --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/TreeNodeInfos/MacroStabilityInwardsScenariosContextTreeNodeInfoTest.cs (.../MacroStabilityInwardsScenariosContextTreeNodeInfoTest.cs) (revision 0d67fae590a8c774697ae6836565dc1a03cf451b) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/TreeNodeInfos/MacroStabilityInwardsScenariosContextTreeNodeInfoTest.cs (.../MacroStabilityInwardsScenariosContextTreeNodeInfoTest.cs) (revision 5a67fdd92b4e69e1fde669dd27605d0eeaad734b) @@ -27,6 +27,7 @@ using Core.Common.TestUtil; using NUnit.Framework; using Rhino.Mocks; +using Ringtoets.Common.Data.AssessmentSection; using Ringtoets.Common.Data.Calculation; using Ringtoets.Common.Forms.Properties; using Ringtoets.MacroStabilityInwards.Data; @@ -81,48 +82,59 @@ public void Text_Always_ReturnScenarios() { // Setup + var mocks = new MockRepository(); + var assessmentSection = mocks.Stub(); + mocks.ReplayAll(); + var group = new CalculationGroup(); var failureMechanism = new MacroStabilityInwardsFailureMechanism(); - var context = new MacroStabilityInwardsScenariosContext(group, failureMechanism); + var context = new MacroStabilityInwardsScenariosContext(group, failureMechanism, assessmentSection); // Call string text = info.Text(context); // Assert Assert.AreEqual("Scenario's", text); + mocks.VerifyAll(); } [Test] public void Image_Always_ReturnExpectedImage() { // Setup + var mocks = new MockRepository(); + var assessmentSection = mocks.Stub(); + mocks.ReplayAll(); + var group = new CalculationGroup(); var failureMechanism = new MacroStabilityInwardsFailureMechanism(); - var context = new MacroStabilityInwardsScenariosContext(group, failureMechanism); + var context = new MacroStabilityInwardsScenariosContext(group, failureMechanism, assessmentSection); // Call Image image = info.Image(context); // Assert TestHelper.AssertImagesAreEqual(Resources.ScenariosIcon, image); + mocks.VerifyAll(); } [Test] public void ContextMenuStrip_Always_CallsBuilder() { // Setup - using (var treeViewControl = new TreeViewControl()) - { - var group = new CalculationGroup(); - var failureMechanism = new MacroStabilityInwardsFailureMechanism(); - var context = new MacroStabilityInwardsScenariosContext(group, failureMechanism); + var mocks = new MockRepository(); - var mocks = new MockRepository(); + var assessmentSection = mocks.Stub(); + var menuBuilder = mocks.StrictMock(); + menuBuilder.Expect(mb => mb.AddOpenItem()).Return(menuBuilder); + menuBuilder.Expect(mb => mb.Build()).Return(null); - var menuBuilder = mocks.StrictMock(); - menuBuilder.Expect(mb => mb.AddOpenItem()).Return(menuBuilder); - menuBuilder.Expect(mb => mb.Build()).Return(null); + var group = new CalculationGroup(); + var failureMechanism = new MacroStabilityInwardsFailureMechanism(); + var context = new MacroStabilityInwardsScenariosContext(group, failureMechanism, assessmentSection); + using (var treeViewControl = new TreeViewControl()) + { var gui = mocks.Stub(); gui.Stub(g => g.Get(context, treeViewControl)).Return(menuBuilder); mocks.ReplayAll();