Index: Ringtoets/Common/src/Ringtoets.Common.IO/SoilProfile/StochasticSoilModelImporter.cs =================================================================== diff -u -r1df047ee4cb6680494a10a1f58ec16579bfd275f -r3946ee154a03eeb16a038378cae1796cda87e7f7 --- Ringtoets/Common/src/Ringtoets.Common.IO/SoilProfile/StochasticSoilModelImporter.cs (.../StochasticSoilModelImporter.cs) (revision 1df047ee4cb6680494a10a1f58ec16579bfd275f) +++ Ringtoets/Common/src/Ringtoets.Common.IO/SoilProfile/StochasticSoilModelImporter.cs (.../StochasticSoilModelImporter.cs) (revision 3946ee154a03eeb16a038378cae1796cda87e7f7) @@ -114,7 +114,7 @@ } catch (ImportedDataTransformException e) { - Log.ErrorFormat(e.Message, e); + Log.Error(e.Message, e); return false; } Index: Ringtoets/Common/src/Ringtoets.Common.IO/SoilProfile/StochasticSoilModelReader.cs =================================================================== diff -u -r1df047ee4cb6680494a10a1f58ec16579bfd275f -r3946ee154a03eeb16a038378cae1796cda87e7f7 --- Ringtoets/Common/src/Ringtoets.Common.IO/SoilProfile/StochasticSoilModelReader.cs (.../StochasticSoilModelReader.cs) (revision 1df047ee4cb6680494a10a1f58ec16579bfd275f) +++ Ringtoets/Common/src/Ringtoets.Common.IO/SoilProfile/StochasticSoilModelReader.cs (.../StochasticSoilModelReader.cs) (revision 3946ee154a03eeb16a038378cae1796cda87e7f7) @@ -227,6 +227,7 @@ /// The read failure mechanism type is not supported. /// /// + /// Thrown when the conversion is not supported. private void SetStochasticSoilProfiles(StochasticSoilModel stochasticSoilModel) { stochasticSoilModel.StochasticSoilProfiles.AddRange(ReadStochasticSoilProfiles()); @@ -236,6 +237,8 @@ /// Sets the geometry points of from the database. /// /// The stochastic soil model of which the geometry to set. + /// Thrown when the stochastic soil model id from the D-Soil model database + /// could not be convert. private void SetGeometry(StochasticSoilModel stochasticSoilModel) { if (!segmentPointReader.HasNext || segmentPointReader.ReadStochasticSoilModelId() != currentStochasticSoilModelId) @@ -256,7 +259,7 @@ /// The read failure mechanism type is not supported. /// /// - /// Thrown when the conversion is not supported. + /// Thrown when the conversion is not supported. private IEnumerable ReadStochasticSoilProfiles() { while (HasNext && ReadStochasticSoilModelId() == currentStochasticSoilModelId) @@ -290,7 +293,7 @@ /// The newly created . /// Thrown when the read failure mechanism /// type is not supported. - /// Thrown when the conversion is not supported. + /// Thrown when the conversion is not supported. private StochasticSoilModel CreateStochasticSoilModel() { return new StochasticSoilModel(ReadStochasticSoilModelName(), ReadFailureMechanismType()); @@ -377,7 +380,7 @@ /// The read value is not in an appropriate format. /// The read value represents a number that is less /// than or greater than . - /// Thrown when the conversion to + /// Thrown when the conversion to /// is not supported. private double? ReadStochasticSoilProfileProbability() { @@ -394,7 +397,7 @@ /// The read value is not in an appropriate format. /// The read value represents a number that is less /// than or greater than . - /// Thrown when the conversion to + /// Thrown when the conversion to /// is not supported. private long? ReadSoilProfile1DId() { @@ -411,7 +414,7 @@ /// The read value is not in an appropriate format. /// The read value represents a number that is less /// than or greater than . - /// Thrown when the conversion to + /// Thrown when the conversion to /// is not supported. private long? ReadSoilProfile2DId() { @@ -433,7 +436,7 @@ /// The read value is not in an appropriate format. /// The read value represents a number that is less /// than or greater than . - /// Thrown when the conversion to is not supported. + /// Thrown when the conversion to is not supported. private long ReadStochasticSoilModelId() { return Convert.ToInt64(dataReader[StochasticSoilModelTableDefinitions.StochasticSoilModelId]); @@ -454,7 +457,7 @@ /// /// The failure mechanism type. /// Thrown when the read failure mechanism type is not supported. - /// Thrown when the conversion to is not supported. + /// Thrown when the conversion to is not supported. private FailureMechanismType ReadFailureMechanismType() { long mechanismId = Convert.ToInt64(dataReader[MechanismTableDefinitions.MechanismId]); Index: Ringtoets/Common/test/Ringtoets.Common.IO.Test/SoilProfile/StochasticSoilModelImporterTest.cs =================================================================== diff -u -r1df047ee4cb6680494a10a1f58ec16579bfd275f -r3946ee154a03eeb16a038378cae1796cda87e7f7 --- Ringtoets/Common/test/Ringtoets.Common.IO.Test/SoilProfile/StochasticSoilModelImporterTest.cs (.../StochasticSoilModelImporterTest.cs) (revision 1df047ee4cb6680494a10a1f58ec16579bfd275f) +++ Ringtoets/Common/test/Ringtoets.Common.IO.Test/SoilProfile/StochasticSoilModelImporterTest.cs (.../StochasticSoilModelImporterTest.cs) (revision 3946ee154a03eeb16a038378cae1796cda87e7f7) @@ -26,7 +26,6 @@ using Core.Common.Base; using Core.Common.Base.IO; using Core.Common.TestUtil; -using Core.Common.Utils.Builders; using log4net.Core; using NUnit.Framework; using Rhino.Mocks; @@ -188,11 +187,11 @@ Assert.AreEqual(1, messages.Count()); Tuple expectedLog = messages.ElementAt(0); - string fileReadMessage = new FileReaderErrorMessageBuilder(validFilePath).Build("het bestand bestaat niet."); - Assert.AreEqual($"{fileReadMessage}", - expectedLog.Item1); Assert.AreEqual(Level.Error, expectedLog.Item2); - Assert.IsInstanceOf(expectedLog.Item3); + + Exception loggedException = expectedLog.Item3; + Assert.IsInstanceOf(loggedException); + Assert.AreEqual(loggedException.Message, expectedLog.Item1); }); Assert.AreEqual(1, progress); @@ -233,7 +232,10 @@ Tuple expectedLog = messages.ElementAt(0); Assert.AreEqual(Level.Error, expectedLog.Item2); - Assert.IsInstanceOf(expectedLog.Item3); + + Exception loggedException = expectedLog.Item3; + Assert.IsInstanceOf(loggedException); + Assert.AreEqual(loggedException.Message, expectedLog.Item1); }); Assert.AreEqual(1, progress); @@ -679,9 +681,17 @@ Action call = () => importResult = importer.Import(); // Assert - string expectedMessage = $"{exceptionMessage}"; - Tuple expectedLogMessageAndLevel = Tuple.Create(expectedMessage, LogLevelConstant.Error); - TestHelper.AssertLogMessageWithLevelIsGenerated(call, expectedLogMessageAndLevel, 1); + TestHelper.AssertLogMessagesWithLevelAndLoggedExceptions(call, messages => + { + Assert.AreEqual(1, messages.Count()); + Tuple expectedLog = messages.ElementAt(0); + + Assert.AreEqual(Level.Error, expectedLog.Item2); + + Exception loggedException = expectedLog.Item3; + Assert.IsInstanceOf(loggedException); + Assert.AreEqual(loggedException.Message, expectedLog.Item1); + }); Assert.IsFalse(importResult); } Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.IO/Properties/Resources.Designer.cs =================================================================== diff -u -r69d647795daacbf48e17d0cf3a02a21865ab4ae6 -r3946ee154a03eeb16a038378cae1796cda87e7f7 --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.IO/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 69d647795daacbf48e17d0cf3a02a21865ab4ae6) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.IO/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 3946ee154a03eeb16a038378cae1796cda87e7f7) @@ -461,16 +461,6 @@ } /// - /// Looks up a localized string similar to {0} - ///Het bestand wordt overgeslagen.. - /// - public static string StochasticSoilModelImporter_CriticalErrorMessage_0_File_Skipped { - get { - return ResourceManager.GetString("StochasticSoilModelImporter_CriticalErrorMessage_0_File_Skipped", resourceCulture); - } - } - - /// /// Looks up a localized string similar to {0} Dit stochastische ondergrondmodel wordt overgeslagen.. /// public static string StochasticSoilModelImporter_GetStochasticSoilModelReadResult_Error_0_stochastic_soil_model_skipped { Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.IO/Properties/Resources.resx =================================================================== diff -u -r69d647795daacbf48e17d0cf3a02a21865ab4ae6 -r3946ee154a03eeb16a038378cae1796cda87e7f7 --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.IO/Properties/Resources.resx (.../Resources.resx) (revision 69d647795daacbf48e17d0cf3a02a21865ab4ae6) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.IO/Properties/Resources.resx (.../Resources.resx) (revision 3946ee154a03eeb16a038378cae1796cda87e7f7) @@ -174,10 +174,6 @@ De uitgelezen ondergrondschematisatie '{0}' wordt niet gebruikt in een van de stochastische ondergrondmodellen. - - {0} -Het bestand wordt overgeslagen. - Inlezen van de D-Soil Model database.