Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/TreeNodeInfos/GrassCoverErosionInwardsCalculationContextTreeNodeInfoTest.cs =================================================================== diff -u -ra24a95cb642879d0760c43c44f16c65bc72523ae -r4ccad80019e668d21ad9754d529f94feedf7aec0 --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/TreeNodeInfos/GrassCoverErosionInwardsCalculationContextTreeNodeInfoTest.cs (.../GrassCoverErosionInwardsCalculationContextTreeNodeInfoTest.cs) (revision a24a95cb642879d0760c43c44f16c65bc72523ae) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/TreeNodeInfos/GrassCoverErosionInwardsCalculationContextTreeNodeInfoTest.cs (.../GrassCoverErosionInwardsCalculationContextTreeNodeInfoTest.cs) (revision 4ccad80019e668d21ad9754d529f94feedf7aec0) @@ -149,7 +149,7 @@ { // Setup var failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); - var assessmentSection = mocks.Stub(); + var assessmentSection = new AssessmentSectionStub(); var parent = new CalculationGroup(); var calculation = new GrassCoverErosionInwardsCalculation(); var nodeData = new GrassCoverErosionInwardsCalculationContext(calculation, parent, failureMechanism, assessmentSection); @@ -375,7 +375,7 @@ public void GivenCalculationWithoutOutputAndWithInputOutOfSync_WhenUpdateDikeProfileClicked_ThenNoInquiryAndCalculationUpdatedAndInputObserverNotified() { // Given - var assessmentSection = mocks.Stub(); + IAssessmentSection assessmentSection = AssessmentSectionHelper.CreateAssessmentSectionStub(mocks); DikeProfile dikeProfile = DikeProfileTestFactory.CreateDikeProfile(); var parent = new CalculationGroup(); var calculation = new GrassCoverErosionInwardsCalculation @@ -424,7 +424,7 @@ public void GivenCalculationWithOutputAndInputOutOfSync_WhenUpdateDikeProfileClickedAndCancelled_ThenInquiryAndCalculationNotUpdatedAndObserversNotNotified() { // Given - var assessmentSection = mocks.Stub(); + IAssessmentSection assessmentSection = AssessmentSectionHelper.CreateAssessmentSectionStub(mocks); DikeProfile dikeProfile = DikeProfileTestFactory.CreateDikeProfile(); var parent = new CalculationGroup(); var calculation = new GrassCoverErosionInwardsCalculation @@ -487,7 +487,7 @@ public void GivenCalculationWithOutputAndInputOutOfSync_WhenUpdateDikeProfileClickedAndContinued_ThenInquiryAndCalculationUpdatedAndObserversNotified() { // Given - var assessmentSection = mocks.Stub(); + IAssessmentSection assessmentSection = AssessmentSectionHelper.CreateAssessmentSectionStub(mocks); DikeProfile dikeProfile = DikeProfileTestFactory.CreateDikeProfile(); var parent = new CalculationGroup(); @@ -612,44 +612,6 @@ } [Test] - public void ContextMenuStrip_FailureMechanismContributionZero_ContextMenuItemPerformCalculationDisabledAndTooltipSet() - { - // Setup - string validFilePath = Path.Combine(testDataPath, "complete.sqlite"); - var assessmentSection = mocks.Stub(); - var parent = new CalculationGroup(); - var calculation = new GrassCoverErosionInwardsCalculation(); - var failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); - var nodeData = new GrassCoverErosionInwardsCalculationContext(calculation, parent, failureMechanism, assessmentSection); - - assessmentSection.Stub(a => a.HydraulicBoundaryDatabase).Return(new HydraulicBoundaryDatabase - { - FilePath = validFilePath, - Version = "1.0" - }); - - using (var treeViewControl = new TreeViewControl()) - { - var gui = mocks.Stub(); - gui.Stub(cmp => cmp.Get(nodeData, treeViewControl)).Return(new CustomItemsOnlyContextMenuBuilder()); - mocks.ReplayAll(); - - plugin.Gui = gui; - - // Call - using (ContextMenuStrip contextMenu = info.ContextMenuStrip(nodeData, null, treeViewControl)) - { - // Assert - TestHelper.AssertContextMenuStripContainsItem(contextMenu, contextMenuCalculateIndex, - "Be&rekenen", - "De bijdrage van dit toetsspoor is nul.", - RingtoetsCommonFormsResources.CalculateIcon, - false); - } - } - } - - [Test] public void ContextMenuStrip_AllRequiredInputSet_ContextMenuItemPerformCalculationEnabled() { // Setup @@ -750,44 +712,6 @@ } [Test] - public void ContextMenuStrip_FailureMechanismContributionZero_ContextMenuItemValidateCalculationDisabledAndTooltipSet() - { - // Setup - string validFilePath = Path.Combine(testDataPath, "complete.sqlite"); - var assessmentSection = mocks.Stub(); - var parent = new CalculationGroup(); - var calculation = new GrassCoverErosionInwardsCalculation(); - var failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); - var nodeData = new GrassCoverErosionInwardsCalculationContext(calculation, parent, failureMechanism, assessmentSection); - - assessmentSection.Stub(a => a.HydraulicBoundaryDatabase).Return(new HydraulicBoundaryDatabase - { - FilePath = validFilePath, - Version = "1.0" - }); - - using (var treeViewControl = new TreeViewControl()) - { - var gui = mocks.Stub(); - gui.Stub(cmp => cmp.Get(nodeData, treeViewControl)).Return(new CustomItemsOnlyContextMenuBuilder()); - mocks.ReplayAll(); - - plugin.Gui = gui; - - // Call - using (ContextMenuStrip contextMenu = info.ContextMenuStrip(nodeData, null, treeViewControl)) - { - // Assert - TestHelper.AssertContextMenuStripContainsItem(contextMenu, contextMenuValidateIndex, - "&Valideren", - "De bijdrage van dit toetsspoor is nul.", - RingtoetsCommonFormsResources.ValidateIcon, - false); - } - } - } - - [Test] public void ContextMenuStrip_AllRequiredInputSet_ContextMenuItemValidateCalculationEnabled() { // Setup