Index: Demo/Ringtoets/src/Demo.Ringtoets/Commands/AddNewDemoAssessmentSectionCommand.cs =================================================================== diff -u -r3014d0ced22c45300938639e7958ea0850485240 -r8c8285c58f677a2905127f1c3576eb7d6ea4206b --- Demo/Ringtoets/src/Demo.Ringtoets/Commands/AddNewDemoAssessmentSectionCommand.cs (.../AddNewDemoAssessmentSectionCommand.cs) (revision 3014d0ced22c45300938639e7958ea0850485240) +++ Demo/Ringtoets/src/Demo.Ringtoets/Commands/AddNewDemoAssessmentSectionCommand.cs (.../AddNewDemoAssessmentSectionCommand.cs) (revision 8c8285c58f677a2905127f1c3576eb7d6ea4206b) @@ -44,7 +44,7 @@ using Ringtoets.Integration.Data; using Ringtoets.Integration.Plugin.Handlers; using Ringtoets.Piping.Data; -using Ringtoets.Piping.IO.Importer; +using Ringtoets.Piping.IO.Importers; using Ringtoets.Piping.Plugin.FileImporter; using Ringtoets.StabilityPointStructures.Data; using Ringtoets.StabilityStoneCover.Data; Index: Ringtoets/Integration/test/Ringtoets.Integration.TestUtils/DataImportHelper.cs =================================================================== diff -u -r75c881f5a6ce68ef3fd30bcc15852d68b0bbe941 -r8c8285c58f677a2905127f1c3576eb7d6ea4206b --- Ringtoets/Integration/test/Ringtoets.Integration.TestUtils/DataImportHelper.cs (.../DataImportHelper.cs) (revision 75c881f5a6ce68ef3fd30bcc15852d68b0bbe941) +++ Ringtoets/Integration/test/Ringtoets.Integration.TestUtils/DataImportHelper.cs (.../DataImportHelper.cs) (revision 8c8285c58f677a2905127f1c3576eb7d6ea4206b) @@ -35,7 +35,7 @@ using Ringtoets.Integration.Data; using Ringtoets.Integration.Plugin.Handlers; using Ringtoets.Piping.Data; -using Ringtoets.Piping.IO.Importer; +using Ringtoets.Piping.IO.Importers; using Ringtoets.Piping.IO.TestUtil; using Ringtoets.Piping.Plugin.FileImporter; using Ringtoets.Piping.Primitives; Fisheye: Tag 8c8285c58f677a2905127f1c3576eb7d6ea4206b refers to a dead (removed) revision in file `Ringtoets/Piping/src/Ringtoets.Piping.IO/Importer/IStochasticSoilModelChangeHandler.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 8c8285c58f677a2905127f1c3576eb7d6ea4206b refers to a dead (removed) revision in file `Ringtoets/Piping/src/Ringtoets.Piping.IO/Importer/IStochasticSoilModelUpdateModelStrategy.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 8c8285c58f677a2905127f1c3576eb7d6ea4206b refers to a dead (removed) revision in file `Ringtoets/Piping/src/Ringtoets.Piping.IO/Importer/ISurfaceLineUpdateSurfaceLineStrategy.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 8c8285c58f677a2905127f1c3576eb7d6ea4206b refers to a dead (removed) revision in file `Ringtoets/Piping/src/Ringtoets.Piping.IO/Importer/StochasticSoilModelImporter.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 8c8285c58f677a2905127f1c3576eb7d6ea4206b refers to a dead (removed) revision in file `Ringtoets/Piping/src/Ringtoets.Piping.IO/Importer/StochasticSoilModelUpdateException.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/Piping/src/Ringtoets.Piping.IO/Importers/IStochasticSoilModelChangeHandler.cs =================================================================== diff -u --- Ringtoets/Piping/src/Ringtoets.Piping.IO/Importers/IStochasticSoilModelChangeHandler.cs (revision 0) +++ Ringtoets/Piping/src/Ringtoets.Piping.IO/Importers/IStochasticSoilModelChangeHandler.cs (revision 8c8285c58f677a2905127f1c3576eb7d6ea4206b) @@ -0,0 +1,45 @@ +// Copyright (C) Stichting Deltares 2016. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +namespace Ringtoets.Piping.IO.Importers +{ + /// + /// Interface for verifying and handling changes as an effect of a change to the stochastic + /// soil model collection. + /// + public interface IStochasticSoilModelChangeHandler + { + /// + /// Verifies whether the change to the stochastic soil model collections has side-effects; + /// and therefore a confirmation is required. + /// + /// true if confirmation is required, false otherwise. + bool RequireConfirmation(); + + /// + /// Inquires for a confirmation. + /// + /// true if confirmation is given; false otherwise. + /// Should only be called when returns true. + /// + bool InquireConfirmation(); + } +} \ No newline at end of file Index: Ringtoets/Piping/src/Ringtoets.Piping.IO/Importers/IStochasticSoilModelUpdateModelStrategy.cs =================================================================== diff -u --- Ringtoets/Piping/src/Ringtoets.Piping.IO/Importers/IStochasticSoilModelUpdateModelStrategy.cs (revision 0) +++ Ringtoets/Piping/src/Ringtoets.Piping.IO/Importers/IStochasticSoilModelUpdateModelStrategy.cs (revision 8c8285c58f677a2905127f1c3576eb7d6ea4206b) @@ -0,0 +1,52 @@ +// Copyright (C) Stichting Deltares 2016. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using System.Collections.Generic; +using Core.Common.Base; +using Ringtoets.Piping.Data; + +namespace Ringtoets.Piping.IO.Importers +{ + /// + /// Interface describing the method of updating the data model after new stochastic soil models + /// have been imported. + /// + public interface IStochasticSoilModelUpdateModelStrategy + { + /// + /// Adds the imported data to the . + /// + /// The to which the imported data + /// is added. + /// The stochastic soil models which were imported. + /// The path to the source file from which the soil models were imported. + /// Thrown when any parameter is null. + /// Thrown when applying the strategy failed. + /// is set with the more detailed + /// exception. + /// of updated instances. + IEnumerable UpdateModelWithImportedData( + ObservableCollectionWithSourcePath targetCollection, + IEnumerable readStochasticSoilModels, + string sourceFilePath); + } +} \ No newline at end of file Index: Ringtoets/Piping/src/Ringtoets.Piping.IO/Importers/ISurfaceLineUpdateSurfaceLineStrategy.cs =================================================================== diff -u --- Ringtoets/Piping/src/Ringtoets.Piping.IO/Importers/ISurfaceLineUpdateSurfaceLineStrategy.cs (revision 0) +++ Ringtoets/Piping/src/Ringtoets.Piping.IO/Importers/ISurfaceLineUpdateSurfaceLineStrategy.cs (revision 8c8285c58f677a2905127f1c3576eb7d6ea4206b) @@ -0,0 +1,49 @@ +// Copyright (C) Stichting Deltares 2016. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using System.Collections.Generic; +using Core.Common.Base; +using Ringtoets.Piping.Primitives; + +namespace Ringtoets.Piping.IO.Importers +{ + /// + /// Interface describing the method of updating the data model after new surface lines + /// have been imported. + /// + public interface ISurfaceLineUpdateSurfaceLineStrategy + { + /// + /// Adds the imported data to the . + /// + /// The + /// which needs to be updated. + /// The imported surface lines. + /// The source path from where the surface lines were imported from. + /// An of updated instances. + /// Thrown when any of the input parameters is null + IEnumerable UpdateSurfaceLinesWithImportedData( + ObservableCollectionWithSourcePath targetCollection, + IEnumerable readRingtoetsPipingSurfaceLines, + string sourceFilePath); + } +} Index: Ringtoets/Piping/src/Ringtoets.Piping.IO/Importers/StochasticSoilModelImporter.cs =================================================================== diff -u --- Ringtoets/Piping/src/Ringtoets.Piping.IO/Importers/StochasticSoilModelImporter.cs (revision 0) +++ Ringtoets/Piping/src/Ringtoets.Piping.IO/Importers/StochasticSoilModelImporter.cs (revision 8c8285c58f677a2905127f1c3576eb7d6ea4206b) @@ -0,0 +1,327 @@ +// Copyright (C) Stichting Deltares 2016. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using Core.Common.Base; +using Core.Common.Base.IO; +using Core.Common.IO.Exceptions; +using Core.Common.IO.Readers; +using log4net; +using Ringtoets.Piping.Data; +using Ringtoets.Piping.IO.Exceptions; +using Ringtoets.Piping.IO.Properties; +using Ringtoets.Piping.IO.SoilProfile; +using Ringtoets.Piping.Primitives; +using RingtoestCommonIOResources = Ringtoets.Common.IO.Properties.Resources; + +namespace Ringtoets.Piping.IO.Importers +{ + /// + /// Imports .soil files (SqlLite database files) created with the D-Soil Model application. + /// + public class StochasticSoilModelImporter : FileImporterBase> + { + private readonly ILog log = LogManager.GetLogger(typeof(StochasticSoilModelImporter)); + private readonly IStochasticSoilModelUpdateModelStrategy modelUpdateStrategy; + + /// + /// Initializes a new instance of the class. + /// + /// The collection to update. + /// The path to the file to import from. + /// The to use + /// when updating the . + /// Thrown when or + /// is null. + public StochasticSoilModelImporter(ObservableCollectionWithSourcePath importTarget, string filePath, IStochasticSoilModelUpdateModelStrategy modelUpdateStrategy) + : base(filePath, importTarget) + { + if (modelUpdateStrategy == null) + { + throw new ArgumentNullException(nameof(modelUpdateStrategy)); + } + this.modelUpdateStrategy = modelUpdateStrategy; + } + + protected override void DoPostImportUpdates() + { + foreach (IObservable observable in UpdatedInstances) + { + observable.NotifyObservers(); + } + } + + protected override bool OnImport() + { + ReadResult importSoilProfileResult = ReadSoilProfiles(); + if (importSoilProfileResult.CriticalErrorOccurred || Canceled) + { + return false; + } + + ReadResult importStochasticSoilModelResult = ReadStochasticSoilModels(); + if (importStochasticSoilModelResult.CriticalErrorOccurred || Canceled) + { + return false; + } + + AddSoilProfilesToStochasticSoilModels(importSoilProfileResult.ImportedItems, importStochasticSoilModelResult.ImportedItems); + MergeStochasticSoilProfiles(importStochasticSoilModelResult.ImportedItems); + CheckIfAllProfilesAreUsed(importSoilProfileResult.ImportedItems, importStochasticSoilModelResult.ImportedItems); + if (Canceled) + { + return false; + } + + UpdatedInstances = modelUpdateStrategy.UpdateModelWithImportedData(ImportTarget, GetValidStochasticSoilModels(importStochasticSoilModelResult), FilePath); + + return true; + } + + protected override void LogImportCanceledMessage() + { + log.Info(Resources.StochasticSoilModelImporter_Import_Import_canceled); + } + + private IEnumerable UpdatedInstances { get; set; } = Enumerable.Empty(); + + /// + /// Validate the definition of a . + /// + /// The to validate. + /// false when the stochastic soil model does not contain any stochastic soil profiles + /// or when a stochastic soil profile does not have a definition for a soil profile; true + /// otherwise. + private bool ValidateStochasticSoilModel(StochasticSoilModel stochasticSoilModel) + { + if (!stochasticSoilModel.StochasticSoilProfiles.Any()) + { + log.WarnFormat(Resources.StochasticSoilModelImporter_ValidateStochasticSoilModel_No_profiles_found_in_stochastic_soil_model_0, + stochasticSoilModel.Name); + return false; + } + if (stochasticSoilModel.StochasticSoilProfiles.Any(ssp => ssp.SoilProfile == null)) + { + log.WarnFormat(Resources.StochasticSoilModelImporter_ValidateStochasticSoilModel_SoilModel_0_with_stochastic_soil_profile_without_profile, + stochasticSoilModel.Name); + return false; + } + if (!IsSumOfAllProbabilitiesEqualToOne(stochasticSoilModel)) + { + log.WarnFormat(Resources.StochasticSoilModelImporter_ValidateStochasticSoilModel_Sum_of_probabilities_of_stochastic_soil_model_0_is_not_correct, + stochasticSoilModel.Name); + } + return true; + } + + private IEnumerable GetValidStochasticSoilModels(ReadResult importStochasticSoilModelResult) + { + var currentStep = 1; + StochasticSoilModel[] importedModels = importStochasticSoilModelResult.ImportedItems.ToArray(); + foreach (StochasticSoilModel importedModel in importedModels) + { + NotifyProgress(RingtoestCommonIOResources.Importer_ProgressText_Adding_imported_data_to_DataModel, currentStep, importedModels.Length); + if (ValidateStochasticSoilModel(importedModel)) + { + yield return importedModel; + } + currentStep++; + } + } + + private static bool IsSumOfAllProbabilitiesEqualToOne(StochasticSoilModel stochasticSoilModel) + { + double sumOfAllScenarioProbabilities = stochasticSoilModel.StochasticSoilProfiles + .Where(s => s.SoilProfile != null) + .Sum(s => s.Probability); + return Math.Abs(sumOfAllScenarioProbabilities - 1.0) < 1e-6; + } + + private void AddSoilProfilesToStochasticSoilModels(ICollection soilProfiles, ICollection stochasticSoilModels) + { + foreach (StochasticSoilModel stochasticSoilModel in stochasticSoilModels) + { + foreach (StochasticSoilProfile stochasticSoilProfile in stochasticSoilModel.StochasticSoilProfiles) + { + PipingSoilProfile soilProfile = soilProfiles.FirstOrDefault(s => s.SoilProfileType == stochasticSoilProfile.SoilProfileType && s.PipingSoilProfileId == stochasticSoilProfile.SoilProfileId); + if (soilProfile != null) + { + stochasticSoilProfile.SoilProfile = soilProfile; + } + } + } + } + + private void MergeStochasticSoilProfiles(ICollection stochasticSoilModels) + { + foreach (StochasticSoilModel stochasticSoilModel in stochasticSoilModels) + { + StochasticSoilProfile[] profiles = stochasticSoilModel.StochasticSoilProfiles.OrderBy(sp => sp.SoilProfileId).ToArray(); + for (var i = 1; i < profiles.Length; i++) + { + StochasticSoilProfile previousProfile = profiles[i - 1]; + StochasticSoilProfile currentProfile = profiles[i]; + if (currentProfile.SoilProfileId == previousProfile.SoilProfileId && + currentProfile.SoilProfileType == previousProfile.SoilProfileType) + { + log.Warn(string.Format(Resources.StochasticSoilModelImporter_MergeStochasticSoilProfiles_Multiple_SoilProfile_0_used_in_StochasticSoilModel_1_Probabilities_added_, + previousProfile.SoilProfile.Name, + stochasticSoilModel.Name)); + + previousProfile.AddProbability(currentProfile.Probability); + stochasticSoilModel.StochasticSoilProfiles.Remove(currentProfile); + } + } + } + } + + private void CheckIfAllProfilesAreUsed(ICollection soilProfiles, ICollection stochasticSoilModels) + { + NotifyProgress(Resources.StochasticSoilModelImporter_CheckIfAllProfilesAreUsed_Start_checking_soil_profiles, 1, 1); + foreach (PipingSoilProfile soilProfile in soilProfiles.Where(soilProfile => !PipingSoilProfileIsUsed(soilProfile, stochasticSoilModels))) + { + log.WarnFormat(Resources.StochasticSoilModelImporter_CheckIfAllProfilesAreUsed_SoilProfile_0_is_not_used_in_any_stochastic_soil_model, soilProfile.Name); + } + } + + private static bool PipingSoilProfileIsUsed(PipingSoilProfile soilProfile, ICollection stochasticSoilModels) + { + return stochasticSoilModels.Any( + stochasticSoilModel => stochasticSoilModel + .StochasticSoilProfiles + .Any(stochasticSoilProfile => ReferenceEquals(stochasticSoilProfile.SoilProfile, soilProfile))); + } + + private void HandleException(Exception e) + { + string message = string.Format(Resources.StochasticSoilModelImporter_CriticalErrorMessage_0_File_Skipped, + e.Message); + log.Error(message); + } + + #region read stochastic soil models + + private ReadResult ReadStochasticSoilModels() + { + NotifyProgress(Resources.StochasticSoilModelImporter_Reading_database, 1, 1); + try + { + using (var stochasticSoilModelReader = new StochasticSoilModelReader(FilePath)) + return GetStochasticSoilModelReadResult(stochasticSoilModelReader); + } + catch (CriticalFileReadException e) + { + HandleException(e); + } + return new ReadResult(true); + } + + private ReadResult GetStochasticSoilModelReadResult(StochasticSoilModelReader stochasticSoilModelReader) + { + int totalNumberOfSteps = stochasticSoilModelReader.PipingStochasticSoilModelCount; + var currentStep = 1; + + var soilModels = new Collection(); + while (stochasticSoilModelReader.HasNext) + { + if (Canceled) + { + return new ReadResult(false); + } + try + { + NotifyProgress(Resources.StochasticSoilModelImporter_GetStochasticSoilModelReadResult_Reading_stochastic_soil_models_from_database, currentStep++, totalNumberOfSteps); + soilModels.Add(stochasticSoilModelReader.ReadStochasticSoilModel()); + } + catch (StochasticSoilProfileReadException e) + { + string message = string.Format(Resources.StochasticSoilModelImporter_GetStochasticSoilModelReadResult_Error_0_stochastic_soil_model_skipped, e.Message); + log.Error(message); + } + } + return new ReadResult(false) + { + ImportedItems = soilModels + }; + } + + #endregion + + #region read soil profiles + + private ReadResult ReadSoilProfiles() + { + NotifyProgress(Resources.StochasticSoilModelImporter_Reading_database, 1, 1); + try + { + using (var soilProfileReader = new PipingSoilProfileReader(FilePath)) + return GetProfileReadResult(soilProfileReader); + } + catch (CriticalFileReadException e) + { + HandleException(e); + } + return new ReadResult(true); + } + + private ReadResult GetProfileReadResult(PipingSoilProfileReader soilProfileReader) + { + int totalNumberOfSteps = soilProfileReader.Count; + var currentStep = 1; + + var profiles = new Collection(); + while (soilProfileReader.HasNext) + { + if (Canceled) + { + return new ReadResult(false); + } + try + { + NotifyProgress(Resources.StochasticSoilModelImporter_ReadingSoilProfiles, currentStep++, totalNumberOfSteps); + profiles.Add(soilProfileReader.ReadProfile()); + } + catch (PipingSoilProfileReadException e) + { + string message = string.Format(Resources.StochasticSoilModelImporter_ReadSoilProfiles_ParseErrorMessage_0_SoilProfile_skipped, + e.Message); + log.Error(message); + } + catch (CriticalFileReadException e) + { + string message = string.Format(Resources.StochasticSoilModelImporter_CriticalErrorMessage_0_File_Skipped, + FilePath, e.Message); + log.Error(message); + return new ReadResult(true); + } + } + return new ReadResult(false) + { + ImportedItems = profiles + }; + } + + #endregion + } +} \ No newline at end of file Index: Ringtoets/Piping/src/Ringtoets.Piping.IO/Importers/StochasticSoilModelUpdateException.cs =================================================================== diff -u --- Ringtoets/Piping/src/Ringtoets.Piping.IO/Importers/StochasticSoilModelUpdateException.cs (revision 0) +++ Ringtoets/Piping/src/Ringtoets.Piping.IO/Importers/StochasticSoilModelUpdateException.cs (revision 8c8285c58f677a2905127f1c3576eb7d6ea4206b) @@ -0,0 +1,57 @@ +// Copyright (C) Stichting Deltares 2016. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using System.Runtime.Serialization; + +namespace Ringtoets.Piping.IO.Importers +{ + /// + /// The exception that is thrown when applying the stochastic soil model update strategy failed. + /// + [Serializable] + public class StochasticSoilModelUpdateException : Exception + { + /// + /// Initializes a new instance of the class. + /// + public StochasticSoilModelUpdateException() {} + + /// + /// Initializes a new instance of the class + /// with a specified error message. + /// + /// The error message that explains the reason for the exception. + public StochasticSoilModelUpdateException(string message) : base(message) {} + + /// + /// Initializes a new instance of the class + /// with a specified error message and a reference to the inner exception that is + /// the cause of this exception. + /// + /// The error message that explains the reason for the exception. + /// The exception that is the cause of the current exception, + /// or a null reference if no inner exception is specified. + public StochasticSoilModelUpdateException(string message, Exception inner) : base(message, inner) {} + + protected StochasticSoilModelUpdateException(SerializationInfo info, StreamingContext context) : base(info, context) { } + } +} \ No newline at end of file Index: Ringtoets/Piping/src/Ringtoets.Piping.IO/Ringtoets.Piping.IO.csproj =================================================================== diff -u -raa08f3d944eb8f045be344a6c062b1df32cb7cfa -r8c8285c58f677a2905127f1c3576eb7d6ea4206b --- Ringtoets/Piping/src/Ringtoets.Piping.IO/Ringtoets.Piping.IO.csproj (.../Ringtoets.Piping.IO.csproj) (revision aa08f3d944eb8f045be344a6c062b1df32cb7cfa) +++ Ringtoets/Piping/src/Ringtoets.Piping.IO/Ringtoets.Piping.IO.csproj (.../Ringtoets.Piping.IO.csproj) (revision 8c8285c58f677a2905127f1c3576eb7d6ea4206b) @@ -53,11 +53,11 @@ - - - - - + + + + + Index: Ringtoets/Piping/src/Ringtoets.Piping.Plugin/FileImporter/PipingSurfaceLinesCsvImporter.cs =================================================================== diff -u -r316e741c3eefe3aab13dd070b56654a6bc4c24f1 -r8c8285c58f677a2905127f1c3576eb7d6ea4206b --- Ringtoets/Piping/src/Ringtoets.Piping.Plugin/FileImporter/PipingSurfaceLinesCsvImporter.cs (.../PipingSurfaceLinesCsvImporter.cs) (revision 316e741c3eefe3aab13dd070b56654a6bc4c24f1) +++ Ringtoets/Piping/src/Ringtoets.Piping.Plugin/FileImporter/PipingSurfaceLinesCsvImporter.cs (.../PipingSurfaceLinesCsvImporter.cs) (revision 8c8285c58f677a2905127f1c3576eb7d6ea4206b) @@ -30,7 +30,7 @@ using Core.Common.IO.Readers; using log4net; using Ringtoets.Common.Data.AssessmentSection; -using Ringtoets.Piping.IO.Importer; +using Ringtoets.Piping.IO.Importers; using Ringtoets.Piping.IO.SurfaceLines; using Ringtoets.Piping.Plugin.Properties; using Ringtoets.Piping.Primitives; Index: Ringtoets/Piping/src/Ringtoets.Piping.Plugin/FileImporter/RingtoetsPipingSurfaceLineReplaceDataStrategy.cs =================================================================== diff -u -r316e741c3eefe3aab13dd070b56654a6bc4c24f1 -r8c8285c58f677a2905127f1c3576eb7d6ea4206b --- Ringtoets/Piping/src/Ringtoets.Piping.Plugin/FileImporter/RingtoetsPipingSurfaceLineReplaceDataStrategy.cs (.../RingtoetsPipingSurfaceLineReplaceDataStrategy.cs) (revision 316e741c3eefe3aab13dd070b56654a6bc4c24f1) +++ Ringtoets/Piping/src/Ringtoets.Piping.Plugin/FileImporter/RingtoetsPipingSurfaceLineReplaceDataStrategy.cs (.../RingtoetsPipingSurfaceLineReplaceDataStrategy.cs) (revision 8c8285c58f677a2905127f1c3576eb7d6ea4206b) @@ -22,7 +22,7 @@ using System; using System.Collections.Generic; using Core.Common.Base; -using Ringtoets.Piping.IO.Importer; +using Ringtoets.Piping.IO.Importers; using Ringtoets.Piping.Primitives; namespace Ringtoets.Piping.Plugin.FileImporter Index: Ringtoets/Piping/src/Ringtoets.Piping.Plugin/FileImporter/StochasticSoilModelChangeHandler.cs =================================================================== diff -u -r45440093089496f59ed420e772136756c229e30b -r8c8285c58f677a2905127f1c3576eb7d6ea4206b --- Ringtoets/Piping/src/Ringtoets.Piping.Plugin/FileImporter/StochasticSoilModelChangeHandler.cs (.../StochasticSoilModelChangeHandler.cs) (revision 45440093089496f59ed420e772136756c229e30b) +++ Ringtoets/Piping/src/Ringtoets.Piping.Plugin/FileImporter/StochasticSoilModelChangeHandler.cs (.../StochasticSoilModelChangeHandler.cs) (revision 8c8285c58f677a2905127f1c3576eb7d6ea4206b) @@ -24,7 +24,7 @@ using System.Linq; using Core.Common.Gui; using Ringtoets.Piping.Data; -using Ringtoets.Piping.IO.Importer; +using Ringtoets.Piping.IO.Importers; using Ringtoets.Piping.Plugin.Properties; namespace Ringtoets.Piping.Plugin.FileImporter Index: Ringtoets/Piping/src/Ringtoets.Piping.Plugin/FileImporter/StochasticSoilModelReplaceDataStrategy.cs =================================================================== diff -u -ra59b471e3b6a02319f91b7317b3814a099ef0221 -r8c8285c58f677a2905127f1c3576eb7d6ea4206b --- Ringtoets/Piping/src/Ringtoets.Piping.Plugin/FileImporter/StochasticSoilModelReplaceDataStrategy.cs (.../StochasticSoilModelReplaceDataStrategy.cs) (revision a59b471e3b6a02319f91b7317b3814a099ef0221) +++ Ringtoets/Piping/src/Ringtoets.Piping.Plugin/FileImporter/StochasticSoilModelReplaceDataStrategy.cs (.../StochasticSoilModelReplaceDataStrategy.cs) (revision 8c8285c58f677a2905127f1c3576eb7d6ea4206b) @@ -25,7 +25,7 @@ using Core.Common.Base; using log4net; using Ringtoets.Piping.Data; -using Ringtoets.Piping.IO.Importer; +using Ringtoets.Piping.IO.Importers; namespace Ringtoets.Piping.Plugin.FileImporter { Index: Ringtoets/Piping/src/Ringtoets.Piping.Plugin/FileImporter/StochasticSoilModelUpdateDataStrategy.cs =================================================================== diff -u -r34f1b5a53b9c554d1a0a35365da4f8d258117304 -r8c8285c58f677a2905127f1c3576eb7d6ea4206b --- Ringtoets/Piping/src/Ringtoets.Piping.Plugin/FileImporter/StochasticSoilModelUpdateDataStrategy.cs (.../StochasticSoilModelUpdateDataStrategy.cs) (revision 34f1b5a53b9c554d1a0a35365da4f8d258117304) +++ Ringtoets/Piping/src/Ringtoets.Piping.Plugin/FileImporter/StochasticSoilModelUpdateDataStrategy.cs (.../StochasticSoilModelUpdateDataStrategy.cs) (revision 8c8285c58f677a2905127f1c3576eb7d6ea4206b) @@ -25,7 +25,7 @@ using Core.Common.Base; using Core.Common.Utils; using Ringtoets.Piping.Data; -using Ringtoets.Piping.IO.Importer; +using Ringtoets.Piping.IO.Importers; using Ringtoets.Piping.Plugin.Properties; using Ringtoets.Piping.Primitives; using Ringtoets.Piping.Service; Index: Ringtoets/Piping/src/Ringtoets.Piping.Plugin/PipingPlugin.cs =================================================================== diff -u -r45440093089496f59ed420e772136756c229e30b -r8c8285c58f677a2905127f1c3576eb7d6ea4206b --- Ringtoets/Piping/src/Ringtoets.Piping.Plugin/PipingPlugin.cs (.../PipingPlugin.cs) (revision 45440093089496f59ed420e772136756c229e30b) +++ Ringtoets/Piping/src/Ringtoets.Piping.Plugin/PipingPlugin.cs (.../PipingPlugin.cs) (revision 8c8285c58f677a2905127f1c3576eb7d6ea4206b) @@ -47,7 +47,7 @@ using Ringtoets.Piping.Forms.PresentationObjects; using Ringtoets.Piping.Forms.PropertyClasses; using Ringtoets.Piping.Forms.Views; -using Ringtoets.Piping.IO.Importer; +using Ringtoets.Piping.IO.Importers; using Ringtoets.Piping.Plugin.FileImporter; using Ringtoets.Piping.Primitives; using Ringtoets.Piping.Service; Index: Ringtoets/Piping/test/Ringtoets.Piping.IO.Test/Importers/StochasticSoilModelImporterTest.cs =================================================================== diff -u --- Ringtoets/Piping/test/Ringtoets.Piping.IO.Test/Importers/StochasticSoilModelImporterTest.cs (revision 0) +++ Ringtoets/Piping/test/Ringtoets.Piping.IO.Test/Importers/StochasticSoilModelImporterTest.cs (revision 8c8285c58f677a2905127f1c3576eb7d6ea4206b) @@ -0,0 +1,903 @@ +// Copyright (C) Stichting Deltares 2016. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using Core.Common.Base; +using Core.Common.Base.IO; +using Core.Common.TestUtil; +using Core.Common.Utils.Builders; +using NUnit.Framework; +using Rhino.Mocks; +using Ringtoets.Piping.Data; +using Ringtoets.Piping.IO.Importers; +using Ringtoets.Piping.IO.TestUtil; +using Ringtoets.Piping.Primitives; + +namespace Ringtoets.Piping.IO.Test.Importers +{ + [TestFixture] + public class StochasticSoilModelImporterTest + { + private readonly string testDataPath = TestHelper.GetTestDataPath(TestDataPath.Ringtoets.Piping.IO, "PipingSoilProfilesReader"); + private int progress; + + [SetUp] + public void SetUp() + { + progress = 0; + } + + [Test] + public void Constructor_ObservableListNull_ThrowsArgumentNullException() + { + // Call + TestDelegate call = () => new StochasticSoilModelImporter( + null, + "", + new TestStochasticSoilModelUpdateModelStrategy()); + + // Assert + string paramName = Assert.Throws(call).ParamName; + Assert.AreEqual("importTarget", paramName); + } + + [Test] + public void Constructor_ModelUpdateStrategyNull_ThrowsArgumentNullException() + { + // Call + TestDelegate call = () => new StochasticSoilModelImporter( + new ObservableCollectionWithSourcePath(), + "", + null); + + // Assert + string paramName = Assert.Throws(call).ParamName; + Assert.AreEqual("modelUpdateStrategy", paramName); + } + + [Test] + public void Constructor_ExpectedValues() + { + var list = new ObservableCollectionWithSourcePath(); + + // Call + var importer = new StochasticSoilModelImporter( + list, + "", + new TestStochasticSoilModelUpdateModelStrategy()); + + // Assert + Assert.IsInstanceOf>>(importer); + } + + [Test] + public void Import_FromNonExistingFile_LogError() + { + // Setup + var file = "nonexisting.soil"; + string validFilePath = Path.Combine(testDataPath, file); + + var failureMechanism = new PipingFailureMechanism(); + var updateStrategy = new TestStochasticSoilModelUpdateModelStrategy(); + var importer = new StochasticSoilModelImporter( + failureMechanism.StochasticSoilModels, + validFilePath, + updateStrategy); + importer.SetProgressChanged(IncrementProgress); + + // Precondition + CollectionAssert.IsEmpty(failureMechanism.StochasticSoilModels); + + var importResult = true; + + // Call + Action call = () => importResult = importer.Import(); + + // Assert + TestHelper.AssertLogMessages(call, + messages => + { + string[] messageArray = messages.ToArray(); + string message = $"{string.Empty} \r\nHet bestand wordt overgeslagen."; + StringAssert.EndsWith(message, messageArray[0]); + }); + Assert.AreEqual(1, progress); + AssertUnsuccessfulImport(importResult, updateStrategy); + } + + [Test] + public void Import_FromInvalidFileName_LogError() + { + // Setup + var file = "/"; + string invalidFilePath = Path.Combine(testDataPath, file); + + var failureMechanism = new PipingFailureMechanism(); + var updateStrategy = new TestStochasticSoilModelUpdateModelStrategy(); + var importer = new StochasticSoilModelImporter( + failureMechanism.StochasticSoilModels, + invalidFilePath, + updateStrategy); + importer.SetProgressChanged(IncrementProgress); + + // Precondition + CollectionAssert.IsEmpty(failureMechanism.StochasticSoilModels); + + var importResult = true; + + // Call + Action call = () => importResult = importer.Import(); + + // Assert + TestHelper.AssertLogMessages(call, + messages => + { + string[] messageArray = messages.ToArray(); + string message = $"{string.Empty} \r\nHet bestand wordt overgeslagen."; + StringAssert.EndsWith(message, messageArray[0]); + }); + Assert.AreEqual(1, progress); + AssertUnsuccessfulImport(importResult, updateStrategy); + } + + [Test] + public void Import_ImportingToValidTargetWithValidFile_ImportSoilModelToCollectionAndSourcePathSet() + { + // Setup + string validFilePath = Path.Combine(testDataPath, "complete.soil"); + + var pipingFailureMechanism = new PipingFailureMechanism(); + + var progressChangeNotifications = new List(); + var updateStrategy = new TestStochasticSoilModelUpdateModelStrategy(); + var importer = new StochasticSoilModelImporter( + pipingFailureMechanism.StochasticSoilModels, + validFilePath, + updateStrategy); + importer.SetProgressChanged((description, step, steps) => + progressChangeNotifications.Add(new ProgressNotification(description, step, steps))); + + // Call + bool importResult = importer.Import(); + + // Assert + AssertSuccessfulImport(validFilePath, importResult, updateStrategy); + var expectedProfiles = 26; + var expectedModels = 3; + + var expectedProgressMessages = new List + { + new ProgressNotification("Inlezen van de D-Soil Model database.", 1, 1) + }; + for (var i = 1; i <= expectedProfiles; i++) + { + expectedProgressMessages.Add(new ProgressNotification("Inlezen van de ondergrondschematisatie uit de D-Soil Model database.", i, expectedProfiles)); + } + expectedProgressMessages.Add(new ProgressNotification("Inlezen van de D-Soil Model database.", 1, 1)); + for (var i = 1; i <= expectedModels; i++) + { + expectedProgressMessages.Add(new ProgressNotification("Inlezen van de stochastische ondergrondmodellen.", i, expectedModels)); + } + expectedProgressMessages.Add(new ProgressNotification("Controleren van ondergrondschematisaties.", 1, 1)); + for (var i = 1; i <= expectedModels; i++) + { + expectedProgressMessages.Add(new ProgressNotification("Geïmporteerde data toevoegen aan het toetsspoor.", i, expectedModels)); + } + Assert.AreEqual(expectedProgressMessages.Count, progressChangeNotifications.Count); + for (var i = 0; i < expectedProgressMessages.Count; i++) + { + ProgressNotification notification = expectedProgressMessages[i]; + ProgressNotification actualNotification = progressChangeNotifications[i]; + Assert.AreEqual(notification.Text, actualNotification.Text); + Assert.AreEqual(notification.CurrentStep, actualNotification.CurrentStep); + Assert.AreEqual(notification.TotalSteps, actualNotification.TotalSteps); + } + } + + [Test] + public void Import_ImportingToValidTargetWithValidFileTwice_ReadAnotherTime() + { + // Setup + string validFilePath = Path.Combine(testDataPath, "complete.soil"); + + var failureMechanism = new PipingFailureMechanism(); + var updateStrategy = new TestStochasticSoilModelUpdateModelStrategy(); + var importer = new StochasticSoilModelImporter( + failureMechanism.StochasticSoilModels, + validFilePath, + updateStrategy); + importer.SetProgressChanged(IncrementProgress); + + var importResult = false; + + // Precondition + importer.Import(); + IEnumerable alreadyImportedSoilModelNames = failureMechanism.StochasticSoilModels.Select(ssm => ssm.Name); + + // Call + Action call = () => importResult = importer.Import(); + + // Assert + string[] expectedLogMessages = alreadyImportedSoilModelNames + .Select(name => $"Het stochastische ondergrondmodel '{name}' bestaat al in het toetsspoor.") + .ToArray(); + TestHelper.AssertLogMessagesAreGenerated(call, expectedLogMessages, expectedLogMessages.Length); + Assert.AreEqual(35 * 2, progress); + + StochasticSoilModel[] readModels = AssertSuccessfulImport(validFilePath, importResult, updateStrategy); + Assert.AreEqual(3, readModels.Length); + } + + [Test] + public void Import_CancelOfImportWhenReadingSoilProfiles_CancelsImportAndLogs() + { + // Setup + string validFilePath = Path.Combine(testDataPath, "complete.soil"); + + var failureMechanism = new PipingFailureMechanism(); + var updateStrategy = new TestStochasticSoilModelUpdateModelStrategy(); + var importer = new StochasticSoilModelImporter( + failureMechanism.StochasticSoilModels, + validFilePath, + updateStrategy); + importer.SetProgressChanged((description, step, steps) => + { + if (description.Contains("Inlezen van de D-Soil Model database.")) + { + importer.Cancel(); + } + }); + + // Precondition + CollectionAssert.IsEmpty(failureMechanism.StochasticSoilModels); + Assert.IsTrue(File.Exists(validFilePath)); + + var importResult = true; + + // Call + Action call = () => importResult = importer.Import(); + + // Assert + TestHelper.AssertLogMessageIsGenerated(call, "Stochastische ondergrondmodellen importeren afgebroken. Geen data ingelezen.", 1); + AssertUnsuccessfulImport(importResult, updateStrategy); + } + + [Test] + public void Import_CancelOfImportWhenReadingStochasticSoilModels_CancelsImportAndLogs() + { + // Setup + string validFilePath = Path.Combine(testDataPath, "complete.soil"); + + var failureMechanism = new PipingFailureMechanism(); + var updateStrategy = new TestStochasticSoilModelUpdateModelStrategy(); + var importer = new StochasticSoilModelImporter( + failureMechanism.StochasticSoilModels, + validFilePath, + updateStrategy); + importer.SetProgressChanged((description, step, steps) => + { + if (description.Contains("Inlezen van de stochastische ondergrondmodellen.")) + { + importer.Cancel(); + } + }); + + // Precondition + CollectionAssert.IsEmpty(failureMechanism.StochasticSoilModels); + Assert.IsTrue(File.Exists(validFilePath)); + + var importResult = true; + + // Call + Action call = () => importResult = importer.Import(); + + // Assert + TestHelper.AssertLogMessageIsGenerated(call, "Stochastische ondergrondmodellen importeren afgebroken. Geen data ingelezen.", 1); + AssertUnsuccessfulImport(importResult, updateStrategy); + } + + [Test] + public void Import_CancelOfImportWhenAddingAndCheckingSoilProfiles_CancelsImportAndLogs() + { + // Setup + string validFilePath = Path.Combine(testDataPath, "complete.soil"); + + var failureMechanism = new PipingFailureMechanism(); + var updateStrategy = new TestStochasticSoilModelUpdateModelStrategy(); + var importer = new StochasticSoilModelImporter( + failureMechanism.StochasticSoilModels, + validFilePath, + updateStrategy); + importer.SetProgressChanged((description, step, steps) => + { + if (description.Contains("Controleren van ondergrondschematisaties.")) + { + importer.Cancel(); + } + }); + + // Precondition + CollectionAssert.IsEmpty(failureMechanism.StochasticSoilModels); + Assert.IsTrue(File.Exists(validFilePath)); + + var importResult = true; + + // Call + Action call = () => importResult = importer.Import(); + + // Assert + TestHelper.AssertLogMessageIsGenerated(call, "Stochastische ondergrondmodellen importeren afgebroken. Geen data ingelezen.", 1); + AssertUnsuccessfulImport(importResult, updateStrategy); + } + + [Test] + public void Import_CancelOfImportWhenAddingDataToModel_ImportCompletedSuccesfullyNonetheless() + { + // Setup + string validFilePath = Path.Combine(testDataPath, "complete.soil"); + + var failureMechanism = new PipingFailureMechanism(); + var updateStrategy = new TestStochasticSoilModelUpdateModelStrategy(); + var importer = new StochasticSoilModelImporter( + failureMechanism.StochasticSoilModels, + validFilePath, + updateStrategy); + importer.SetProgressChanged((description, step, steps) => + { + if (description.Contains("Geïmporteerde data toevoegen aan het toetsspoor.")) + { + importer.Cancel(); + } + }); + + // Precondition + CollectionAssert.IsEmpty(failureMechanism.StochasticSoilModels); + Assert.IsTrue(File.Exists(validFilePath)); + + var importResult = false; + + // Call + Action call = () => importResult = importer.Import(); + + // Assert + TestHelper.AssertLogMessageIsGenerated(call, "Huidige actie was niet meer te annuleren en is daarom voortgezet.", 1); + StochasticSoilModel[] readModels = AssertSuccessfulImport(validFilePath, importResult, updateStrategy); + Assert.AreEqual(3, readModels.Length); + } + + [Test] + public void Import_ReuseOfCanceledImportToValidTargetWithValidFile_ImportSoilModelToCollection() + { + // Setup + string validFilePath = Path.Combine(testDataPath, "complete.soil"); + + var failureMechanism = new PipingFailureMechanism(); + var updateStrategy = new TestStochasticSoilModelUpdateModelStrategy(); + var importer = new StochasticSoilModelImporter( + failureMechanism.StochasticSoilModels, + validFilePath, + updateStrategy); + importer.SetProgressChanged((description, step, steps) => importer.Cancel()); + + // Precondition + CollectionAssert.IsEmpty(failureMechanism.StochasticSoilModels); + Assert.IsTrue(File.Exists(validFilePath)); + + // Setup (second part) + bool importResult = importer.Import(); + Assert.IsFalse(importResult); + + importer.SetProgressChanged(null); + + // Call + importResult = importer.Import(); + + // Assert + StochasticSoilModel[] readModels = AssertSuccessfulImport(validFilePath, importResult, updateStrategy); + Assert.AreEqual(3, readModels.Length); + } + + [Test] + public void Import_ImportingToValidTargetWithProfileContainingInvalidAtX_SkipImportAndLog() + { + // Setup + string pathToCorruptFile = Path.Combine(testDataPath, "invalidAtX2dProperty.soil"); + + var failureMechanism = new PipingFailureMechanism(); + var updateStrategy = new TestStochasticSoilModelUpdateModelStrategy(); + var importer = new StochasticSoilModelImporter( + failureMechanism.StochasticSoilModels, + pathToCorruptFile, + updateStrategy); + importer.SetProgressChanged(IncrementProgress); + + var importResult = false; + + // Call + Action call = () => importResult = importer.Import(); + + // Assert + string internalErrorMessage = new FileReaderErrorMessageBuilder(pathToCorruptFile) + .WithSubject("ondergrondschematisatie 'Profile'") + .Build("Ondergrondschematisatie bevat geen geldige waarde in kolom \'IntersectionX\'."); + var expectedLogMessages = new[] + { + $"{internalErrorMessage} \r\nDeze ondergrondschematisatie wordt overgeslagen.", + "Het stochastische ondergrondmodel \'Name\' heeft een ongespecificeerde ondergrondschematisatie. Dit model wordt overgeslagen." + }; + TestHelper.AssertLogMessagesAreGenerated(call, expectedLogMessages, 2); + Assert.AreEqual(7, progress); + + StochasticSoilModel[] readModels = AssertSuccessfulImport(pathToCorruptFile, importResult, updateStrategy); + CollectionAssert.IsEmpty(readModels); + } + + [Test] + public void Import_ImportingToValidTargetWithProfileContainingInvalidParameterValue_ZeroForValue() + { + // Setup + string pathToCorruptFile = Path.Combine(testDataPath, "incorrectValue2dProperty.soil"); + + var failureMechanism = new PipingFailureMechanism(); + var updateStrategy = new TestStochasticSoilModelUpdateModelStrategy(); + var importer = new StochasticSoilModelImporter( + failureMechanism.StochasticSoilModels, + pathToCorruptFile, + updateStrategy); + importer.SetProgressChanged(IncrementProgress); + + // Call + bool importResult = importer.Import(); + + // Assert + StochasticSoilModel[] readModels = AssertSuccessfulImport(pathToCorruptFile, importResult, updateStrategy); + CollectionAssert.IsEmpty(readModels); + } + + [Test] + public void Import_IncorrectProfiles_SkipModelAndLog() + { + // Setup + string pathToCorruptFile = Path.Combine(testDataPath, "invalidStochasticSoilProfiles.soil"); + + var failureMechanism = new PipingFailureMechanism(); + var updateStrategy = new TestStochasticSoilModelUpdateModelStrategy(); + var importer = new StochasticSoilModelImporter( + failureMechanism.StochasticSoilModels, + pathToCorruptFile, + updateStrategy); + importer.SetProgressChanged(IncrementProgress); + + var importResult = false; + + // Call + Action call = () => importResult = importer.Import(); + + // Assert + string expectedLogMessage = + $"Fout bij het lezen van bestand '{pathToCorruptFile}': de ondergrondschematisatie verwijst naar een ongeldige waarde." + + " Dit stochastische ondergrondmodel wordt overgeslagen."; + TestHelper.AssertLogMessageIsGenerated(call, expectedLogMessage, 1); + + StochasticSoilModel[] readModels = AssertSuccessfulImport(pathToCorruptFile, importResult, updateStrategy); + CollectionAssert.IsEmpty(readModels); + } + + [Test] + public void Import_IncorrectProbability_LogAndImportSoilModelToCollection() + { + // Setup + string pathToCorruptFile = Path.Combine(testDataPath, "incorrectProbability.soil"); + + var failureMechanism = new PipingFailureMechanism(); + var updateStrategy = new TestStochasticSoilModelUpdateModelStrategy(); + var importer = new StochasticSoilModelImporter( + failureMechanism.StochasticSoilModels, + pathToCorruptFile, + updateStrategy); + importer.SetProgressChanged(IncrementProgress); + + var importResult = false; + + // Call + Action call = () => importResult = importer.Import(); + + // Assert + var expectedLogMessages = "De som van de kansen van voorkomen in het stochastich ondergrondmodel 'Name' is niet gelijk aan 100%."; + TestHelper.AssertLogMessageIsGenerated(call, expectedLogMessages, 1); + + StochasticSoilModel[] readModels = AssertSuccessfulImport(pathToCorruptFile, importResult, updateStrategy); + Assert.AreEqual(1, readModels.Length); + } + + [Test] + public void Import_TwoSoilModelsReusingSameProfile1D_ImportSoilModelsToCollection() + { + // Setup + string validFilePath = Path.Combine(testDataPath, "reusedSoilProfile1D.soil"); + + var pipingFailureMechanism = new PipingFailureMechanism(); + var updateStrategy = new TestStochasticSoilModelUpdateModelStrategy(); + var importer = new StochasticSoilModelImporter( + pipingFailureMechanism.StochasticSoilModels, + validFilePath, + updateStrategy); + + // Call + bool importResult = importer.Import(); + + // Assert + StochasticSoilModel[] readModels = AssertSuccessfulImport(validFilePath, importResult, updateStrategy); + + Assert.AreEqual(2, readModels.Length); + StochasticSoilModel model1 = readModels[0]; + StochasticSoilModel model2 = readModels[1]; + + Assert.AreEqual(1, model1.StochasticSoilProfiles.Count); + Assert.AreEqual(1, model2.StochasticSoilProfiles.Count); + + StochasticSoilProfile profile1 = model1.StochasticSoilProfiles[0]; + StochasticSoilProfile profile2 = model2.StochasticSoilProfiles[0]; + Assert.AreNotSame(profile1, profile2); + Assert.AreSame(profile1.SoilProfile, profile2.SoilProfile); + + Assert.AreEqual(SoilProfileType.SoilProfile1D, profile1.SoilProfileType, + "Expected database to have 1D profiles."); + Assert.AreEqual(SoilProfileType.SoilProfile1D, profile2.SoilProfileType, + "Expected database to have 1D profiles."); + } + + [Test] + public void Import_TwoSoilModelsReusingSameProfile2D_ImportSoilModelsToCollection() + { + // Setup + string validFilePath = Path.Combine(testDataPath, "reusedSoilProfile2D.soil"); + + var pipingFailureMechanism = new PipingFailureMechanism(); + var updateStrategy = new TestStochasticSoilModelUpdateModelStrategy(); + var importer = new StochasticSoilModelImporter( + pipingFailureMechanism.StochasticSoilModels, + validFilePath, + updateStrategy); + + // Call + bool importResult = importer.Import(); + + // Assert + StochasticSoilModel[] readModels = AssertSuccessfulImport(validFilePath, importResult, updateStrategy); + + Assert.AreEqual(2, readModels.Length); + StochasticSoilModel model1 = readModels[0]; + StochasticSoilModel model2 = readModels[1]; + + Assert.AreEqual(1, model1.StochasticSoilProfiles.Count); + Assert.AreEqual(1, model2.StochasticSoilProfiles.Count); + + StochasticSoilProfile profile1 = model1.StochasticSoilProfiles[0]; + StochasticSoilProfile profile2 = model2.StochasticSoilProfiles[0]; + Assert.AreNotSame(profile1, profile2); + Assert.AreSame(profile1.SoilProfile, profile2.SoilProfile); + + Assert.AreEqual(SoilProfileType.SoilProfile2D, profile1.SoilProfileType, + "Expected database to have 2D profiles."); + Assert.AreEqual(SoilProfileType.SoilProfile2D, profile2.SoilProfileType, + "Expected database to have 2D profiles."); + } + + [Test] + public void Import_ModelWithOneInvalidStochasticSoilProfileDueToMissingProfile_SkipModelAndLog() + { + // Setup + string validFilePath = Path.Combine(testDataPath, "EmptySoilModel.soil"); + + var failureMechanism = new PipingFailureMechanism(); + var updateStrategy = new TestStochasticSoilModelUpdateModelStrategy(); + var importer = new StochasticSoilModelImporter( + failureMechanism.StochasticSoilModels, + validFilePath, + updateStrategy); + + var importResult = false; + + // Call + Action call = () => importResult = importer.Import(); + + // Assert + string expectedLogMessage = "Er zijn geen ondergrondschematisaties gevonden in het stochastische " + + "ondergrondmodel 'Model'. Dit model wordt overgeslagen."; + TestHelper.AssertLogMessageIsGenerated(call, expectedLogMessage, 1); + + StochasticSoilModel[] readModels = AssertSuccessfulImport(validFilePath, importResult, updateStrategy); + CollectionAssert.IsEmpty(readModels); + } + + [Test] + public void Import_ModelWithTwoStochasticSoilProfileForSameProfile_ProbabilitiesAddedAndLog() + { + // Setup + string pathToFile = Path.Combine(testDataPath, "multipleStochasticSoilProfileForSameProfile.soil"); + + var failureMechanism = new PipingFailureMechanism(); + var updateStrategy = new TestStochasticSoilModelUpdateModelStrategy(); + var importer = new StochasticSoilModelImporter( + failureMechanism.StochasticSoilModels, + pathToFile, + updateStrategy); + importer.SetProgressChanged(IncrementProgress); + + var importResult = false; + + // Call + Action importAction = () => importResult = importer.Import(); + + // Assert + string expectedMessage = "Ondergrondschematisatie 'Profile' is meerdere keren gevonden in ondergrondmodel " + + "'StochasticSoilModelName'. Kansen van voorkomen worden opgeteld."; + TestHelper.AssertLogMessageIsGenerated(importAction, expectedMessage, 1); + + StochasticSoilModel[] readModels = AssertSuccessfulImport(pathToFile, importResult, updateStrategy); + Assert.AreEqual(1, readModels.Length); + StochasticSoilModel firstModel = readModels.First(); + Assert.AreEqual(1, firstModel.StochasticSoilProfiles.Count); + Assert.AreEqual(1.0, firstModel.StochasticSoilProfiles[0].Probability); + } + + [Test] + public void Import_ModelWithTwoStochasticSoilProfileForProfilesWithSameNameButDifferentTypes_ProbabilitiesNotAdded() + { + // Setup + string pathToFile = Path.Combine(testDataPath, "combined1d2d.soil"); + + var failureMechanism = new PipingFailureMechanism(); + var updateStrategy = new TestStochasticSoilModelUpdateModelStrategy(); + var importer = new StochasticSoilModelImporter( + failureMechanism.StochasticSoilModels, + pathToFile, + updateStrategy); + importer.SetProgressChanged(IncrementProgress); + + var importResult = false; + + // Call + Action importAction = () => importResult = importer.Import(); + + // Assert + TestHelper.AssertLogMessagesCount(importAction, 0); + StochasticSoilModel[] readModels = AssertSuccessfulImport(pathToFile, importResult, updateStrategy); + Assert.AreEqual(1, readModels.Length); + StochasticSoilModel firstModel = readModels.First(); + Assert.AreEqual(2, firstModel.StochasticSoilProfiles.Count); + Assert.AreEqual(firstModel.StochasticSoilProfiles[0].SoilProfile.Name, firstModel.StochasticSoilProfiles[1].SoilProfile.Name); + } + + [Test] + public void Import_ModelWithOneStochasticSoilProfile2DWithoutLayerPropertiesSet_ImportModelToCollection() + { + // Setup + string validFilePath = Path.Combine(testDataPath, "SingleSoilProfile2D_noLayerProperties.soil"); + + var failureMechanism = new PipingFailureMechanism(); + var updateStrategy = new TestStochasticSoilModelUpdateModelStrategy(); + var importer = new StochasticSoilModelImporter( + failureMechanism.StochasticSoilModels, + validFilePath, + updateStrategy); + importer.SetProgressChanged(IncrementProgress); + + // Precondition + CollectionAssert.IsEmpty(failureMechanism.StochasticSoilModels); + Assert.IsTrue(File.Exists(validFilePath)); + + // Call + bool importResult = importer.Import(); + + // Assert + StochasticSoilModel[] readModels = AssertSuccessfulImport(validFilePath, importResult, updateStrategy); + Assert.AreEqual(1, readModels.Length); + + StochasticSoilModel soilModel = readModels[0]; + Assert.AreEqual(1, soilModel.StochasticSoilProfiles.Count); + + StochasticSoilProfile stochasticProfile = soilModel.StochasticSoilProfiles[0]; + Assert.AreEqual(1.0, stochasticProfile.Probability); + Assert.AreEqual(SoilProfileType.SoilProfile2D, stochasticProfile.SoilProfileType); + + PipingSoilProfile profile = stochasticProfile.SoilProfile; + Assert.AreEqual("AD647M30_Segment_36005_1D1", profile.Name); + Assert.AreEqual(-45.0, profile.Bottom); + Assert.AreEqual(9, profile.Layers.Count()); + var expectedLayerTops = new[] + { + 4.8899864439741778, + 3.25, + 2.75, + 1.25, + 1.0, + -2.5, + -13.0, + -17.0, + -25.0 + }; + CollectionAssert.AreEqual(expectedLayerTops, profile.Layers.Select(l => l.Top)); + int expectedNumberOfLayers = expectedLayerTops.Length; + CollectionAssert.AreEqual(Enumerable.Repeat(false, expectedNumberOfLayers), + profile.Layers.Select(l => l.IsAquifer)); + CollectionAssert.AreEqual(Enumerable.Repeat(double.NaN, expectedNumberOfLayers), + profile.Layers.Select(l => l.BelowPhreaticLevelMean)); + + Assert.AreEqual(6, progress); + } + + [Test] + public void Import_ModelWithOneStochasticSoilProfile2DWithLayerPropertiesSet_ImportModelToCollection() + { + // Setup + string validFilePath = Path.Combine(testDataPath, "SingleSoilProfile2D_withLayerProperties.soil"); + + var failureMechanism = new PipingFailureMechanism(); + var updateStrategy = new TestStochasticSoilModelUpdateModelStrategy(); + var importer = new StochasticSoilModelImporter( + failureMechanism.StochasticSoilModels, + validFilePath, + updateStrategy); + importer.SetProgressChanged(IncrementProgress); + + // Precondition + CollectionAssert.IsEmpty(failureMechanism.StochasticSoilModels); + Assert.IsTrue(File.Exists(validFilePath)); + + // Call + bool importResult = importer.Import(); + + // Assert + StochasticSoilModel[] readModels = AssertSuccessfulImport(validFilePath, importResult, updateStrategy); + Assert.AreEqual(1, readModels.Length); + + StochasticSoilModel soilModel = readModels[0]; + Assert.AreEqual(1, soilModel.StochasticSoilProfiles.Count); + + StochasticSoilProfile stochasticProfile = soilModel.StochasticSoilProfiles[0]; + Assert.AreEqual(1.0, stochasticProfile.Probability); + Assert.AreEqual(SoilProfileType.SoilProfile2D, stochasticProfile.SoilProfileType); + + PipingSoilProfile profile = stochasticProfile.SoilProfile; + Assert.AreEqual("Test 2d profile", profile.Name); + Assert.AreEqual(-45.0, profile.Bottom); + const int expectedNumberOfLayers = 9; + Assert.AreEqual(expectedNumberOfLayers, profile.Layers.Count()); + var expectedLayerTops = new[] + { + 5.0571018353300463, + 3.25, + 2.75, + 1.25, + 1.0, + -2.5, + -13.0, + -17.0, + -25.0 + }; + var expectedIsAquiferValues = new[] + { + false, + false, + false, + true, + false, + false, + true, + false, + false + }; + CollectionAssert.AreEqual(expectedIsAquiferValues, + profile.Layers.Select(l => l.IsAquifer)); + CollectionAssert.AreEqual(expectedLayerTops, profile.Layers.Select(l => l.Top)); + var expectedBelowPhreaticLevelValues = new[] + { + 27.27, + 28.28, + 29.29, + 30.3, + 33.33, + 35.35, + 37.37, + 39.39, + 40.4 + }; + CollectionAssert.AreEqual(expectedBelowPhreaticLevelValues, + profile.Layers.Select(l => l.BelowPhreaticLevelMean)); + + Assert.AreEqual(6, progress); + } + + [Test] + public void DoPostImport_AfterImport_ObserversNotified() + { + // Setup + var mocks = new MockRepository(); + var observableA = mocks.StrictMock(); + observableA.Expect(o => o.NotifyObservers()); + var observableB = mocks.StrictMock(); + observableB.Expect(o => o.NotifyObservers()); + mocks.ReplayAll(); + + string validFilePath = Path.Combine(testDataPath, "complete.soil"); + var updateStrategy = new TestStochasticSoilModelUpdateModelStrategy(); + updateStrategy.UpdatedInstances = new[] + { + observableA, + observableB + }; + var importer = new StochasticSoilModelImporter( + new ObservableCollectionWithSourcePath(), + validFilePath, + updateStrategy); + importer.Import(); + + // Call + importer.DoPostImport(); + + // Assert + mocks.VerifyAll(); + } + + private static StochasticSoilModel[] AssertSuccessfulImport( + string expectedPath, + bool actualImportResult, + TestStochasticSoilModelUpdateModelStrategy updateStrategy) + { + Assert.IsTrue(actualImportResult); + Assert.IsTrue(updateStrategy.Updated); + Assert.AreEqual(expectedPath, updateStrategy.FilePath); + return updateStrategy.ReadModels; + } + + private static void AssertUnsuccessfulImport( + bool actualImportResult, + TestStochasticSoilModelUpdateModelStrategy updateStrategy) + { + Assert.IsFalse(updateStrategy.Updated); + Assert.IsFalse(actualImportResult); + } + + private void IncrementProgress(string a, int b, int c) + { + progress++; + } + + private class ProgressNotification + { + public ProgressNotification(string description, int currentStep, int totalSteps) + { + Text = description; + CurrentStep = currentStep; + TotalSteps = totalSteps; + } + + public string Text { get; } + public int CurrentStep { get; } + public int TotalSteps { get; } + } + } +} \ No newline at end of file Index: Ringtoets/Piping/test/Ringtoets.Piping.IO.Test/Importers/StochasticSoilModelUpdateExceptionTest.cs =================================================================== diff -u --- Ringtoets/Piping/test/Ringtoets.Piping.IO.Test/Importers/StochasticSoilModelUpdateExceptionTest.cs (revision 0) +++ Ringtoets/Piping/test/Ringtoets.Piping.IO.Test/Importers/StochasticSoilModelUpdateExceptionTest.cs (revision 8c8285c58f677a2905127f1c3576eb7d6ea4206b) @@ -0,0 +1,32 @@ +// Copyright (C) Stichting Deltares 2016. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Core.Common.TestUtil; +using NUnit.Framework; +using Ringtoets.Piping.IO.Importers; + +namespace Ringtoets.Piping.IO.Test.Importers +{ + [TestFixture] + public class StochasticSoilModelUpdateExceptionTest : + CustomExceptionDesignGuidelinesTestFixture {} +} \ No newline at end of file Index: Ringtoets/Piping/test/Ringtoets.Piping.IO.Test/Ringtoets.Piping.IO.Test.csproj =================================================================== diff -u -r182439744861ddb032d90ace9041f96d8ec5fe28 -r8c8285c58f677a2905127f1c3576eb7d6ea4206b --- Ringtoets/Piping/test/Ringtoets.Piping.IO.Test/Ringtoets.Piping.IO.Test.csproj (.../Ringtoets.Piping.IO.Test.csproj) (revision 182439744861ddb032d90ace9041f96d8ec5fe28) +++ Ringtoets/Piping/test/Ringtoets.Piping.IO.Test/Ringtoets.Piping.IO.Test.csproj (.../Ringtoets.Piping.IO.Test.csproj) (revision 8c8285c58f677a2905127f1c3576eb7d6ea4206b) @@ -73,12 +73,13 @@ + - + Fisheye: Tag 8c8285c58f677a2905127f1c3576eb7d6ea4206b refers to a dead (removed) revision in file `Ringtoets/Piping/test/Ringtoets.Piping.IO.Test/StochasticSoilModelImporterTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/Piping/test/Ringtoets.Piping.IO.TestUtil/TestStochasticSoilModelUpdateModelStrategy.cs =================================================================== diff -u -ra59b471e3b6a02319f91b7317b3814a099ef0221 -r8c8285c58f677a2905127f1c3576eb7d6ea4206b --- Ringtoets/Piping/test/Ringtoets.Piping.IO.TestUtil/TestStochasticSoilModelUpdateModelStrategy.cs (.../TestStochasticSoilModelUpdateModelStrategy.cs) (revision a59b471e3b6a02319f91b7317b3814a099ef0221) +++ Ringtoets/Piping/test/Ringtoets.Piping.IO.TestUtil/TestStochasticSoilModelUpdateModelStrategy.cs (.../TestStochasticSoilModelUpdateModelStrategy.cs) (revision 8c8285c58f677a2905127f1c3576eb7d6ea4206b) @@ -24,7 +24,7 @@ using System.Linq; using Core.Common.Base; using Ringtoets.Piping.Data; -using Ringtoets.Piping.IO.Importer; +using Ringtoets.Piping.IO.Importers; namespace Ringtoets.Piping.IO.TestUtil { Index: Ringtoets/Piping/test/Ringtoets.Piping.Integration.Test/ImportSoilProfileFromDatabaseTest.cs =================================================================== diff -u -r75c881f5a6ce68ef3fd30bcc15852d68b0bbe941 -r8c8285c58f677a2905127f1c3576eb7d6ea4206b --- Ringtoets/Piping/test/Ringtoets.Piping.Integration.Test/ImportSoilProfileFromDatabaseTest.cs (.../ImportSoilProfileFromDatabaseTest.cs) (revision 75c881f5a6ce68ef3fd30bcc15852d68b0bbe941) +++ Ringtoets/Piping/test/Ringtoets.Piping.Integration.Test/ImportSoilProfileFromDatabaseTest.cs (.../ImportSoilProfileFromDatabaseTest.cs) (revision 8c8285c58f677a2905127f1c3576eb7d6ea4206b) @@ -25,7 +25,7 @@ using Deltares.WTIPiping; using NUnit.Framework; using Ringtoets.Piping.Data; -using Ringtoets.Piping.IO.Importer; +using Ringtoets.Piping.IO.Importers; using Ringtoets.Piping.IO.TestUtil; using Ringtoets.Piping.KernelWrapper; using Ringtoets.Piping.Plugin.FileImporter; Index: Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/FileImporter/PipingSurfaceLinesCsvImporterTest.cs =================================================================== diff -u -r316e741c3eefe3aab13dd070b56654a6bc4c24f1 -r8c8285c58f677a2905127f1c3576eb7d6ea4206b --- Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/FileImporter/PipingSurfaceLinesCsvImporterTest.cs (.../PipingSurfaceLinesCsvImporterTest.cs) (revision 316e741c3eefe3aab13dd070b56654a6bc4c24f1) +++ Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/FileImporter/PipingSurfaceLinesCsvImporterTest.cs (.../PipingSurfaceLinesCsvImporterTest.cs) (revision 8c8285c58f677a2905127f1c3576eb7d6ea4206b) @@ -32,7 +32,7 @@ using NUnit.Framework; using Ringtoets.Common.Data.AssessmentSection; using Ringtoets.Piping.Data; -using Ringtoets.Piping.IO.Importer; +using Ringtoets.Piping.IO.Importers; using Ringtoets.Piping.Plugin.FileImporter; using Ringtoets.Piping.Primitives; using PipingIOResources = Ringtoets.Piping.IO.Properties.Resources; Index: Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/FileImporter/RingtoetsPipingSurfaceLineReplaceDataStrategyTest.cs =================================================================== diff -u -r9339e95abc9e858564aac8359766ea5152e72f6e -r8c8285c58f677a2905127f1c3576eb7d6ea4206b --- Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/FileImporter/RingtoetsPipingSurfaceLineReplaceDataStrategyTest.cs (.../RingtoetsPipingSurfaceLineReplaceDataStrategyTest.cs) (revision 9339e95abc9e858564aac8359766ea5152e72f6e) +++ Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/FileImporter/RingtoetsPipingSurfaceLineReplaceDataStrategyTest.cs (.../RingtoetsPipingSurfaceLineReplaceDataStrategyTest.cs) (revision 8c8285c58f677a2905127f1c3576eb7d6ea4206b) @@ -24,7 +24,7 @@ using System.Linq; using Core.Common.Base; using NUnit.Framework; -using Ringtoets.Piping.IO.Importer; +using Ringtoets.Piping.IO.Importers; using Ringtoets.Piping.Plugin.FileImporter; using Ringtoets.Piping.Primitives; Index: Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/FileImporter/StochasticSoilModelChangeHandlerTest.cs =================================================================== diff -u -r45440093089496f59ed420e772136756c229e30b -r8c8285c58f677a2905127f1c3576eb7d6ea4206b --- Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/FileImporter/StochasticSoilModelChangeHandlerTest.cs (.../StochasticSoilModelChangeHandlerTest.cs) (revision 45440093089496f59ed420e772136756c229e30b) +++ Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/FileImporter/StochasticSoilModelChangeHandlerTest.cs (.../StochasticSoilModelChangeHandlerTest.cs) (revision 8c8285c58f677a2905127f1c3576eb7d6ea4206b) @@ -25,7 +25,7 @@ using NUnit.Framework; using Rhino.Mocks; using Ringtoets.Piping.Data; -using Ringtoets.Piping.IO.Importer; +using Ringtoets.Piping.IO.Importers; using Ringtoets.Piping.KernelWrapper.TestUtil; using Ringtoets.Piping.Plugin.FileImporter; Index: Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/FileImporter/StochasticSoilModelUpdateDataStrategyTest.cs =================================================================== diff -u -ra59b471e3b6a02319f91b7317b3814a099ef0221 -r8c8285c58f677a2905127f1c3576eb7d6ea4206b --- Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/FileImporter/StochasticSoilModelUpdateDataStrategyTest.cs (.../StochasticSoilModelUpdateDataStrategyTest.cs) (revision a59b471e3b6a02319f91b7317b3814a099ef0221) +++ Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/FileImporter/StochasticSoilModelUpdateDataStrategyTest.cs (.../StochasticSoilModelUpdateDataStrategyTest.cs) (revision 8c8285c58f677a2905127f1c3576eb7d6ea4206b) @@ -26,7 +26,7 @@ using NUnit.Framework; using Ringtoets.Piping.Data; using Ringtoets.Piping.Data.TestUtil; -using Ringtoets.Piping.IO.Importer; +using Ringtoets.Piping.IO.Importers; using Ringtoets.Piping.KernelWrapper.TestUtil; using Ringtoets.Piping.Plugin.FileImporter; using Ringtoets.Piping.Primitives; Fisheye: Tag 8c8285c58f677a2905127f1c3576eb7d6ea4206b refers to a dead (removed) revision in file `Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/FileImporter/StochasticSoilModelUpdateExceptionTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/Ringtoets.Piping.Plugin.Test.csproj =================================================================== diff -u -ree74bbc714b9c3d6b46e7c7734640366ef197ef6 -r8c8285c58f677a2905127f1c3576eb7d6ea4206b --- Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/Ringtoets.Piping.Plugin.Test.csproj (.../Ringtoets.Piping.Plugin.Test.csproj) (revision ee74bbc714b9c3d6b46e7c7734640366ef197ef6) +++ Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/Ringtoets.Piping.Plugin.Test.csproj (.../Ringtoets.Piping.Plugin.Test.csproj) (revision 8c8285c58f677a2905127f1c3576eb7d6ea4206b) @@ -74,7 +74,6 @@ -