Index: Riskeer/Storage/src/Riskeer.Storage.Core/Read/ClosingStructures/ClosingStructuresCalculationEntityReadExtensions.cs =================================================================== diff -u -rb572ae89a604505ce220a38dce4a6dd294707df9 -rf452ecd6491a8a6e3ddf32d913e1ce61316c3daf --- Riskeer/Storage/src/Riskeer.Storage.Core/Read/ClosingStructures/ClosingStructuresCalculationEntityReadExtensions.cs (.../ClosingStructuresCalculationEntityReadExtensions.cs) (revision b572ae89a604505ce220a38dce4a6dd294707df9) +++ Riskeer/Storage/src/Riskeer.Storage.Core/Read/ClosingStructures/ClosingStructuresCalculationEntityReadExtensions.cs (.../ClosingStructuresCalculationEntityReadExtensions.cs) (revision f452ecd6491a8a6e3ddf32d913e1ce61316c3daf) @@ -52,11 +52,6 @@ throw new ArgumentNullException(nameof(collector)); } - if (collector.Contains(entity)) - { - return collector.Get(entity); - } - var calculation = new StructuresCalculationScenario { Name = entity.Name, @@ -70,8 +65,6 @@ ReadInputParameters(calculation.InputParameters, entity, collector); ReadOutput(calculation, entity); - collector.Read(entity, calculation); - return calculation; } Index: Riskeer/Storage/src/Riskeer.Storage.Core/Read/GrassCoverErosionInwards/GrassCoverErosionInwardsCalculationEntityReadExtensions.cs =================================================================== diff -u -rb572ae89a604505ce220a38dce4a6dd294707df9 -rf452ecd6491a8a6e3ddf32d913e1ce61316c3daf --- Riskeer/Storage/src/Riskeer.Storage.Core/Read/GrassCoverErosionInwards/GrassCoverErosionInwardsCalculationEntityReadExtensions.cs (.../GrassCoverErosionInwardsCalculationEntityReadExtensions.cs) (revision b572ae89a604505ce220a38dce4a6dd294707df9) +++ Riskeer/Storage/src/Riskeer.Storage.Core/Read/GrassCoverErosionInwards/GrassCoverErosionInwardsCalculationEntityReadExtensions.cs (.../GrassCoverErosionInwardsCalculationEntityReadExtensions.cs) (revision f452ecd6491a8a6e3ddf32d913e1ce61316c3daf) @@ -51,11 +51,6 @@ throw new ArgumentNullException(nameof(collector)); } - if (collector.Contains(entity)) - { - return collector.Get(entity); - } - var calculation = new GrassCoverErosionInwardsCalculationScenario { Name = entity.Name, @@ -69,8 +64,6 @@ ReadInput(calculation.InputParameters, entity, collector); ReadOutput(calculation, entity); - collector.Read(entity, calculation); - return calculation; } Index: Riskeer/Storage/src/Riskeer.Storage.Core/Read/ReadConversionCollector.cs =================================================================== diff -u -r76b0a3aadce3810c6c6d917957466f439464212d -rf452ecd6491a8a6e3ddf32d913e1ce61316c3daf --- Riskeer/Storage/src/Riskeer.Storage.Core/Read/ReadConversionCollector.cs (.../ReadConversionCollector.cs) (revision 76b0a3aadce3810c6c6d917957466f439464212d) +++ Riskeer/Storage/src/Riskeer.Storage.Core/Read/ReadConversionCollector.cs (.../ReadConversionCollector.cs) (revision f452ecd6491a8a6e3ddf32d913e1ce61316c3daf) @@ -28,7 +28,6 @@ using Riskeer.Common.Data.Hydraulics; using Riskeer.Common.Data.Structures; using Riskeer.DuneErosion.Data; -using Riskeer.GrassCoverErosionInwards.Data; using Riskeer.HeightStructures.Data; using Riskeer.MacroStabilityInwards.Data.SoilProfile; using Riskeer.MacroStabilityInwards.Primitives; @@ -87,9 +86,6 @@ private readonly Dictionary foreshoreProfiles = CreateDictionary(); - private readonly Dictionary grassCoverErosionInwardsCalculations = - CreateDictionary(); - private readonly Dictionary heightStructures = CreateDictionary(); @@ -102,9 +98,6 @@ private readonly Dictionary> heightStructuresCalculations = CreateDictionary>(); - private readonly Dictionary> closingStructuresCalculations = - CreateDictionary>(); - private readonly Dictionary> stabilityPointStructuresCalculations = CreateDictionary>(); @@ -1097,80 +1090,6 @@ #endregion - #region GrassCoverErosionInwardsCalculationEntity: Read, Contains, Get - - /// - /// Registers a read operation for - /// and the that was constructed - /// with the information. - /// - /// The - /// that was read. - /// The that - /// was constructed. - /// Thrown when any of the input parameters is null. - internal void Read(GrassCoverErosionInwardsCalculationEntity entity, GrassCoverErosionInwardsCalculationScenario model) - { - if (entity == null) - { - throw new ArgumentNullException(nameof(entity)); - } - - if (model == null) - { - throw new ArgumentNullException(nameof(model)); - } - - grassCoverErosionInwardsCalculations[entity] = model; - } - - /// - /// Checks whether a read operation has been registered for a given . - /// - /// The to check for. - /// true if the was read before, false otherwise. - /// Thrown when is null. - internal bool Contains(GrassCoverErosionInwardsCalculationEntity entity) - { - if (entity == null) - { - throw new ArgumentNullException(nameof(entity)); - } - - return grassCoverErosionInwardsCalculations.ContainsKey(entity); - } - - /// - /// Obtains the which was read - /// for the given . - /// - /// The for which a read - /// operation has been registered. - /// The constructed . - /// Thrown when is null. - /// Thrown when no read operation has - /// been registered for . - /// Use - /// to find out whether a read operation has been registered for . - internal GrassCoverErosionInwardsCalculationScenario Get(GrassCoverErosionInwardsCalculationEntity entity) - { - if (entity == null) - { - throw new ArgumentNullException(nameof(entity)); - } - - try - { - return grassCoverErosionInwardsCalculations[entity]; - } - catch (KeyNotFoundException e) - { - throw new InvalidOperationException(e.Message, e); - } - } - - #endregion - #region HeightStructureEntity: Read, Contains, Get /// @@ -1387,80 +1306,6 @@ #endregion - #region ClosingStructuresCalculationEntity: Read, Contains, Get - - /// - /// Registers a read operation for - /// and the that was constructed - /// with the information. - /// - /// The - /// that was read. - /// The that - /// was constructed. - /// Thrown when any input parameter is null. - internal void Read(ClosingStructuresCalculationEntity entity, StructuresCalculationScenario model) - { - if (entity == null) - { - throw new ArgumentNullException(nameof(entity)); - } - - if (model == null) - { - throw new ArgumentNullException(nameof(model)); - } - - closingStructuresCalculations[entity] = model; - } - - /// - /// Checks whether a read operation has been registered for a given . - /// - /// The to check for. - /// true if the was read before, false otherwise. - /// Thrown when is null. - internal bool Contains(ClosingStructuresCalculationEntity entity) - { - if (entity == null) - { - throw new ArgumentNullException(nameof(entity)); - } - - return closingStructuresCalculations.ContainsKey(entity); - } - - /// - /// Obtains the which was read - /// for the given . - /// - /// The for which a read - /// operation has been registered. - /// The constructed . - /// Thrown when is null. - /// Thrown when no read operation has - /// been registered for . - /// Use - /// to find out whether a read operation has been registered for . - internal StructuresCalculationScenario Get(ClosingStructuresCalculationEntity entity) - { - if (entity == null) - { - throw new ArgumentNullException(nameof(entity)); - } - - try - { - return closingStructuresCalculations[entity]; - } - catch (KeyNotFoundException e) - { - throw new InvalidOperationException(e.Message, e); - } - } - - #endregion - #region StabilityPointStructureEntity: Read, Contains, Get /// Index: Riskeer/Storage/test/Riskeer.Storage.Core.Test/Read/ClosingStructures/ClosingStructuresCalculationEntityReadExtensionsTest.cs =================================================================== diff -u -rb572ae89a604505ce220a38dce4a6dd294707df9 -rf452ecd6491a8a6e3ddf32d913e1ce61316c3daf --- Riskeer/Storage/test/Riskeer.Storage.Core.Test/Read/ClosingStructures/ClosingStructuresCalculationEntityReadExtensionsTest.cs (.../ClosingStructuresCalculationEntityReadExtensionsTest.cs) (revision b572ae89a604505ce220a38dce4a6dd294707df9) +++ Riskeer/Storage/test/Riskeer.Storage.Core.Test/Read/ClosingStructures/ClosingStructuresCalculationEntityReadExtensionsTest.cs (.../ClosingStructuresCalculationEntityReadExtensionsTest.cs) (revision f452ecd6491a8a6e3ddf32d913e1ce61316c3daf) @@ -50,28 +50,6 @@ Assert.AreEqual("collector", paramName); } - [Test] - public void Read_EntityNotReadBefore_RegisterEntity() - { - // Setup - var entity = new ClosingStructuresCalculationEntity - { - IdenticalApertures = 1 - }; - - var collector = new ReadConversionCollector(); - - // Precondition - Assert.IsFalse(collector.Contains(entity)); - - // Call - StructuresCalculationScenario calculation = entity.Read(collector); - - // Assert - Assert.IsTrue(collector.Contains(entity)); - Assert.AreSame(calculation, collector.Get(entity)); - } - [Test] public void Read_ValidEntity_ReturnClosingStructuresCalculation() { @@ -329,29 +307,5 @@ Assert.IsNaN(calculationOutput.Reliability); Assert.IsFalse(calculationOutput.HasGeneralResult); } - - [Test] - public void Read_CalculationEntityAlreadyRead_ReturnReadCalculation() - { - // Setup - var entity = new ClosingStructuresCalculationEntity - { - ClosingStructuresOutputEntities = - { - new ClosingStructuresOutputEntity() - } - }; - - var calculation = new StructuresCalculationScenario(); - - var collector = new ReadConversionCollector(); - collector.Read(entity, calculation); - - // Call - StructuresCalculation returnedCalculation = entity.Read(collector); - - // Assert - Assert.AreSame(calculation, returnedCalculation); - } } } \ No newline at end of file Index: Riskeer/Storage/test/Riskeer.Storage.Core.Test/Read/GrassCoverErosionInwards/GrassCoverErosionInwardsCalculationEntityReadExtensionsTest.cs =================================================================== diff -u -r9793bc3048c48b4c25bcde1d0c07d6d02b53b2ff -rf452ecd6491a8a6e3ddf32d913e1ce61316c3daf --- Riskeer/Storage/test/Riskeer.Storage.Core.Test/Read/GrassCoverErosionInwards/GrassCoverErosionInwardsCalculationEntityReadExtensionsTest.cs (.../GrassCoverErosionInwardsCalculationEntityReadExtensionsTest.cs) (revision 9793bc3048c48b4c25bcde1d0c07d6d02b53b2ff) +++ Riskeer/Storage/test/Riskeer.Storage.Core.Test/Read/GrassCoverErosionInwards/GrassCoverErosionInwardsCalculationEntityReadExtensionsTest.cs (.../GrassCoverErosionInwardsCalculationEntityReadExtensionsTest.cs) (revision f452ecd6491a8a6e3ddf32d913e1ce61316c3daf) @@ -118,25 +118,6 @@ } [Test] - public void Read_EntityNotReadBefore_RegisterEntity() - { - // Setup - var entity = new GrassCoverErosionInwardsCalculationEntity(); - - var collector = new ReadConversionCollector(); - - // Precondition - Assert.IsFalse(collector.Contains(entity)); - - // Call - GrassCoverErosionInwardsCalculation calculation = entity.Read(collector); - - // Assert - Assert.IsTrue(collector.Contains(entity)); - Assert.AreSame(calculation, collector.Get(entity)); - } - - [Test] public void Read_EntityWithNullValues_ReturnCalculationWithNaNOrNull() { // Setup @@ -280,30 +261,6 @@ Assert.IsTrue(calculation.HasOutput); } - [Test] - public void Read_CalculationEntityAlreadyRead_ReturnReadCalculation() - { - // Setup - var entity = new GrassCoverErosionInwardsCalculationEntity - { - GrassCoverErosionInwardsOutputEntities = - { - new GrassCoverErosionInwardsOutputEntity() - } - }; - - var calculation = new GrassCoverErosionInwardsCalculationScenario(); - - var collector = new ReadConversionCollector(); - collector.Read(entity, calculation); - - // Call - GrassCoverErosionInwardsCalculation returnedCalculation = entity.Read(collector); - - // Assert - Assert.AreSame(calculation, returnedCalculation); - } - private static void AssertBoolean(byte expectedByte, bool actual) { Assert.AreEqual(Convert.ToBoolean(expectedByte), actual); Index: Riskeer/Storage/test/Riskeer.Storage.Core.Test/Read/ReadConversionCollectorTest.cs =================================================================== diff -u -r76b0a3aadce3810c6c6d917957466f439464212d -rf452ecd6491a8a6e3ddf32d913e1ce61316c3daf --- Riskeer/Storage/test/Riskeer.Storage.Core.Test/Read/ReadConversionCollectorTest.cs (.../ReadConversionCollectorTest.cs) (revision 76b0a3aadce3810c6c6d917957466f439464212d) +++ Riskeer/Storage/test/Riskeer.Storage.Core.Test/Read/ReadConversionCollectorTest.cs (.../ReadConversionCollectorTest.cs) (revision f452ecd6491a8a6e3ddf32d913e1ce61316c3daf) @@ -24,16 +24,13 @@ using System.Linq; using Core.Common.Base.Geometry; using NUnit.Framework; -using Riskeer.ClosingStructures.Data; -using Riskeer.ClosingStructures.Data.TestUtil; using Riskeer.Common.Data.DikeProfiles; using Riskeer.Common.Data.FailureMechanism; using Riskeer.Common.Data.Hydraulics; using Riskeer.Common.Data.Structures; using Riskeer.Common.Data.TestUtil; using Riskeer.DuneErosion.Data; using Riskeer.DuneErosion.Data.TestUtil; -using Riskeer.GrassCoverErosionInwards.Data; using Riskeer.HeightStructures.Data; using Riskeer.HeightStructures.Data.TestUtil; using Riskeer.MacroStabilityInwards.Data.SoilProfile; @@ -337,25 +334,6 @@ } } - #region GrassCoverErosionInwards - - [TestFixture] - private class GrassCoverErosionInwardsCalculationCollectorTest : CollectorTest - { - public GrassCoverErosionInwardsCalculationCollectorTest() : base( - (c, e, m) => c.Read(e, m), - (c, e) => c.Contains(e), - (c, e) => c.Get(e)) {} - - protected override GrassCoverErosionInwardsCalculationScenario CreateDataModel() - { - return new GrassCoverErosionInwardsCalculationScenario(); - } - } - - #endregion - #region HeightStructure [TestFixture] @@ -389,39 +367,6 @@ #endregion - #region ClosingStructure - - [TestFixture] - private class ClosingStructureCollectorTest : CollectorTest - { - public ClosingStructureCollectorTest() : base( - (c, e, m) => c.Read(e, m), - (c, e) => c.Contains(e), - (c, e) => c.Get(e)) {} - - protected override ClosingStructure CreateDataModel() - { - return new TestClosingStructure(); - } - } - - [TestFixture] - private class ClosingStructureCalculationCollectorTest : CollectorTest, - ClosingStructuresCalculationEntity> - { - public ClosingStructureCalculationCollectorTest() : base( - (c, e, m) => c.Read(e, m), - (c, e) => c.Contains(e), - (c, e) => c.Get(e)) {} - - protected override StructuresCalculationScenario CreateDataModel() - { - return new StructuresCalculationScenario(); - } - } - - #endregion - #region StabilityPointStructure [TestFixture]