Index: Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/FileImporter/StochasticSoilModelUpdateDataTest.cs =================================================================== diff -u -r673bf2f4f4de6006444aae3a10183f9442eb0f23 -r89d34600d1408c8b1f4240020e841ba64cc26622 --- Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/FileImporter/StochasticSoilModelUpdateDataTest.cs (.../StochasticSoilModelUpdateDataTest.cs) (revision 673bf2f4f4de6006444aae3a10183f9442eb0f23) +++ Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/FileImporter/StochasticSoilModelUpdateDataTest.cs (.../StochasticSoilModelUpdateDataTest.cs) (revision 89d34600d1408c8b1f4240020e841ba64cc26622) @@ -33,20 +33,31 @@ public class StochasticSoilModelUpdateDataTest { [Test] - public void DefaultConstructor_CreatesNewInstance() + public void Constructor_WithoutCalculations_CreatesNewInstance() { // Call - var strategy = new StochasticSoilModelUpdateData(); + TestDelegate test = () => new StochasticSoilModelUpdateData(null); // Assert + string paramName = Assert.Throws(test).ParamName; + Assert.AreEqual("failureMechanism", paramName); + } + + [Test] + public void Constructor_WithCalculations_CreatesNewInstance() + { + // Call + var strategy = new StochasticSoilModelUpdateData(new PipingFailureMechanism()); + + // Assert Assert.IsInstanceOf(strategy); } [Test] public void UpdateModelWithImportedData_ReadStochasticSoilModelsNull_ThrowsArgumentNullException() { // Setup - var strategy = new StochasticSoilModelUpdateData(); + var strategy = new StochasticSoilModelUpdateData(new PipingFailureMechanism()); // Call TestDelegate test = () => strategy.UpdateModelWithImportedData(null, string.Empty, new StochasticSoilModelCollection()); @@ -60,7 +71,7 @@ public void UpdateModelWithImportedData_SourceFilePathNull_ThrowsArgumentNullException() { // Setup - var strategy = new StochasticSoilModelUpdateData(); + var strategy = new StochasticSoilModelUpdateData(new PipingFailureMechanism()); // Call TestDelegate test = () => strategy.UpdateModelWithImportedData(new List(), null, new StochasticSoilModelCollection()); @@ -74,7 +85,7 @@ public void UpdateModelWithImportedData_TargetCollectionNull_ThrowsArgumentNullException() { // Setup - var strategy = new StochasticSoilModelUpdateData(); + var strategy = new StochasticSoilModelUpdateData(new PipingFailureMechanism()); // Call TestDelegate test = () => strategy.UpdateModelWithImportedData(new List(), string.Empty, null); @@ -98,7 +109,7 @@ new TestStochasticSoilModel(nonUniqueName) }, sourceFilePath); - var strategy = new StochasticSoilModelUpdateData(); + var strategy = new StochasticSoilModelUpdateData(new PipingFailureMechanism()); var importedStochasticSoilModels = new[] { new TestStochasticSoilModel(nonUniqueName) @@ -120,7 +131,7 @@ new TestStochasticSoilModel(), new TestStochasticSoilModel() }; - var strategy = new StochasticSoilModelUpdateData(); + var strategy = new StochasticSoilModelUpdateData(new PipingFailureMechanism()); var targetCollection = new StochasticSoilModelCollection(); // Call @@ -142,7 +153,7 @@ new TestStochasticSoilModel() }, sourceFilePath); - var strategy = new StochasticSoilModelUpdateData(); + var strategy = new StochasticSoilModelUpdateData(new PipingFailureMechanism()); // Call strategy.UpdateModelWithImportedData(new List(), sourceFilePath, targetCollection); @@ -165,7 +176,7 @@ existingModel, }, sourceFilePath); - var strategy = new StochasticSoilModelUpdateData(); + var strategy = new StochasticSoilModelUpdateData(new PipingFailureMechanism()); // Call strategy.UpdateModelWithImportedData(new[] { readModel }, sourceFilePath, targetCollection); @@ -189,15 +200,13 @@ existingModel, }, sourceFilePath); - var strategy = new StochasticSoilModelUpdateData(); + var strategy = new StochasticSoilModelUpdateData(new PipingFailureMechanism()); // Call strategy.UpdateModelWithImportedData(new[] { readModel }, sourceFilePath, targetCollection); // Assert Assert.AreSame(existingModel, targetCollection.First()); } - - private void NotifyProgress(string stepName, int stepNr, int totalNr) {} } } \ No newline at end of file