Index: Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil/AssessmentSectionHelper.cs =================================================================== diff -u -rd79d26d2ad423b4287d5cdaeb0ac267089a54bf9 -r7fa4481428458d47cc3ec2fe6e75b12a1c539c8d --- Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil/AssessmentSectionHelper.cs (.../AssessmentSectionHelper.cs) (revision d79d26d2ad423b4287d5cdaeb0ac267089a54bf9) +++ Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil/AssessmentSectionHelper.cs (.../AssessmentSectionHelper.cs) (revision 7fa4481428458d47cc3ec2fe6e75b12a1c539c8d) @@ -33,27 +33,61 @@ public static class AssessmentSectionHelper { /// - /// Creates a stub of . + /// Creates a stub of without the set. /// /// The failure mechanism to set the contribution for. /// The mock repository to create the stub with. /// A stubbed . - public static IAssessmentSection CreateAssessmentSectionStub(IFailureMechanism failureMechanism, MockRepository mockRepository) + public static IAssessmentSection CreateAssessmentSectionStubWithoutBoundaryDatabase(IFailureMechanism failureMechanism, + MockRepository mockRepository) { + return CreateAssessmentSectionStub(failureMechanism, mockRepository, false, null); + } + + /// + /// Creates a stub of with the set. + /// + /// The failure mechanism to set the contribution for. + /// The mock repository to create the stub with. + /// The file path to the hydraulic boundary database. + /// A stubbed . + public static IAssessmentSection CreateAssessmentSectionStub(IFailureMechanism failureMechanism, + MockRepository mockRepository, + string filePath = null) + { + return CreateAssessmentSectionStub(failureMechanism, mockRepository, true, filePath); + } + + private static IAssessmentSection CreateAssessmentSectionStub(IFailureMechanism failureMechanism, + MockRepository mockRepository, + bool addBoundaryDatabase, + string filePath) + { var assessmentSectionStub = mockRepository.Stub(); assessmentSectionStub.Stub(a => a.Id).Return("21"); assessmentSectionStub.Stub(a => a.FailureMechanismContribution).Return(new FailureMechanismContribution(new[] { failureMechanism }, 1, 2)); - assessmentSectionStub.HydraulicBoundaryDatabase = new HydraulicBoundaryDatabase + + if (addBoundaryDatabase) { + assessmentSectionStub.HydraulicBoundaryDatabase = GetHydraulicBoundaryDatabase(filePath); + } + + return assessmentSectionStub; + } + + private static HydraulicBoundaryDatabase GetHydraulicBoundaryDatabase(string filePath = null) + { + return new HydraulicBoundaryDatabase + { + FilePath = filePath, Locations = { new HydraulicBoundaryLocation(1300001, string.Empty, 0, 0) } }; - return assessmentSectionStub; } } } \ No newline at end of file