Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Plugin.Test/FileImporters/HeightStructureReplaceDataStrategyTest.cs =================================================================== diff -u -r5f6b3f80bb6747f12157149f7689a8fc7d3552a5 -rb2fa3c06d32059473875aa82186750d50740606b --- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Plugin.Test/FileImporters/HeightStructureReplaceDataStrategyTest.cs (.../HeightStructureReplaceDataStrategyTest.cs) (revision 5f6b3f80bb6747f12157149f7689a8fc7d3552a5) +++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Plugin.Test/FileImporters/HeightStructureReplaceDataStrategyTest.cs (.../HeightStructureReplaceDataStrategyTest.cs) (revision b2fa3c06d32059473875aa82186750d50740606b) @@ -75,7 +75,8 @@ var strategy = new HeightStructureReplaceDataStrategy(new HeightStructuresFailureMechanism()); // Call - TestDelegate test = () => strategy.UpdateStructuresWithImportedData(null, Enumerable.Empty(), + TestDelegate test = () => strategy.UpdateStructuresWithImportedData(null, + Enumerable.Empty(), string.Empty); // Assert @@ -203,6 +204,52 @@ } [Test] + public void UpdateStructuresWithImportedData_CalculationWithoutOutputAndStructure_CalculationUpdatedAndReturnsAffectedObject() + { + // Setup + var structure = new TestHeightStructure(); + + var calculation = new StructuresCalculation + { + InputParameters = + { + Structure = structure + } + }; + + var failureMechanism = new HeightStructuresFailureMechanism + { + CalculationsGroup = + { + Children = + { + calculation + } + } + }; + failureMechanism.HeightStructures.AddRange(new[] + { + structure + }, sourceFilePath); + + var strategy = new HeightStructureReplaceDataStrategy(failureMechanism); + + // Call + IEnumerable affectedObjects = strategy.UpdateStructuresWithImportedData( + failureMechanism.HeightStructures, + Enumerable.Empty(), + sourceFilePath).ToArray(); + + // Assert + Assert.IsNull(calculation.InputParameters.Structure); + CollectionAssert.AreEquivalent(new IObservable[] + { + calculation.InputParameters, + failureMechanism.HeightStructures + }, affectedObjects); + } + + [Test] public void UpdateStructuresWithImportedData_CalculationWithOutputAndStructure_CalculationUpdatedAndReturnsAffectedObject() { // Setup Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Plugin.Test/FileImporters/HeightStructureUpdateDataStrategyTest.cs =================================================================== diff -u -rbc752890b4f52991a673a59c089db400be0e6fc3 -rb2fa3c06d32059473875aa82186750d50740606b --- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Plugin.Test/FileImporters/HeightStructureUpdateDataStrategyTest.cs (.../HeightStructureUpdateDataStrategyTest.cs) (revision bc752890b4f52991a673a59c089db400be0e6fc3) +++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Plugin.Test/FileImporters/HeightStructureUpdateDataStrategyTest.cs (.../HeightStructureUpdateDataStrategyTest.cs) (revision b2fa3c06d32059473875aa82186750d50740606b) @@ -247,7 +247,7 @@ } [Test] - public void UpdateStructuresWithImportedData_WithoutCurrentStructureAndImportedMultipleStructuresWithSameId_ThrowsStructureUpdateException() + public void UpdateStructuresWithImportedData_WithCurrentStructureAndImportedMultipleStructuresWithSameId_ThrowsStructureUpdateException() { // Setup const string duplicateId = "I am a duplicate id"; @@ -569,6 +569,8 @@ failureMechanism.Calculations.Cast>()); HeightStructuresFailureMechanismSectionResult[] sectionResults = failureMechanism.SectionResults.ToArray(); + + // Precondition Assert.AreSame(calculation, sectionResults[0].Calculation); Assert.IsNull(sectionResults[1].Calculation); Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Plugin.Test/UpdateInfos/HeightStructuresContextUpdateInfoTest.cs =================================================================== diff -u -r2f41eb6eb560911cd4ebe2d4d6924c26df911c40 -rb2fa3c06d32059473875aa82186750d50740606b --- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Plugin.Test/UpdateInfos/HeightStructuresContextUpdateInfoTest.cs (.../HeightStructuresContextUpdateInfoTest.cs) (revision 2f41eb6eb560911cd4ebe2d4d6924c26df911c40) +++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Plugin.Test/UpdateInfos/HeightStructuresContextUpdateInfoTest.cs (.../HeightStructuresContextUpdateInfoTest.cs) (revision b2fa3c06d32059473875aa82186750d50740606b) @@ -261,7 +261,7 @@ var importTarget = new HeightStructuresContext(structures, failureMechanism, assessmentSection); // Call - IFileImporter importer = updateInfo.CreateFileImporter(importTarget, ""); + IFileImporter importer = updateInfo.CreateFileImporter(importTarget, "This is valid"); // Assert Assert.IsInstanceOf(importer); Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Service.Test/HeightStructuresDataSynchronizationServiceTest.cs =================================================================== diff -u -r8b389428ece343431969fce2e902a7b241f2b372 -rb2fa3c06d32059473875aa82186750d50740606b --- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Service.Test/HeightStructuresDataSynchronizationServiceTest.cs (.../HeightStructuresDataSynchronizationServiceTest.cs) (revision 8b389428ece343431969fce2e902a7b241f2b372) +++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Service.Test/HeightStructuresDataSynchronizationServiceTest.cs (.../HeightStructuresDataSynchronizationServiceTest.cs) (revision b2fa3c06d32059473875aa82186750d50740606b) @@ -415,11 +415,6 @@ Assert.IsNull(calculation.InputParameters.Structure); } - IObservable[] affectedObjectsArray = observables.ToArray(); - int expectedAffectedObjectCount = 1 + calculationsWithOutput.Length + calculationsWithStructure.Length + - sectionResultsWithStructure.Length; - Assert.AreEqual(expectedAffectedObjectCount, affectedObjectsArray.Length); - foreach (StructuresCalculation calculation in calculationsWithOutput) { Assert.IsFalse(calculation.HasOutput); @@ -434,7 +429,7 @@ { failureMechanism.HeightStructures }); - CollectionAssert.AreEquivalent(expectedAffectedObjects, affectedObjectsArray); + CollectionAssert.AreEquivalent(expectedAffectedObjects, observables); } private HeightStructuresFailureMechanism CreateFullyConfiguredFailureMechanism() Index: Ringtoets/Piping/src/Ringtoets.Piping.Plugin/FileImporter/PipingSurfaceLinesCsvImporter.cs =================================================================== diff -u -r8e74b5d6680386fce48486c8253b62331f7d7055 -rb2fa3c06d32059473875aa82186750d50740606b --- Ringtoets/Piping/src/Ringtoets.Piping.Plugin/FileImporter/PipingSurfaceLinesCsvImporter.cs (.../PipingSurfaceLinesCsvImporter.cs) (revision 8e74b5d6680386fce48486c8253b62331f7d7055) +++ Ringtoets/Piping/src/Ringtoets.Piping.Plugin/FileImporter/PipingSurfaceLinesCsvImporter.cs (.../PipingSurfaceLinesCsvImporter.cs) (revision b2fa3c06d32059473875aa82186750d50740606b) @@ -261,7 +261,9 @@ } } } - return intersectionPoint != null ? ReferenceLineIntersectionResult.CreateIntersectionResult(intersectionPoint) : ReferenceLineIntersectionResult.CreateNoSingleIntersectionResult(); + return intersectionPoint != null + ? ReferenceLineIntersectionResult.CreateIntersectionResult(intersectionPoint) + : ReferenceLineIntersectionResult.CreateNoSingleIntersectionResult(); } private static void SetCharacteristicPointsOnSurfaceLine(RingtoetsPipingSurfaceLine readSurfaceLine, CharacteristicPoints characteristicPointsLocation)