Index: Riskeer/Storage/src/Riskeer.Storage.Core/Create/GrassCoverErosionOutwards/GrassCoverErosionOutwardsFailureMechanismCreateExtensions.cs =================================================================== diff -u -rdfd2e82406d3cafb83004a065b3ea1f943ced729 -r034eb23a81ab16ac89cf642d0aefab0f25112822 --- Riskeer/Storage/src/Riskeer.Storage.Core/Create/GrassCoverErosionOutwards/GrassCoverErosionOutwardsFailureMechanismCreateExtensions.cs (.../GrassCoverErosionOutwardsFailureMechanismCreateExtensions.cs) (revision dfd2e82406d3cafb83004a065b3ea1f943ced729) +++ Riskeer/Storage/src/Riskeer.Storage.Core/Create/GrassCoverErosionOutwards/GrassCoverErosionOutwardsFailureMechanismCreateExtensions.cs (.../GrassCoverErosionOutwardsFailureMechanismCreateExtensions.cs) (revision 034eb23a81ab16ac89cf642d0aefab0f25112822) @@ -57,7 +57,8 @@ var metaEntity = new GrassCoverErosionOutwardsFailureMechanismMetaEntity { ForeshoreProfileCollectionSourcePath = failureMechanism.ForeshoreProfiles.SourcePath.DeepClone(), - N = failureMechanism.GeneralInput.N + N = failureMechanism.GeneralInput.N, + ApplyLengthEffectInSection = Convert.ToByte(failureMechanism.GeneralInput.ApplyLengthEffectInSection) }; entity.GrassCoverErosionOutwardsFailureMechanismMetaEntities.Add(metaEntity); Fisheye: Tag 034eb23a81ab16ac89cf642d0aefab0f25112822 refers to a dead (removed) revision in file `Riskeer/Storage/src/Riskeer.Storage.Core/Read/GrassCoverErosionOutwards/GrassCoverErosionInwardsFailureMechanismMetaEntityReadExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Riskeer/Storage/src/Riskeer.Storage.Core/Read/GrassCoverErosionOutwards/GrassCoverErosionOutwardsFailureMechanismMetaEntityReadExtensions.cs =================================================================== diff -u --- Riskeer/Storage/src/Riskeer.Storage.Core/Read/GrassCoverErosionOutwards/GrassCoverErosionOutwardsFailureMechanismMetaEntityReadExtensions.cs (revision 0) +++ Riskeer/Storage/src/Riskeer.Storage.Core/Read/GrassCoverErosionOutwards/GrassCoverErosionOutwardsFailureMechanismMetaEntityReadExtensions.cs (revision 034eb23a81ab16ac89cf642d0aefab0f25112822) @@ -0,0 +1,59 @@ +// Copyright (C) Stichting Deltares 2021. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer 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.Base.Data; +using Riskeer.GrassCoverErosionOutwards.Data; +using Riskeer.Storage.Core.DbContext; + +namespace Riskeer.Storage.Core.Read.GrassCoverErosionOutwards +{ + /// + /// This class defines extension methods for read operations for a + /// based on the . + /// + internal static class GrassCoverErosionOutwardsFailureMechanismMetaEntityReadExtensions + { + /// + /// Read the and use the information + /// to update the . + /// + /// The to use + /// to update the . + /// The to be updated. + /// Thrown when any input parameter is null. + internal static void Read(this GrassCoverErosionOutwardsFailureMechanismMetaEntity entity, GeneralGrassCoverErosionOutwardsInput input) + { + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + if (input == null) + { + throw new ArgumentNullException(nameof(input)); + } + + input.N = (RoundedDouble) entity.N; + input.ApplyLengthEffectInSection = Convert.ToBoolean(entity.ApplyLengthEffectInSection); + } + } +} \ No newline at end of file Index: Riskeer/Storage/test/Riskeer.Storage.Core.Test/Create/GrassCoverErosionOutwards/GrassCoverErosionOutwardsFailureMechanismCreateExtensionsTest.cs =================================================================== diff -u -r37329c0792c0630f19b54d90d3abf5c6df849119 -r034eb23a81ab16ac89cf642d0aefab0f25112822 --- Riskeer/Storage/test/Riskeer.Storage.Core.Test/Create/GrassCoverErosionOutwards/GrassCoverErosionOutwardsFailureMechanismCreateExtensionsTest.cs (.../GrassCoverErosionOutwardsFailureMechanismCreateExtensionsTest.cs) (revision 37329c0792c0630f19b54d90d3abf5c6df849119) +++ Riskeer/Storage/test/Riskeer.Storage.Core.Test/Create/GrassCoverErosionOutwards/GrassCoverErosionOutwardsFailureMechanismCreateExtensionsTest.cs (.../GrassCoverErosionOutwardsFailureMechanismCreateExtensionsTest.cs) (revision 034eb23a81ab16ac89cf642d0aefab0f25112822) @@ -55,6 +55,7 @@ public void Create_WithCollectorAndPropertiesSet_ReturnsFailureMechanismEntityWithPropertiesSet(bool inAssembly) { // Setup + var random = new Random(); var failureMechanism = new GrassCoverErosionOutwardsFailureMechanism { InAssembly = inAssembly, @@ -76,7 +77,8 @@ }, GeneralInput = { - N = new Random(39).NextRoundedDouble(1, 20) + N = random.NextRoundedDouble(1, 20), + ApplyLengthEffectInSection = random.NextBoolean() } }; var registry = new PersistenceRegistry(); @@ -96,6 +98,7 @@ Assert.AreEqual(1, entity.GrassCoverErosionOutwardsFailureMechanismMetaEntities.Count); GrassCoverErosionOutwardsFailureMechanismMetaEntity generalInputEntity = entity.GrassCoverErosionOutwardsFailureMechanismMetaEntities.Single(); Assert.AreEqual(failureMechanism.GeneralInput.N, generalInputEntity.N); + Assert.AreEqual(Convert.ToByte(failureMechanism.GeneralInput.ApplyLengthEffectInSection), generalInputEntity.ApplyLengthEffectInSection); } [Test] Index: Riskeer/Storage/test/Riskeer.Storage.Core.Test/Read/GrassCoverErosionOutwards/GrassCoverErosionOutwardsFailureMechanismMetaEntityReadExtensionsTest.cs =================================================================== diff -u -rda1df87d94dcc61aa26d5f033c6bf579c2249cdd -r034eb23a81ab16ac89cf642d0aefab0f25112822 --- Riskeer/Storage/test/Riskeer.Storage.Core.Test/Read/GrassCoverErosionOutwards/GrassCoverErosionOutwardsFailureMechanismMetaEntityReadExtensionsTest.cs (.../GrassCoverErosionOutwardsFailureMechanismMetaEntityReadExtensionsTest.cs) (revision da1df87d94dcc61aa26d5f033c6bf579c2249cdd) +++ Riskeer/Storage/test/Riskeer.Storage.Core.Test/Read/GrassCoverErosionOutwards/GrassCoverErosionOutwardsFailureMechanismMetaEntityReadExtensionsTest.cs (.../GrassCoverErosionOutwardsFailureMechanismMetaEntityReadExtensionsTest.cs) (revision 034eb23a81ab16ac89cf642d0aefab0f25112822) @@ -75,6 +75,7 @@ // Assert Assert.AreEqual(entity.N, inputToUpdate.N, inputToUpdate.N.GetAccuracy()); + Assert.AreEqual(Convert.ToBoolean(entity.ApplyLengthEffectInSection), inputToUpdate.ApplyLengthEffectInSection); } } } \ No newline at end of file