Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/TreeNodeInfos/GrassCoverErosionInwardsCalculationGroupContextTreeNodeInfoTest.cs =================================================================== diff -u -r7da4bf0d587e7cf9f69336d2ea5519af38dbfc0b -rcf009c0f9f2bc41dd3456fcdbf89704021ca8d3c --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/TreeNodeInfos/GrassCoverErosionInwardsCalculationGroupContextTreeNodeInfoTest.cs (.../GrassCoverErosionInwardsCalculationGroupContextTreeNodeInfoTest.cs) (revision 7da4bf0d587e7cf9f69336d2ea5519af38dbfc0b) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/TreeNodeInfos/GrassCoverErosionInwardsCalculationGroupContextTreeNodeInfoTest.cs (.../GrassCoverErosionInwardsCalculationGroupContextTreeNodeInfoTest.cs) (revision cf009c0f9f2bc41dd3456fcdbf89704021ca8d3c) @@ -404,7 +404,7 @@ } [Test] - public void ContextMenuStrip_NoHydraulicBoundaryDatabase_ContextMenuItemCalculateAllDisabledAndTooltipSet() + public void ContextMenuStrip_HydraulicBoundaryDatabaseNotCoupled_ContextMenuItemCalculateAllDisabledAndTooltipSet() { // Setup var group = new CalculationGroup @@ -418,7 +418,7 @@ var failureMechanism = new TestGrassCoverErosionInwardsFailureMechanism(); failureMechanism.CalculationsGroup.Children.Add(new GrassCoverErosionInwardsCalculation()); - var assessmentSection = mocks.Stub(); + IAssessmentSection assessmentSection = AssessmentSectionHelper.CreateAssessmentSectionStub(mocks); var nodeData = new GrassCoverErosionInwardsCalculationGroupContext(group, null, failureMechanism, @@ -1059,7 +1059,7 @@ } [Test] - public void ContextMenuStrip_NoHydraulicBoundaryDatabase_ContextMenuItemValidateAllDisabledAndTooltipSet() + public void ContextMenuStrip_HydraulicBoundaryDatabaseNotCoupled_ContextMenuItemValidateAllDisabledAndTooltipSet() { // Setup var group = new CalculationGroup @@ -1073,7 +1073,7 @@ var failureMechanism = new TestGrassCoverErosionInwardsFailureMechanism(); failureMechanism.CalculationsGroup.Children.Add(new GrassCoverErosionInwardsCalculation()); - var assessmentSection = mocks.Stub(); + IAssessmentSection assessmentSection = AssessmentSectionHelper.CreateAssessmentSectionStub(mocks); var nodeData = new GrassCoverErosionInwardsCalculationGroupContext(group, null, failureMechanism, @@ -1112,7 +1112,7 @@ } [Test] - public void ContextMenuStrip_HydraulicBoundaryDatabaseNotValid_ContextMenuItemValidateAllDisabledAndTooltipSet() + public void ContextMenuStrip_HydraulicBoundaryDatabaseCoupledToInvalidFile_ContextMenuItemValidateAllDisabledAndTooltipSet() { // Setup var group = new CalculationGroup @@ -1126,8 +1126,7 @@ var failureMechanism = new TestGrassCoverErosionInwardsFailureMechanism(); failureMechanism.CalculationsGroup.Children.Add(new GrassCoverErosionInwardsCalculation()); - var assessmentSection = mocks.Stub(); - assessmentSection.Stub(a => a.HydraulicBoundaryDatabase).Return(new HydraulicBoundaryDatabase()); + IAssessmentSection assessmentSection = AssessmentSectionHelper.CreateAssessmentSectionStub(null, mocks, "invalidFilePath"); var nodeData = new GrassCoverErosionInwardsCalculationGroupContext(group, null, Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/TreeNodeInfos/GrassCoverErosionInwardsFailureMechanismContextTreeNodeInfoTest.cs =================================================================== diff -u -r7da4bf0d587e7cf9f69336d2ea5519af38dbfc0b -rcf009c0f9f2bc41dd3456fcdbf89704021ca8d3c --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/TreeNodeInfos/GrassCoverErosionInwardsFailureMechanismContextTreeNodeInfoTest.cs (.../GrassCoverErosionInwardsFailureMechanismContextTreeNodeInfoTest.cs) (revision 7da4bf0d587e7cf9f69336d2ea5519af38dbfc0b) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/TreeNodeInfos/GrassCoverErosionInwardsFailureMechanismContextTreeNodeInfoTest.cs (.../GrassCoverErosionInwardsFailureMechanismContextTreeNodeInfoTest.cs) (revision cf009c0f9f2bc41dd3456fcdbf89704021ca8d3c) @@ -415,13 +415,13 @@ } [Test] - public void ContextMenuStrip_NoHydraulicBoundaryDatabase_ContextMenuItemCalculateAllDisabledAndTooltipSet() + public void ContextMenuStrip_HydraulicBoundaryDatabaseNotCoupled_ContextMenuItemCalculateAllDisabledAndTooltipSet() { // Setup var failureMechanism = new TestGrassCoverErosionInwardsFailureMechanism(); failureMechanism.CalculationsGroup.Children.Add(new GrassCoverErosionInwardsCalculation()); - var assessmentSection = mocksRepository.Stub(); + IAssessmentSection assessmentSection = AssessmentSectionHelper.CreateAssessmentSectionStub(mocksRepository); var nodeData = new GrassCoverErosionInwardsFailureMechanismContext(failureMechanism, assessmentSection); var menuBuilder = new CustomItemsOnlyContextMenuBuilder(); @@ -560,13 +560,13 @@ } [Test] - public void ContextMenuStrip_NoHydraulicBoundaryDatabase_ContextMenuItemValidateAllDisabledAndTooltipSet() + public void ContextMenuStrip_HydraulicBoundaryDatabaseNotCoupled_ContextMenuItemValidateAllDisabledAndTooltipSet() { // Setup var failureMechanism = new TestGrassCoverErosionInwardsFailureMechanism(); failureMechanism.CalculationsGroup.Children.Add(new GrassCoverErosionInwardsCalculation()); - var assessmentSection = mocksRepository.Stub(); + IAssessmentSection assessmentSection = AssessmentSectionHelper.CreateAssessmentSectionStub(mocksRepository); var nodeData = new GrassCoverErosionInwardsFailureMechanismContext(failureMechanism, assessmentSection); var menuBuilder = new CustomItemsOnlyContextMenuBuilder(); @@ -593,14 +593,13 @@ } [Test] - public void ContextMenuStrip_HydraulicBoundaryDatabaseNotValid_ContextMenuItemValidateAllDisabledAndTooltipSet() + public void ContextMenuStrip_HydraulicBoundaryDatabaseCoupledToInvalidFile_ContextMenuItemValidateAllDisabledAndTooltipSet() { // Setup var failureMechanism = new TestGrassCoverErosionInwardsFailureMechanism(); failureMechanism.CalculationsGroup.Children.Add(new GrassCoverErosionInwardsCalculation()); - var assessmentSection = mocksRepository.Stub(); - assessmentSection.Stub(a => a.HydraulicBoundaryDatabase).Return(new HydraulicBoundaryDatabase()); + IAssessmentSection assessmentSection = AssessmentSectionHelper.CreateAssessmentSectionStub(null, mocksRepository, "invalidFilePath"); var nodeData = new GrassCoverErosionInwardsFailureMechanismContext(failureMechanism, assessmentSection); var menuBuilder = new CustomItemsOnlyContextMenuBuilder(); Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Plugin.Test/ImportInfos/HeightStructuresCalculationGroupContextImportInfoTest.cs =================================================================== diff -u -rac96d7c315129af851634ed5a4a6800b59ede718 -rcf009c0f9f2bc41dd3456fcdbf89704021ca8d3c --- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Plugin.Test/ImportInfos/HeightStructuresCalculationGroupContextImportInfoTest.cs (.../HeightStructuresCalculationGroupContextImportInfoTest.cs) (revision ac96d7c315129af851634ed5a4a6800b59ede718) +++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Plugin.Test/ImportInfos/HeightStructuresCalculationGroupContextImportInfoTest.cs (.../HeightStructuresCalculationGroupContextImportInfoTest.cs) (revision cf009c0f9f2bc41dd3456fcdbf89704021ca8d3c) @@ -28,6 +28,7 @@ using Rhino.Mocks; using Ringtoets.Common.Data.AssessmentSection; using Ringtoets.Common.Data.Calculation; +using Ringtoets.Common.Data.TestUtil; using Ringtoets.HeightStructures.Data; using Ringtoets.HeightStructures.Forms.PresentationObjects; using Ringtoets.HeightStructures.IO.Configurations; @@ -62,7 +63,7 @@ { // Setup var mocks = new MockRepository(); - var assessmentSection = mocks.Stub(); + IAssessmentSection assessmentSection = AssessmentSectionHelper.CreateAssessmentSectionStub(mocks); mocks.ReplayAll(); var context = new HeightStructuresCalculationGroupContext(new CalculationGroup(), Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Plugin.Test/TreeNodeInfos/HeightStructuresFailureMechanismContextTreeNodeInfoTest.cs =================================================================== diff -u -r7da4bf0d587e7cf9f69336d2ea5519af38dbfc0b -rcf009c0f9f2bc41dd3456fcdbf89704021ca8d3c --- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Plugin.Test/TreeNodeInfos/HeightStructuresFailureMechanismContextTreeNodeInfoTest.cs (.../HeightStructuresFailureMechanismContextTreeNodeInfoTest.cs) (revision 7da4bf0d587e7cf9f69336d2ea5519af38dbfc0b) +++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Plugin.Test/TreeNodeInfos/HeightStructuresFailureMechanismContextTreeNodeInfoTest.cs (.../HeightStructuresFailureMechanismContextTreeNodeInfoTest.cs) (revision cf009c0f9f2bc41dd3456fcdbf89704021ca8d3c) @@ -429,13 +429,13 @@ } [Test] - public void ContextMenuStrip_NoHydraulicBoundaryDatabase_ContextMenuItemCalculateAllDisabledAndTooltipSet() + public void ContextMenuStrip_HydraulicBoundaryDatabaseNotCoupled_ContextMenuItemCalculateAllDisabledAndTooltipSet() { // Setup var failureMechanism = new TestHeightStructuresFailureMechanism(); failureMechanism.CalculationsGroup.Children.Add(new StructuresCalculation()); - var assessmentSection = mocksRepository.Stub(); + IAssessmentSection assessmentSection = AssessmentSectionHelper.CreateAssessmentSectionStub(mocksRepository); var nodeData = new HeightStructuresFailureMechanismContext(failureMechanism, assessmentSection); var menuBuilder = new CustomItemsOnlyContextMenuBuilder(); @@ -578,13 +578,13 @@ } [Test] - public void ContextMenuStrip_NoHydraulicBoundaryDatabase_ContextMenuItemValidateAllDisabledAndTooltipSet() + public void ContextMenuStrip_HydraulicBoundaryDatabaseNotCoupled_ContextMenuItemValidateAllDisabledAndTooltipSet() { // Setup var failureMechanism = new TestHeightStructuresFailureMechanism(); failureMechanism.CalculationsGroup.Children.Add(new StructuresCalculation()); - var assessmentSection = mocksRepository.Stub(); + IAssessmentSection assessmentSection = AssessmentSectionHelper.CreateAssessmentSectionStub(mocksRepository); var nodeData = new HeightStructuresFailureMechanismContext(failureMechanism, assessmentSection); var menuBuilder = new CustomItemsOnlyContextMenuBuilder(); @@ -612,14 +612,13 @@ } [Test] - public void ContextMenuStrip_HydraulicBoundaryDatabaseNotValid_ContextMenuItemValidateAllDisabledAndTooltipSet() + public void ContextMenuStrip_HydraulicBoundaryDatabaseCoupledToInvalidFile_ContextMenuItemValidateAllDisabledAndTooltipSet() { // Setup var failureMechanism = new TestHeightStructuresFailureMechanism(); failureMechanism.CalculationsGroup.Children.Add(new StructuresCalculation()); - var assessmentSection = mocksRepository.Stub(); - assessmentSection.Stub(a => a.HydraulicBoundaryDatabase).Return(new HydraulicBoundaryDatabase()); + IAssessmentSection assessmentSection = AssessmentSectionHelper.CreateAssessmentSectionStub(null, mocksRepository, "invalidFilePath"); var nodeData = new HeightStructuresFailureMechanismContext(failureMechanism, assessmentSection); var menuBuilder = new CustomItemsOnlyContextMenuBuilder();