Index: Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Plugin.Test/FileImporters/StabilityPointStructuresUpdateDataStrategyTest.cs =================================================================== diff -u -r32ef1a284c06beac64572d830b50f291e390a66d -r8938c3f81d71ac84b914945f6b3b2107841993bf --- Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Plugin.Test/FileImporters/StabilityPointStructuresUpdateDataStrategyTest.cs (.../StabilityPointStructuresUpdateDataStrategyTest.cs) (revision 32ef1a284c06beac64572d830b50f291e390a66d) +++ Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Plugin.Test/FileImporters/StabilityPointStructuresUpdateDataStrategyTest.cs (.../StabilityPointStructuresUpdateDataStrategyTest.cs) (revision 8938c3f81d71ac84b914945f6b3b2107841993bf) @@ -67,6 +67,54 @@ } [Test] + public void UpdateStructuresWithImportedData_TargetCollectionNull_ThrowsArgumentNullException() + { + // Setup + var strategy = new StabilityPointStructureUpdateDataStrategy(new StabilityPointStructuresFailureMechanism()); + + // Call + TestDelegate test = () => strategy.UpdateStructuresWithImportedData(null, + Enumerable.Empty(), + string.Empty); + + // Assert + string paramName = Assert.Throws(test).ParamName; + Assert.AreEqual("targetDataCollection", paramName); + } + + [Test] + public void UpdateStructuresWithImportedData_ReadStructuresNull_ThrowsArgumentNullException() + { + // Setup + var strategy = new StabilityPointStructureUpdateDataStrategy(new StabilityPointStructuresFailureMechanism()); + + // Call + TestDelegate test = () => strategy.UpdateStructuresWithImportedData(new StructureCollection(), + null, + string.Empty); + + // Assert + string paramName = Assert.Throws(test).ParamName; + Assert.AreEqual("importedDataCollection", paramName); + } + + [Test] + public void UpdateStructuresWithImportedData_SourcePathNull_ThrowsArgumentNullException() + { + // Setup + var strategy = new StabilityPointStructureUpdateDataStrategy(new StabilityPointStructuresFailureMechanism()); + + // Call + TestDelegate test = () => strategy.UpdateStructuresWithImportedData(new StructureCollection(), + Enumerable.Empty(), + null); + + // Assert + string paramName = Assert.Throws(test).ParamName; + Assert.AreEqual("sourceFilePath", paramName); + } + + [Test] public void UpdateStructuresWithImportedData_WithoutCurrentStructuresAndReadStructuresHaveDuplicateNames_ThrowsUpdateDataException() { // Setup @@ -93,7 +141,7 @@ CollectionAssert.IsEmpty(targetCollection); } - + [Test] public void UpdateStructuresWithImportedData_WithCurrentStructuresAndImportedHasNoOverlap_UpdatesTargetCollection() { @@ -117,7 +165,7 @@ // Call IEnumerable affectedObjects = strategy.UpdateStructuresWithImportedData(structures, - importedStructures, + importedStructures, sourceFilePath); // Assert