Index: Application/Ringtoets/src/Application.Ringtoets.Storage/Create/GrassCoverErosionOutwards/GrassCoverErosionOutwardsFailureMechanismCreateExtensions.cs =================================================================== diff -u -rb610d57f72acd9222a40ad4a3215c4f0072bfcb1 -reec9f1ac3701c6155c49101fcc9649d51ffdc319 --- Application/Ringtoets/src/Application.Ringtoets.Storage/Create/GrassCoverErosionOutwards/GrassCoverErosionOutwardsFailureMechanismCreateExtensions.cs (.../GrassCoverErosionOutwardsFailureMechanismCreateExtensions.cs) (revision b610d57f72acd9222a40ad4a3215c4f0072bfcb1) +++ Application/Ringtoets/src/Application.Ringtoets.Storage/Create/GrassCoverErosionOutwards/GrassCoverErosionOutwardsFailureMechanismCreateExtensions.cs (.../GrassCoverErosionOutwardsFailureMechanismCreateExtensions.cs) (revision eec9f1ac3701c6155c49101fcc9649d51ffdc319) @@ -22,6 +22,7 @@ using System; using System.Collections.Generic; using Application.Ringtoets.Storage.DbContext; +using Ringtoets.Common.Data.DikeProfiles; using Ringtoets.GrassCoverErosionOutwards.Data; namespace Application.Ringtoets.Storage.Create.GrassCoverErosionOutwards @@ -42,14 +43,14 @@ { var entity = mechanism.Create(FailureMechanismType.GrassRevetmentErosionOutwards, registry); AddEntitiesForSectionResults(mechanism.SectionResults, registry); - AddEntitiesForFailureMechanismMeta(mechanism.GeneralInput, registry, entity); - + AddEntitiesForFailureMechanismMeta(mechanism.GeneralInput, entity, registry); + AddEntitiesForForeshoreProfiles(mechanism.ForeshoreProfiles, entity, registry); entity.CalculationGroupEntity = mechanism.WaveConditionsCalculationGroup.Create(registry, 0); return entity; } - private static void AddEntitiesForFailureMechanismMeta(GeneralGrassCoverErosionOutwardsInput generalInput, PersistenceRegistry registry, FailureMechanismEntity entity) + private static void AddEntitiesForFailureMechanismMeta(GeneralGrassCoverErosionOutwardsInput generalInput, FailureMechanismEntity entity, PersistenceRegistry registry) { entity.GrassCoverErosionOutwardsFailureMechanismMetaEntities.Add(generalInput.Create(registry)); } @@ -65,5 +66,19 @@ section.GrassCoverErosionOutwardsSectionResultEntities.Add(sectionResultEntity); } } + + private static void AddEntitiesForForeshoreProfiles( + IEnumerable foreshoreProfiles, + FailureMechanismEntity entity, + PersistenceRegistry registry) + { + int i = 0; + + foreach (var foreshoreProfile in foreshoreProfiles) + { + var foreshoreProfileEntity = foreshoreProfile.Create(registry, i++); + entity.ForeshoreProfileEntities.Add(foreshoreProfileEntity); + } + } } } \ No newline at end of file Index: Application/Ringtoets/src/Application.Ringtoets.Storage/Create/WaveImpactAsphaltCover/WaveImpactAsphaltCoverFailureMechanismCreateExtensions.cs =================================================================== diff -u -r11f0867b39150ae5fac83dc178a89fee46d27611 -reec9f1ac3701c6155c49101fcc9649d51ffdc319 --- Application/Ringtoets/src/Application.Ringtoets.Storage/Create/WaveImpactAsphaltCover/WaveImpactAsphaltCoverFailureMechanismCreateExtensions.cs (.../WaveImpactAsphaltCoverFailureMechanismCreateExtensions.cs) (revision 11f0867b39150ae5fac83dc178a89fee46d27611) +++ Application/Ringtoets/src/Application.Ringtoets.Storage/Create/WaveImpactAsphaltCover/WaveImpactAsphaltCoverFailureMechanismCreateExtensions.cs (.../WaveImpactAsphaltCoverFailureMechanismCreateExtensions.cs) (revision eec9f1ac3701c6155c49101fcc9649d51ffdc319) @@ -22,6 +22,7 @@ using System; using System.Collections.Generic; using Application.Ringtoets.Storage.DbContext; +using Ringtoets.Common.Data.DikeProfiles; using Ringtoets.WaveImpactAsphaltCover.Data; namespace Application.Ringtoets.Storage.Create.WaveImpactAsphaltCover @@ -42,6 +43,7 @@ { var entity = mechanism.Create(FailureMechanismType.WaveImpactOnAsphaltRevetment, registry); AddEntitiesForSectionResults(mechanism.SectionResults, registry); + AddEntitiesForForeshoreProfiles(mechanism.ForeshoreProfiles, entity, registry); return entity; } @@ -57,5 +59,19 @@ section.WaveImpactAsphaltCoverSectionResultEntities.Add(sectionResultEntity); } } + + private static void AddEntitiesForForeshoreProfiles( + IEnumerable foreshoreProfiles, + FailureMechanismEntity entity, + PersistenceRegistry registry) + { + int i = 0; + + foreach (var foreshoreProfile in foreshoreProfiles) + { + var foreshoreProfileEntity = foreshoreProfile.Create(registry, i++); + entity.ForeshoreProfileEntities.Add(foreshoreProfileEntity); + } + } } } \ No newline at end of file Index: Application/Ringtoets/src/Application.Ringtoets.Storage/Read/FailureMechanismEntityReadExtensions.cs =================================================================== diff -u -r8aaa7b9a8a2826cf8da31d0fd136f2d559933afe -reec9f1ac3701c6155c49101fcc9649d51ffdc319 --- Application/Ringtoets/src/Application.Ringtoets.Storage/Read/FailureMechanismEntityReadExtensions.cs (.../FailureMechanismEntityReadExtensions.cs) (revision 8aaa7b9a8a2826cf8da31d0fd136f2d559933afe) +++ Application/Ringtoets/src/Application.Ringtoets.Storage/Read/FailureMechanismEntityReadExtensions.cs (.../FailureMechanismEntityReadExtensions.cs) (revision eec9f1ac3701c6155c49101fcc9649d51ffdc319) @@ -26,6 +26,7 @@ using Application.Ringtoets.Storage.Read.GrassCoverErosionInwards; using Application.Ringtoets.Storage.Read.GrassCoverErosionOutwards; using Application.Ringtoets.Storage.Read.Piping; +using Core.Common.Base; using Ringtoets.Common.Data.Calculation; using Ringtoets.Common.Data.DikeProfiles; using Ringtoets.Common.Data.FailureMechanism; @@ -401,6 +402,7 @@ { entity.ReadCommonFailureMechanismProperties(failureMechanism, collector); entity.ReadWaveImpactAsphaltCoverMechanismSectionResults(failureMechanism, collector); + entity.ReadForeshoreProfiles(failureMechanism.ForeshoreProfiles, collector); } private static void ReadWaveImpactAsphaltCoverMechanismSectionResults(this FailureMechanismEntity entity, WaveImpactAsphaltCoverFailureMechanism failureMechanism, ReadConversionCollector collector) @@ -429,6 +431,7 @@ entity.ReadCommonFailureMechanismProperties(failureMechanism, collector); entity.ReadGeneralGrassCoverErosionOutwardsCalculationInput(failureMechanism.GeneralInput); entity.ReadGrassCoverErosionOutwardsMechanismSectionResults(failureMechanism, collector); + entity.ReadForeshoreProfiles(failureMechanism.ForeshoreProfiles, collector); ReadGrassCoverErosionOutwardsWaveConditionsRootCalculationGroup(entity.CalculationGroupEntity, failureMechanism.WaveConditionsCalculationGroup, collector); } @@ -608,16 +611,16 @@ { entity.ReadCommonFailureMechanismProperties(failureMechanism, collector); entity.ReadStabilityStoneCoverMechanismSectionResults(failureMechanism, collector); - entity.ReadStabilityStoneCoverForeshoreProfiles(failureMechanism, collector); + entity.ReadForeshoreProfiles(failureMechanism.ForeshoreProfiles, collector); ReadStabilityStoneCoverWaveConditionsRootCalculationGroup(entity.CalculationGroupEntity, failureMechanism.WaveConditionsCalculationGroup, collector); } - private static void ReadStabilityStoneCoverForeshoreProfiles(this FailureMechanismEntity entity, StabilityStoneCoverFailureMechanism failureMechanism, ReadConversionCollector collector) + private static void ReadForeshoreProfiles(this FailureMechanismEntity entity, ObservableList foreshoreProfiles, ReadConversionCollector collector) { foreach (var foreshoreProfileEntity in entity.ForeshoreProfileEntities.OrderBy(fpe => fpe.Order)) { - failureMechanism.ForeshoreProfiles.Add(foreshoreProfileEntity.Read(collector)); + foreshoreProfiles.Add(foreshoreProfileEntity.Read(collector)); } } Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/GrassCoverErosionOutwards/GrassCoverErosionOutwardsFailureMechanismCreateExtensionsTest.cs =================================================================== diff -u -rb610d57f72acd9222a40ad4a3215c4f0072bfcb1 -reec9f1ac3701c6155c49101fcc9649d51ffdc319 --- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/GrassCoverErosionOutwards/GrassCoverErosionOutwardsFailureMechanismCreateExtensionsTest.cs (.../GrassCoverErosionOutwardsFailureMechanismCreateExtensionsTest.cs) (revision b610d57f72acd9222a40ad4a3215c4f0072bfcb1) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/GrassCoverErosionOutwards/GrassCoverErosionOutwardsFailureMechanismCreateExtensionsTest.cs (.../GrassCoverErosionOutwardsFailureMechanismCreateExtensionsTest.cs) (revision eec9f1ac3701c6155c49101fcc9649d51ffdc319) @@ -28,6 +28,7 @@ using NUnit.Framework; using Ringtoets.Common.Data.Calculation; using Ringtoets.GrassCoverErosionOutwards.Data; +using Ringtoets.StabilityStoneCover.Data; namespace Application.Ringtoets.Storage.Test.Create.GrassCoverErosionOutwards { @@ -120,6 +121,33 @@ } [Test] + public void Create_WithoutForeshoreProfiles_EmptyForeshoreProfilesEntities() + { + // Setup + var failureMechanism = new GrassCoverErosionOutwardsFailureMechanism(); + + // Call + var entity = failureMechanism.Create(new PersistenceRegistry()); + + // Assert + Assert.IsEmpty(entity.ForeshoreProfileEntities); + } + + [Test] + public void Create_WithForeshoreProfiles_ForeshoreProfilesEntitiesCreated() + { + // Setup + var failureMechanism = new GrassCoverErosionOutwardsFailureMechanism(); + failureMechanism.ForeshoreProfiles.Add(new TestForeshoreProfile()); + + // Call + var entity = failureMechanism.Create(new PersistenceRegistry()); + + // Assert + Assert.AreEqual(1, entity.ForeshoreProfileEntities.Count); + } + + [Test] public void Create_WithUpdatedN_FailureMechanismMetaUpdated() { // Setup Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/WaveImpactAsphaltCover/WaveImpactAsphaltCoverFailureMechanismCreateExtensionsTest.cs =================================================================== diff -u -r944d2501b3f780d208e00015a1b850afad4c3aa8 -reec9f1ac3701c6155c49101fcc9649d51ffdc319 --- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/WaveImpactAsphaltCover/WaveImpactAsphaltCoverFailureMechanismCreateExtensionsTest.cs (.../WaveImpactAsphaltCoverFailureMechanismCreateExtensionsTest.cs) (revision 944d2501b3f780d208e00015a1b850afad4c3aa8) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/WaveImpactAsphaltCover/WaveImpactAsphaltCoverFailureMechanismCreateExtensionsTest.cs (.../WaveImpactAsphaltCoverFailureMechanismCreateExtensionsTest.cs) (revision eec9f1ac3701c6155c49101fcc9649d51ffdc319) @@ -26,6 +26,7 @@ using Application.Ringtoets.Storage.DbContext; using Application.Ringtoets.Storage.TestUtil; using NUnit.Framework; +using Ringtoets.StabilityStoneCover.Data; using Ringtoets.WaveImpactAsphaltCover.Data; namespace Application.Ringtoets.Storage.Test.Create.WaveImpactAsphaltCover @@ -117,5 +118,31 @@ Assert.AreEqual(1, entity.FailureMechanismSectionEntities.Count); Assert.AreEqual(1, entity.FailureMechanismSectionEntities.SelectMany(fms => fms.WaveImpactAsphaltCoverSectionResultEntities).Count()); } + [Test] + public void Create_WithoutForeshoreProfiles_EmptyForeshoreProfilesEntities() + { + // Setup + var failureMechanism = new WaveImpactAsphaltCoverFailureMechanism(); + + // Call + var entity = failureMechanism.Create(new PersistenceRegistry()); + + // Assert + Assert.IsEmpty(entity.ForeshoreProfileEntities); + } + + [Test] + public void Create_WithForeshoreProfiles_ForeshoreProfilesEntitiesCreated() + { + // Setup + var failureMechanism = new WaveImpactAsphaltCoverFailureMechanism(); + failureMechanism.ForeshoreProfiles.Add(new TestForeshoreProfile()); + + // Call + var entity = failureMechanism.Create(new PersistenceRegistry()); + + // Assert + Assert.AreEqual(1, entity.ForeshoreProfileEntities.Count); + } } } \ No newline at end of file Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/IntegrationTests/StorageSqLiteIntegrationTest.cs =================================================================== diff -u -rc1d26c85ae973bcea8b126849492de2e93845b05 -reec9f1ac3701c6155c49101fcc9649d51ffdc319 --- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/IntegrationTests/StorageSqLiteIntegrationTest.cs (.../StorageSqLiteIntegrationTest.cs) (revision c1d26c85ae973bcea8b126849492de2e93845b05) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/IntegrationTests/StorageSqLiteIntegrationTest.cs (.../StorageSqLiteIntegrationTest.cs) (revision eec9f1ac3701c6155c49101fcc9649d51ffdc319) @@ -273,6 +273,7 @@ AssertGrassCoverErosionInwardsFailureMechanism(expectedAssessmentSection.GrassCoverErosionInwards, actualAssessmentSection.GrassCoverErosionInwards); AssertGrassCoverErosionOutwardsFailureMechanism(expectedAssessmentSection.GrassCoverErosionOutwards, actualAssessmentSection.GrassCoverErosionOutwards); AssertStabilityStoneCoverFailureMechanism(expectedAssessmentSection.StabilityStoneCover, actualAssessmentSection.StabilityStoneCover); + AssertWaveImpactAsphaltCoverFailureMechanism(expectedAssessmentSection.WaveImpactAsphaltCover, actualAssessmentSection.WaveImpactAsphaltCover); IFailureMechanism[] expectedProjectFailureMechanisms = expectedAssessmentSection.GetFailureMechanisms().ToArray(); IFailureMechanism[] actualProjectFailureMechanisms = actualAssessmentSection.GetFailureMechanisms().ToArray(); @@ -1060,6 +1061,7 @@ GrassCoverErosionOutwardsFailureMechanism actualFailureMechanism) { Assert.AreEqual(expectedFailureMechanism.GeneralInput.N, actualFailureMechanism.GeneralInput.N); + AssertForeshoreProfiles(expectedFailureMechanism.ForeshoreProfiles, actualFailureMechanism.ForeshoreProfiles); AssertCalculationGroup(expectedFailureMechanism.WaveConditionsCalculationGroup, actualFailureMechanism.WaveConditionsCalculationGroup); } @@ -1070,6 +1072,12 @@ AssertCalculationGroup(expectedFailureMechanism.WaveConditionsCalculationGroup, actualFailureMechanism.WaveConditionsCalculationGroup); } + private static void AssertWaveImpactAsphaltCoverFailureMechanism(WaveImpactAsphaltCoverFailureMechanism expectedFailureMechanism, + WaveImpactAsphaltCoverFailureMechanism actualFailureMechanism) + { + AssertForeshoreProfiles(expectedFailureMechanism.ForeshoreProfiles, actualFailureMechanism.ForeshoreProfiles); + } + private static void AssertDikeProfiles(IList expectedDikeProfiles, IList actualDikeProfiles) { Assert.AreEqual(expectedDikeProfiles.Count, actualDikeProfiles.Count); Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/AssessmentSectionEntityReadExtensionsTest.cs =================================================================== diff -u -rb1c3b9019f8f74992a7f1a681d494ae836ce4976 -reec9f1ac3701c6155c49101fcc9649d51ffdc319 --- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/AssessmentSectionEntityReadExtensionsTest.cs (.../AssessmentSectionEntityReadExtensionsTest.cs) (revision b1c3b9019f8f74992a7f1a681d494ae836ce4976) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/AssessmentSectionEntityReadExtensionsTest.cs (.../AssessmentSectionEntityReadExtensionsTest.cs) (revision eec9f1ac3701c6155c49101fcc9649d51ffdc319) @@ -25,10 +25,12 @@ using Application.Ringtoets.Storage.DbContext; using Application.Ringtoets.Storage.Read; using Application.Ringtoets.Storage.Serializers; +using Core.Common.Base; using Core.Common.Base.Geometry; using NUnit.Framework; using Ringtoets.Common.Data.AssessmentSection; using Ringtoets.Common.Data.Calculation; +using Ringtoets.Common.Data.DikeProfiles; using Ringtoets.Common.Data.FailureMechanism; namespace Application.Ringtoets.Storage.Test.Read @@ -418,7 +420,7 @@ var failureMechanismEntity = new FailureMechanismEntity { - FailureMechanismType = (int)FailureMechanismType.GrassRevetmentErosionOutwards, + FailureMechanismType = (int) FailureMechanismType.GrassRevetmentErosionOutwards, CalculationGroupEntity = new CalculationGroupEntity(), IsRelevant = Convert.ToByte(isRelevant), Comments = comments, @@ -443,6 +445,49 @@ } [Test] + [TestCase(true)] + [TestCase(false)] + public void Read_WithGrassCoverErosionOutwardsFailureMechanismWithForeshoreProfilesSet_ReturnsNewAssessmentSectionWithForeshoreProfilesInFailureMechanism(bool isRelevant) + { + // Setup + var entity = CreateAssessmentSectionEntity(); + + var profileAName = "profileA"; + var profileBName = "profileB"; + var failureMechanismEntity = new FailureMechanismEntity + { + FailureMechanismType = (int)FailureMechanismType.StabilityStoneRevetment, + CalculationGroupEntity = new CalculationGroupEntity(), + ForeshoreProfileEntities = + { + new ForeshoreProfileEntity + { + Order = 1, + Name = profileAName, + GeometryXml = new Point2DXmlSerializer().ToXml(Enumerable.Empty()) + }, + new ForeshoreProfileEntity + { + Order = 0, + Name = profileBName, + GeometryXml = new Point2DXmlSerializer().ToXml(Enumerable.Empty()) + } + }, + IsRelevant = Convert.ToByte(isRelevant) + }; + entity.FailureMechanismEntities.Add(failureMechanismEntity); + + var collector = new ReadConversionCollector(); + + // Call + var section = entity.Read(collector); + + // Assert + ObservableList foreshoreProfiles = section.StabilityStoneCover.ForeshoreProfiles; + CollectionAssert.AreEqual(new[] { profileBName, profileAName }, foreshoreProfiles.Select(fp => fp.Name)); + } + + [Test] [TestCase(true, TestName = "StabilityStoneCoverGroupsSet_ReturnsNewAssessmentSectionWithCalculationGroupStabilityStoneCover(true)")] [TestCase(false, TestName = "StabilityStoneCoverGroupsSet_ReturnsNewAssessmentSectionWithCalculationGroupStabilityStoneCover(false)")] public void Read_WithStabilityStoneCoverFailureMechanismWithWaveConditionsCalculationGroupsSet_ReturnsNewAssessmentSectionWithCalculationGroupsInFailureMechanism(bool isRelevant) @@ -452,7 +497,7 @@ var failureMechanismEntity = new FailureMechanismEntity { - FailureMechanismType = (int)FailureMechanismType.StabilityStoneRevetment, + FailureMechanismType = (int) FailureMechanismType.StabilityStoneRevetment, CalculationGroupEntity = new CalculationGroupEntity { CalculationGroupEntity1 = @@ -484,6 +529,92 @@ [Test] [TestCase(true)] [TestCase(false)] + public void Read_WithStabilityStoneCoverFailureMechanismWithForeshoreProfilesSet_ReturnsNewAssessmentSectionWithForeshoreProfilesInFailureMechanism(bool isRelevant) + { + // Setup + var entity = CreateAssessmentSectionEntity(); + + var profileAName = "profileA"; + var profileBName = "profileB"; + var failureMechanismEntity = new FailureMechanismEntity + { + FailureMechanismType = (int) FailureMechanismType.StabilityStoneRevetment, + CalculationGroupEntity = new CalculationGroupEntity(), + ForeshoreProfileEntities = + { + new ForeshoreProfileEntity + { + Order = 1, + Name = profileAName, + GeometryXml = new Point2DXmlSerializer().ToXml(Enumerable.Empty()) + }, + new ForeshoreProfileEntity + { + Order = 0, + Name = profileBName, + GeometryXml = new Point2DXmlSerializer().ToXml(Enumerable.Empty()) + } + }, + IsRelevant = Convert.ToByte(isRelevant) + }; + entity.FailureMechanismEntities.Add(failureMechanismEntity); + + var collector = new ReadConversionCollector(); + + // Call + var section = entity.Read(collector); + + // Assert + ObservableList foreshoreProfiles = section.StabilityStoneCover.ForeshoreProfiles; + CollectionAssert.AreEqual(new [] {profileBName, profileAName}, foreshoreProfiles.Select(fp => fp.Name)); + } + + [Test] + [TestCase(true)] + [TestCase(false)] + public void Read_WithWaveImpactAsphaltCoverFailureMechanismWithForeshoreProfilesSet_ReturnsNewAssessmentSectionWithForeshoreProfilesInFailureMechanism(bool isRelevant) + { + // Setup + var entity = CreateAssessmentSectionEntity(); + + var profileAName = "profileA"; + var profileBName = "profileB"; + var failureMechanismEntity = new FailureMechanismEntity + { + FailureMechanismType = (int)FailureMechanismType.WaveImpactOnAsphaltRevetment, + CalculationGroupEntity = new CalculationGroupEntity(), + ForeshoreProfileEntities = + { + new ForeshoreProfileEntity + { + Order = 1, + Name = profileAName, + GeometryXml = new Point2DXmlSerializer().ToXml(Enumerable.Empty()) + }, + new ForeshoreProfileEntity + { + Order = 0, + Name = profileBName, + GeometryXml = new Point2DXmlSerializer().ToXml(Enumerable.Empty()) + } + }, + IsRelevant = Convert.ToByte(isRelevant) + }; + entity.FailureMechanismEntities.Add(failureMechanismEntity); + + var collector = new ReadConversionCollector(); + + // Call + var section = entity.Read(collector); + + // Assert + ObservableList foreshoreProfiles = section.WaveImpactAsphaltCover.ForeshoreProfiles; + CollectionAssert.AreEqual(new[] { profileBName, profileAName }, foreshoreProfiles.Select(fp => fp.Name)); + } + + [Test] + [TestCase(true)] + [TestCase(false)] public void Read_WithStandAloneFailureMechanismsSet_ReturnsNewAssessmentSectionWithFailureMechanismsSet(bool isRelevant) { // Setup Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/StabilityStoneCover/StabilityStoneCoverWaveConditionsCalculationEntityReadExtensionsTest.cs =================================================================== diff -u -r0540405a7dbabf85dc02db30c79c3c58b0faeea6 -reec9f1ac3701c6155c49101fcc9649d51ffdc319 --- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/StabilityStoneCover/StabilityStoneCoverWaveConditionsCalculationEntityReadExtensionsTest.cs (.../StabilityStoneCoverWaveConditionsCalculationEntityReadExtensionsTest.cs) (revision 0540405a7dbabf85dc02db30c79c3c58b0faeea6) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/StabilityStoneCover/StabilityStoneCoverWaveConditionsCalculationEntityReadExtensionsTest.cs (.../StabilityStoneCoverWaveConditionsCalculationEntityReadExtensionsTest.cs) (revision eec9f1ac3701c6155c49101fcc9649d51ffdc319) @@ -20,11 +20,13 @@ // All rights reserved. using System; +using System.Linq; using Application.Ringtoets.Storage.DbContext; using Application.Ringtoets.Storage.Read; using Application.Ringtoets.Storage.Read.Piping; using Application.Ringtoets.Storage.Read.StabilityStoneCover; using Application.Ringtoets.Storage.Serializers; +using Application.Ringtoets.Storage.TestUtil; using Core.Common.Base.Data; using Core.Common.Base.Geometry; using NUnit.Framework; @@ -104,67 +106,53 @@ } [Test] - public void Read_EntityWithSurfaceLineInCollector_CalculationHasAlreadyReadSurfaceLine() + public void Read_EntityWithForeshoreProfileInCollector_CalculationHasAlreadyReadForeshoreProfile() { // Setup - var surfaceLine = new RingtoetsPipingSurfaceLine(); - surfaceLine.SetGeometry(new[] + var foreshoreProfile = new TestForeshoreProfile(); + var foreshoreProfileEntity = new ForeshoreProfileEntity { - new Point3D(1, 2, 3), - new Point3D(4, 5, 6) - }); - var surfaceLineEntity = new SurfaceLineEntity(); - var entity = new PipingCalculationEntity + GeometryXml = new Point2DXmlSerializer().ToXml(Enumerable.Empty()) + }; + var entity = new StabilityStoneCoverWaveConditionsCalculationEntity { - SurfaceLineEntity = surfaceLineEntity, - EntryPointL = 1, - ExitPointL = 2, - DampingFactorExitMean = 1, + ForeshoreProfileEntity = foreshoreProfileEntity, }; var collector = new ReadConversionCollector(); - collector.Read(surfaceLineEntity, surfaceLine); + collector.Read(foreshoreProfileEntity, foreshoreProfile); // Call - PipingCalculationScenario calculation = entity.Read(collector, new GeneralPipingInput()); + StabilityStoneCoverWaveConditionsCalculation calculation = entity.Read(collector); // Assert - Assert.AreSame(surfaceLine, calculation.InputParameters.SurfaceLine); - Assert.AreEqual(1, calculation.InputParameters.EntryPointL, 1e-6); - Assert.AreEqual(2, calculation.InputParameters.ExitPointL, 1e-6); + Assert.AreSame(foreshoreProfile, calculation.InputParameters.ForeshoreProfile); } [Test] - public void Read_EntityWithSurfaceLineNotYetInCollector_CalculationWithCreatedSurfaceLineAndRegisteredNewEntities() + public void Read_EntityWithForeshoreProfileNotYetInCollector_CalculationWithCreatedForeshoreProfileAndRegisteredNewEntities() { // Setup - var points = new[] + string name = "foreshore profile"; + var foreshoreProfileEntity = new ForeshoreProfileEntity { - new Point3D(1, 3, 4), - new Point3D(7, 10, 11) + Name = name, + GeometryXml = new Point2DXmlSerializer().ToXml(Enumerable.Empty()) }; - var surfaceLineEntity = new SurfaceLineEntity + var entity = new StabilityStoneCoverWaveConditionsCalculationEntity { - PointsXml = new Point3DXmlSerializer().ToXml(points) + ForeshoreProfileEntity = foreshoreProfileEntity, }; - var entity = new PipingCalculationEntity - { - SurfaceLineEntity = surfaceLineEntity, - EntryPointL = 1, - ExitPointL = 2, - DampingFactorExitMean = 1, - }; - var collector = new ReadConversionCollector(); // Call - PipingCalculationScenario calculation = entity.Read(collector, new GeneralPipingInput()); + StabilityStoneCoverWaveConditionsCalculation calculation = entity.Read(collector); // Assert - Assert.IsTrue(collector.Contains(surfaceLineEntity)); - CollectionAssert.AreEqual(points, calculation.InputParameters.SurfaceLine.Points); + Assert.IsTrue(collector.Contains(foreshoreProfileEntity)); + CollectionAssert.AreEqual(name, calculation.InputParameters.ForeshoreProfile.Name); } [Test] @@ -173,19 +161,16 @@ // Setup var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(1, "A", 1.1, 2.2); var hydraulicLocationEntity = new HydraulicLocationEntity(); - var entity = new PipingCalculationEntity + var entity = new StabilityStoneCoverWaveConditionsCalculationEntity { HydraulicLocationEntity = hydraulicLocationEntity, - EntryPointL = 1, - ExitPointL = 2, - DampingFactorExitMean = 1, }; var collector = new ReadConversionCollector(); collector.Read(hydraulicLocationEntity, hydraulicBoundaryLocation); // Call - PipingCalculationScenario calculation = entity.Read(collector, new GeneralPipingInput()); + StabilityStoneCoverWaveConditionsCalculation calculation = entity.Read(collector); // Assert Assert.AreSame(hydraulicBoundaryLocation, calculation.InputParameters.HydraulicBoundaryLocation); @@ -200,156 +185,23 @@ Name = "A" }; - var entity = new PipingCalculationEntity + var entity = new StabilityStoneCoverWaveConditionsCalculationEntity { HydraulicLocationEntity = hydraulicLocationEntity, - EntryPointL = 1, - ExitPointL = 2, - DampingFactorExitMean = 1, }; var collector = new ReadConversionCollector(); // Call - entity.Read(collector, new GeneralPipingInput()); + entity.Read(collector); // Assert Assert.IsTrue(collector.Contains(hydraulicLocationEntity)); } - [Test] - public void Read_EntityWithStochasticSoilModelEntityInCollector_CalculationHasAlreadyReadStochasticSoilModel() - { - // Setup - var stochasticSoilModel = new StochasticSoilModel(1, "A", "B"); - var stochasticSoilModelEntity = new StochasticSoilModelEntity(); - - var stochasticSoilProfile = new StochasticSoilProfile(1, SoilProfileType.SoilProfile1D, 1); - var stochasticSoilProfileEntity = new StochasticSoilProfileEntity - { - StochasticSoilModelEntity = stochasticSoilModelEntity - }; - - var entity = new PipingCalculationEntity - { - StochasticSoilProfileEntity = stochasticSoilProfileEntity, - EntryPointL = 1, - ExitPointL = 2, - DampingFactorExitMean = 1, - }; - - var collector = new ReadConversionCollector(); - collector.Read(stochasticSoilProfileEntity, stochasticSoilProfile); - collector.Read(stochasticSoilModelEntity, stochasticSoilModel); - - // Call - PipingCalculationScenario calculation = entity.Read(collector, new GeneralPipingInput()); - - // Assert - Assert.AreSame(stochasticSoilProfile, calculation.InputParameters.StochasticSoilProfile); - Assert.AreSame(stochasticSoilModel, calculation.InputParameters.StochasticSoilModel); - } - - [Test] - public void Read_EntityWithStochasticSoilProfileEntityNotYetInCollector_CalculationWithCreatedStochasticSoilProfileAndRegisteredNewEntities() - { - // Setup - var stochasticSoilProfileEntity = new StochasticSoilProfileEntity - { - SoilProfileEntity = new SoilProfileEntity - { - SoilLayerEntities = - { - new SoilLayerEntity() - } - } - }; - - var stochasticSoilModelEntity = new StochasticSoilModelEntity - { - StochasticSoilModelSegmentPointXml = new Point2DXmlSerializer().ToXml(new Point2D[0]), - StochasticSoilProfileEntities = - { - stochasticSoilProfileEntity - } - }; - stochasticSoilProfileEntity.StochasticSoilModelEntity = stochasticSoilModelEntity; - - var entity = new PipingCalculationEntity - { - StochasticSoilProfileEntity = stochasticSoilProfileEntity, - EntryPointL = 1, - ExitPointL = 2, - DampingFactorExitMean = 1, - }; - - var collector = new ReadConversionCollector(); - - // Call - entity.Read(collector, new GeneralPipingInput()); - - // Assert - Assert.IsTrue(collector.Contains(stochasticSoilProfileEntity)); - Assert.IsTrue(collector.Contains(stochasticSoilModelEntity)); - } - - [Test] - public void Read_EntityWithPipingCalculationOutputEntity_CalculationWithPipingOutput() - { - // Setup - var entity = new PipingCalculationEntity - { - EntryPointL = 1, - ExitPointL = 2, - DampingFactorExitMean = 1, - PipingCalculationOutputEntity = new PipingCalculationOutputEntity() - }; - - var collector = new ReadConversionCollector(); - - // Call - PipingCalculationScenario calculation = entity.Read(collector, new GeneralPipingInput()); - - // Assert - Assert.IsNotNull(calculation.Output); - } - - [Test] - public void Read_EntityWithPipingSemiProbabilisticOutputEntity_CalculationWithPipingSemiProbabilisticOutput() - { - // Setup - var entity = new PipingCalculationEntity - { - EntryPointL = 1, - ExitPointL = 2, - DampingFactorExitMean = 1, - PipingSemiProbabilisticOutputEntity = new PipingSemiProbabilisticOutputEntity() - }; - - var collector = new ReadConversionCollector(); - - // Call - PipingCalculationScenario calculation = entity.Read(collector, new GeneralPipingInput()); - - // Assert - Assert.IsNotNull(calculation.SemiProbabilisticOutput); - } - - private void AssertRoundedDouble(double? expectedValue, RoundedDouble actualValue) - { - Assert.IsTrue(expectedValue.HasValue); - Assert.AreEqual(expectedValue.Value, actualValue, actualValue.GetAccuracy()); - } - private static void AssertRoundedDouble(double expectedValue, RoundedDouble actualValue) { Assert.AreEqual(expectedValue, actualValue, actualValue.GetAccuracy()); } - - private static double? GetRandomNullableDoubleInRange(Random random, double lowerLimit, double upperLimit) - { - var difference = upperLimit - lowerLimit; - return lowerLimit + random.NextDouble()*difference; - } } } \ No newline at end of file Index: Application/Ringtoets/test/Application.Ringtoets.Storage.TestUtil.Test/Application.Ringtoets.Storage.TestUtil.Test.csproj =================================================================== diff -u -r3b68b0758709ec06ecc7581f4f852f3cea864c5d -reec9f1ac3701c6155c49101fcc9649d51ffdc319 --- Application/Ringtoets/test/Application.Ringtoets.Storage.TestUtil.Test/Application.Ringtoets.Storage.TestUtil.Test.csproj (.../Application.Ringtoets.Storage.TestUtil.Test.csproj) (revision 3b68b0758709ec06ecc7581f4f852f3cea864c5d) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.TestUtil.Test/Application.Ringtoets.Storage.TestUtil.Test.csproj (.../Application.Ringtoets.Storage.TestUtil.Test.csproj) (revision eec9f1ac3701c6155c49101fcc9649d51ffdc319) @@ -89,6 +89,14 @@ {4843D6E5-066F-4795-94F5-1D53932DD03C} Ringtoets.Common.Data.TestUtil + + {90de728e-48ef-4665-ab38-3d88e41d9f4d} + Ringtoets.GrassCoverErosionInwards.Data + + + {e7225477-577f-4a17-b7ec-6721158e1543} + Ringtoets.GrassCoverErosionOutwards.Data + {70f8cc9c-5bc8-4fb2-b201-eae7fa8088c2} Ringtoets.HydraRing.Data @@ -105,6 +113,14 @@ {14c6f716-64e2-4bc4-a1ef-05865fcefa4c} Ringtoets.Piping.Primitives + + {b479e3af-7c34-488c-bb73-d324100d36c9} + Ringtoets.StabilityStoneCover.Data + + + {567e0b69-5280-41ce-add6-443725a61c86} + Ringtoets.WaveImpactAsphaltCover.Data + {03DBE353-99F7-47D6-B826-60D694FFB9AC} Application.Ringtoets.Storage.TestUtil Index: Application/Ringtoets/test/Application.Ringtoets.Storage.TestUtil.Test/RingtoetsProjectTestHelperTest.cs =================================================================== diff -u -r3d995a76fbe93cf9801596e6b959e7f5bcde5805 -reec9f1ac3701c6155c49101fcc9649d51ffdc319 --- Application/Ringtoets/test/Application.Ringtoets.Storage.TestUtil.Test/RingtoetsProjectTestHelperTest.cs (.../RingtoetsProjectTestHelperTest.cs) (revision 3d995a76fbe93cf9801596e6b959e7f5bcde5805) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.TestUtil.Test/RingtoetsProjectTestHelperTest.cs (.../RingtoetsProjectTestHelperTest.cs) (revision eec9f1ac3701c6155c49101fcc9649d51ffdc319) @@ -23,11 +23,16 @@ using Core.Common.Base.Data; using Core.Common.Base.Geometry; using NUnit.Framework; +using Ringtoets.Common.Data.Calculation; using Ringtoets.Common.Data.TestUtil; +using Ringtoets.GrassCoverErosionInwards.Data; +using Ringtoets.GrassCoverErosionOutwards.Data; using Ringtoets.HydraRing.Data; using Ringtoets.Integration.Data; using Ringtoets.Piping.Data; using Ringtoets.Piping.Primitives; +using Ringtoets.StabilityStoneCover.Data; +using Ringtoets.WaveImpactAsphaltCover.Data; namespace Application.Ringtoets.Storage.TestUtil.Test { @@ -118,6 +123,44 @@ Assert.AreSame(surfaceLine.Points[6], surfaceLine.BottomDitchDikeSide); Assert.AreSame(surfaceLine.Points[7], surfaceLine.BottomDitchPolderSide); Assert.AreSame(surfaceLine.Points[8], surfaceLine.DitchPolderSide); + + Assert.NotNull(pipingFailureMechanism.CalculationsGroup); + Assert.AreEqual(3, pipingFailureMechanism.CalculationsGroup.Children.Count); + Assert.AreEqual(1, ((CalculationGroup)pipingFailureMechanism.CalculationsGroup.Children[0]).Children.Count); + Assert.IsInstanceOf(((CalculationGroup)pipingFailureMechanism.CalculationsGroup.Children[0]).Children[0]); + Assert.AreEqual(0, ((CalculationGroup)pipingFailureMechanism.CalculationsGroup.Children[1]).Children.Count); + Assert.IsInstanceOf(pipingFailureMechanism.CalculationsGroup.Children[2]); + + GrassCoverErosionInwardsFailureMechanism grassCoverErosionInwardsFailureMechanism = assessmentSection.GrassCoverErosionInwards; + Assert.NotNull(grassCoverErosionInwardsFailureMechanism.CalculationsGroup); + Assert.AreEqual(3, grassCoverErosionInwardsFailureMechanism.CalculationsGroup.Children.Count); + + Assert.AreEqual(1, ((CalculationGroup)grassCoverErosionInwardsFailureMechanism.CalculationsGroup.Children[0]).Children.Count); + Assert.IsInstanceOf(((CalculationGroup)grassCoverErosionInwardsFailureMechanism.CalculationsGroup.Children[0]).Children[0]); + Assert.AreEqual(0, ((CalculationGroup)grassCoverErosionInwardsFailureMechanism.CalculationsGroup.Children[1]).Children.Count); + Assert.IsInstanceOf(grassCoverErosionInwardsFailureMechanism.CalculationsGroup.Children[2]); + + GrassCoverErosionOutwardsFailureMechanism grassCoverErosionOutwardsFailureMechanism = assessmentSection.GrassCoverErosionOutwards; + Assert.AreEqual(2, grassCoverErosionOutwardsFailureMechanism.ForeshoreProfiles.Count); + Assert.NotNull(grassCoverErosionOutwardsFailureMechanism.WaveConditionsCalculationGroup); + Assert.AreEqual(2, grassCoverErosionOutwardsFailureMechanism.WaveConditionsCalculationGroup.Children.Count); + + Assert.AreEqual(0, ((CalculationGroup)grassCoverErosionOutwardsFailureMechanism.WaveConditionsCalculationGroup.Children[0]).Children.Count); + Assert.AreEqual(0, ((CalculationGroup)grassCoverErosionOutwardsFailureMechanism.WaveConditionsCalculationGroup.Children[1]).Children.Count); + + StabilityStoneCoverFailureMechanism stabilityStoneCoverFailureMechanism = assessmentSection.StabilityStoneCover; + Assert.AreEqual(2, stabilityStoneCoverFailureMechanism.ForeshoreProfiles.Count); + Assert.NotNull(stabilityStoneCoverFailureMechanism.WaveConditionsCalculationGroup); + + Assert.AreEqual(1, ((CalculationGroup)stabilityStoneCoverFailureMechanism.WaveConditionsCalculationGroup.Children[0]).Children.Count); + Assert.IsInstanceOf( + ((CalculationGroup)stabilityStoneCoverFailureMechanism.WaveConditionsCalculationGroup.Children[0]).Children[0]); + Assert.AreEqual(0, ((CalculationGroup)stabilityStoneCoverFailureMechanism.WaveConditionsCalculationGroup.Children[1]).Children.Count); + Assert.IsInstanceOf( + stabilityStoneCoverFailureMechanism.WaveConditionsCalculationGroup.Children[2]); + + WaveImpactAsphaltCoverFailureMechanism waveImpactAsphaltCoverFailureMechanism = assessmentSection.WaveImpactAsphaltCover; + Assert.AreEqual(2, waveImpactAsphaltCoverFailureMechanism.ForeshoreProfiles.Count); } } } \ No newline at end of file Index: Application/Ringtoets/test/Application.Ringtoets.Storage.TestUtil/Application.Ringtoets.Storage.TestUtil.csproj =================================================================== diff -u -r0540405a7dbabf85dc02db30c79c3c58b0faeea6 -reec9f1ac3701c6155c49101fcc9649d51ffdc319 --- Application/Ringtoets/test/Application.Ringtoets.Storage.TestUtil/Application.Ringtoets.Storage.TestUtil.csproj (.../Application.Ringtoets.Storage.TestUtil.csproj) (revision 0540405a7dbabf85dc02db30c79c3c58b0faeea6) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.TestUtil/Application.Ringtoets.Storage.TestUtil.csproj (.../Application.Ringtoets.Storage.TestUtil.csproj) (revision eec9f1ac3701c6155c49101fcc9649d51ffdc319) @@ -61,8 +61,6 @@ Properties\GlobalAssembly.cs - - Fisheye: Tag eec9f1ac3701c6155c49101fcc9649d51ffdc319 refers to a dead (removed) revision in file `Application/Ringtoets/test/Application.Ringtoets.Storage.TestUtil/RingtoetsEntitiesHelper.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Application/Ringtoets/test/Application.Ringtoets.Storage.TestUtil/RingtoetsProjectTestHelper.cs =================================================================== diff -u -rc1d26c85ae973bcea8b126849492de2e93845b05 -reec9f1ac3701c6155c49101fcc9649d51ffdc319 --- Application/Ringtoets/test/Application.Ringtoets.Storage.TestUtil/RingtoetsProjectTestHelper.cs (.../RingtoetsProjectTestHelper.cs) (revision c1d26c85ae973bcea8b126849492de2e93845b05) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.TestUtil/RingtoetsProjectTestHelper.cs (.../RingtoetsProjectTestHelper.cs) (revision eec9f1ac3701c6155c49101fcc9649d51ffdc319) @@ -23,6 +23,7 @@ using System.Collections.Generic; using System.Drawing; using System.Linq; +using Core.Common.Base; using Core.Common.Base.Data; using Core.Common.Base.Geometry; using Ringtoets.Common.Data.AssessmentSection; @@ -74,23 +75,28 @@ grassCoverErosionInwardsFailureMechanism.Calculations.OfType()); GrassCoverErosionOutwardsFailureMechanism grassCoverErosionOutwardsFailureMechanism = assessmentSection.GrassCoverErosionOutwards; + AddForeshoreProfiles(grassCoverErosionOutwardsFailureMechanism.ForeshoreProfiles); ConfigureGrassCoverErosionOutwardsFailureMechanism(grassCoverErosionOutwardsFailureMechanism); AddSections(grassCoverErosionOutwardsFailureMechanism); SetSectionResults(grassCoverErosionOutwardsFailureMechanism.SectionResults); StabilityStoneCoverFailureMechanism stabilityStoneCoverFailureMechanism = assessmentSection.StabilityStoneCover; + AddForeshoreProfiles(stabilityStoneCoverFailureMechanism.ForeshoreProfiles); ConfigureStabilityStoneCoverFailureMechanism(stabilityStoneCoverFailureMechanism, assessmentSection); AddSections(stabilityStoneCoverFailureMechanism); SetSectionResults(stabilityStoneCoverFailureMechanism.SectionResults); + WaveImpactAsphaltCoverFailureMechanism waveImpactAsphaltCoverFailureMechanism = assessmentSection.WaveImpactAsphaltCover; + AddForeshoreProfiles(waveImpactAsphaltCoverFailureMechanism.ForeshoreProfiles); + AddSections(waveImpactAsphaltCoverFailureMechanism); + SetSectionResults(waveImpactAsphaltCoverFailureMechanism.SectionResults); + AddSections(assessmentSection.MacrostabilityInwards); SetSectionResults(assessmentSection.MacrostabilityInwards.SectionResults); AddSections(assessmentSection.MacrostabilityOutwards); SetSectionResults(assessmentSection.MacrostabilityOutwards.SectionResults); AddSections(assessmentSection.Microstability); SetSectionResults(assessmentSection.Microstability.SectionResults); - AddSections(assessmentSection.WaveImpactAsphaltCover); - SetSectionResults(assessmentSection.WaveImpactAsphaltCover.SectionResults); AddSections(assessmentSection.WaterPressureAsphaltCover); SetSectionResults(assessmentSection.WaterPressureAsphaltCover.SectionResults); AddSections(assessmentSection.GrassCoverSlipOffInwards); @@ -349,18 +355,12 @@ { Name = "GEKB B" }); - failureMechanism.CalculationsGroup.Children.Add(new CalculationGroup - { - Name = "GEKB C", - Children = + failureMechanism.CalculationsGroup.Children.Add( + new GrassCoverErosionInwardsCalculation { - new GrassCoverErosionInwardsCalculation - { - Name = "Calculation 2", - Comments = "Comments about Calculation 2" - } - } - }); + Name = "Calculation 2", + Comments = "Comments about Calculation 2" + }); } private static void ConfigureGrassCoverErosionOutwardsFailureMechanism(GrassCoverErosionOutwardsFailureMechanism failureMechanism) @@ -375,37 +375,11 @@ { Name = "GCEO A" }); - failureMechanism.WaveConditionsCalculationGroup.Children.Add(new CalculationGroup - { - Name = "GCEO B", - Children = - { - new CalculationGroup - { - Name = "GCEO B 1", - } - } - }); } private static void ConfigureStabilityStoneCoverFailureMechanism(StabilityStoneCoverFailureMechanism failureMechanism, IAssessmentSection assessmentSection) { - var foreshoreProfile = new ForeshoreProfile( - new Point2D(2,5), new [] - { - new Point2D(1, 6), - new Point2D(8, 5), - }, new BreakWater(BreakWaterType.Caisson, 2.5), new ForeshoreProfile.ConstructionProperties - { - Name = "FP", - Orientation = 95.5, - X0 = 22.1 - }); - failureMechanism.ForeshoreProfiles.Add(foreshoreProfile); - - failureMechanism.ForeshoreProfiles.Add(new ForeshoreProfile( - new Point2D(2,5), Enumerable.Empty(), null, new ForeshoreProfile.ConstructionProperties())); - + ForeshoreProfile foreshoreProfile = failureMechanism.ForeshoreProfiles[0]; failureMechanism.WaveConditionsCalculationGroup.Children.Add(new CalculationGroup { Name = "GEKB A", @@ -440,17 +414,30 @@ { Name = "SSC A" }); - failureMechanism.WaveConditionsCalculationGroup.Children.Add(new CalculationGroup - { - Name = "SSC B", - Children = + failureMechanism.WaveConditionsCalculationGroup.Children.Add( + new StabilityStoneCoverWaveConditionsCalculation { - new CalculationGroup + Name = "Calculation 2", + Comments = "Comments for Calculation 2", + InputParameters = { - Name = "SSC B 1", + ForeshoreProfile = null, + HydraulicBoundaryLocation = assessmentSection.HydraulicBoundaryDatabase.Locations[0], + BreakWater = + { + Height = (RoundedDouble)(foreshoreProfile.BreakWater.Height + 0.1), + Type = BreakWaterType.Dam + }, + Orientation = foreshoreProfile.Orientation, + UseForeshore = false, + UseBreakWater = false, + UpperBoundaryRevetment = (RoundedDouble)12.3, + LowerBoundaryRevetment = (RoundedDouble)(-3.5), + UpperBoundaryWaterLevels = (RoundedDouble)13.3, + LowerBoundaryWaterLevels = (RoundedDouble)(-1.9), + StepSize = WaveConditionsInputStepSize.One } - } - }); + }); } private static void SetSectionResults(IEnumerable sectionResults) @@ -683,6 +670,23 @@ })); } + private static void AddForeshoreProfiles(ObservableList foreshoreProfiles) + { + foreshoreProfiles.Add(new ForeshoreProfile( + new Point2D(2, 5), new[] + { + new Point2D(1, 6), + new Point2D(8, 5), + }, new BreakWater(BreakWaterType.Caisson, 2.5), new ForeshoreProfile.ConstructionProperties + { + Name = "FP", + Orientation = 95.5, + X0 = 22.1 + })); + foreshoreProfiles.Add(new ForeshoreProfile( + new Point2D(2, 5), Enumerable.Empty(), null, new ForeshoreProfile.ConstructionProperties())); + } + private static RingtoetsPipingSurfaceLine GetSurfaceLine() { var surfaceLine = new RingtoetsPipingSurfaceLine Fisheye: Tag eec9f1ac3701c6155c49101fcc9649d51ffdc319 refers to a dead (removed) revision in file `Application/Ringtoets/test/Application.Ringtoets.Storage.TestUtil/TestDbSet.cs'. Fisheye: No comparison available. Pass `N' to diff?