Index: Riskeer/Integration/test/Riskeer.Integration.IO.Test/Helpers/HydraulicBoundaryLocationCalculationsExportHelperTest.cs =================================================================== diff -u -r01c40dbdf75bccae38a7728556afe2f8968f55c0 -rcb072e114ec1ac31c5f358e3d2ed05f9d5e45c27 --- Riskeer/Integration/test/Riskeer.Integration.IO.Test/Helpers/HydraulicBoundaryLocationCalculationsExportHelperTest.cs (.../HydraulicBoundaryLocationCalculationsExportHelperTest.cs) (revision 01c40dbdf75bccae38a7728556afe2f8968f55c0) +++ Riskeer/Integration/test/Riskeer.Integration.IO.Test/Helpers/HydraulicBoundaryLocationCalculationsExportHelperTest.cs (.../HydraulicBoundaryLocationCalculationsExportHelperTest.cs) (revision cb072e114ec1ac31c5f358e3d2ed05f9d5e45c27) @@ -207,6 +207,47 @@ } } + [Test] + [TestCase(HydraulicBoundaryLocationCalculationsType.WaterLevel, 0.001, "Waterstanden_1000")] + [TestCase(HydraulicBoundaryLocationCalculationsType.WaterLevel, 0.0001, "Waterstanden_10000")] + [TestCase(HydraulicBoundaryLocationCalculationsType.WaveHeight, 0.001, "Golfhoogten_1000")] + [TestCase(HydraulicBoundaryLocationCalculationsType.WaveHeight, 0.0001, "Golfhoogten_10000")] + public void GetUniqueFileName_WithoutExistingFileNames_ReturnsExpectedFileName(HydraulicBoundaryLocationCalculationsType calculationsType, + double targetProbability, string expectedFileName) + { + // Call + string uniqueFileName = HydraulicBoundaryLocationCalculationsExportHelper.GetUniqueFileName(calculationsType, targetProbability); + + // Assert + Assert.AreEqual(expectedFileName, uniqueFileName); + } + + [Test] + [TestCase(HydraulicBoundaryLocationCalculationsType.WaterLevel, 0.001, "Waterstanden_1000")] + [TestCase(HydraulicBoundaryLocationCalculationsType.WaterLevel, 0.0001, "Waterstanden_10000 (1)")] + [TestCase(HydraulicBoundaryLocationCalculationsType.WaveHeight, 0.001, "Golfhoogten_1000 (2)")] + [TestCase(HydraulicBoundaryLocationCalculationsType.WaveHeight, 0.0001, "Golfhoogten_10000")] + public void GetUniqueFileName_WithExistingFileNames_ReturnsExpectedFileName(HydraulicBoundaryLocationCalculationsType calculationsType, + double targetProbability, string expectedFileName) + { + // Setup + var existingFileNames = new[] + { + "Waterstanden_1000 (1)", + "Waterstanden_10000", + "Golfhoogten_1000", + "Golfhoogten_1000 (1)", + "Golfhoogten_1000 (3)", + "Golfhoogten_10000 (1)" + }; + + // Call + string uniqueFileName = HydraulicBoundaryLocationCalculationsExportHelper.GetUniqueFileName(calculationsType, targetProbability, existingFileNames); + + // Assert + Assert.AreEqual(expectedFileName, uniqueFileName); + } + private static string GetExpectedShapeFileName(HydraulicBoundaryLocationCalculationsType calculationsType, double targetProbability) {