Index: Application/Ringtoets/src/Application.Ringtoets.Storage/Application.Ringtoets.Storage.csproj =================================================================== diff -u -r3fad85f24665fdcfe75cba4e2f9ab30c2ca6a4b6 -rae14c5d4e4624fa87390e6d63bb419c648e12dda --- Application/Ringtoets/src/Application.Ringtoets.Storage/Application.Ringtoets.Storage.csproj (.../Application.Ringtoets.Storage.csproj) (revision 3fad85f24665fdcfe75cba4e2f9ab30c2ca6a4b6) +++ Application/Ringtoets/src/Application.Ringtoets.Storage/Application.Ringtoets.Storage.csproj (.../Application.Ringtoets.Storage.csproj) (revision ae14c5d4e4624fa87390e6d63bb419c648e12dda) @@ -168,6 +168,9 @@ RingtoetsEntities.tt + + RingtoetsEntities.tt + RingtoetsEntities.tt @@ -186,9 +189,6 @@ RingtoetsEntities.tt - - RingtoetsEntities.tt - RingtoetsEntities.tt @@ -267,8 +267,8 @@ - - + + @@ -304,7 +304,7 @@ - + @@ -376,6 +376,11 @@ Ringtoets.Revetment.Data False + + {3d4b9740-8348-4434-8d77-b611fc6ee57f} + Ringtoets.StabilityPointStructures.Data + False + {567E0B69-5280-41CE-ADD6-443725A61C86} Ringtoets.WaveImpactAsphaltCover.Data Index: Application/Ringtoets/src/Application.Ringtoets.Storage/Create/AssessmentSectionCreateExtensions.cs =================================================================== diff -u -rb3af39ba024b8e12fe238d85130697255db28c59 -rae14c5d4e4624fa87390e6d63bb419c648e12dda --- Application/Ringtoets/src/Application.Ringtoets.Storage/Create/AssessmentSectionCreateExtensions.cs (.../AssessmentSectionCreateExtensions.cs) (revision b3af39ba024b8e12fe238d85130697255db28c59) +++ Application/Ringtoets/src/Application.Ringtoets.Storage/Create/AssessmentSectionCreateExtensions.cs (.../AssessmentSectionCreateExtensions.cs) (revision ae14c5d4e4624fa87390e6d63bb419c648e12dda) @@ -32,9 +32,9 @@ using Application.Ringtoets.Storage.Create.Microstability; using Application.Ringtoets.Storage.Create.Piping; using Application.Ringtoets.Storage.Create.PipingStructure; +using Application.Ringtoets.Storage.Create.StabilityPointStructures; using Application.Ringtoets.Storage.Create.StabilityStoneCover; using Application.Ringtoets.Storage.Create.StrengthStabilityLengthwise; -using Application.Ringtoets.Storage.Create.StrengthStabilityPointConstruction; using Application.Ringtoets.Storage.Create.TechnicalInnovation; using Application.Ringtoets.Storage.Create.WaterPressureAsphaltCover; using Application.Ringtoets.Storage.Create.WaveImpactAsphaltCover; @@ -94,7 +94,7 @@ entity.FailureMechanismEntities.Add(section.PipingStructure.Create(registry)); entity.FailureMechanismEntities.Add(section.StabilityStoneCover.Create(registry)); entity.FailureMechanismEntities.Add(section.DuneErosion.Create(registry)); - entity.FailureMechanismEntities.Add(section.StrengthStabilityPointConstruction.Create(registry)); + entity.FailureMechanismEntities.Add(section.StabilityPointStructures.Create(registry)); return entity; } Index: Application/Ringtoets/src/Application.Ringtoets.Storage/Create/StabilityPointStructures/StabilityPointStructuresFailureMechanismCreateExtensions.cs =================================================================== diff -u --- Application/Ringtoets/src/Application.Ringtoets.Storage/Create/StabilityPointStructures/StabilityPointStructuresFailureMechanismCreateExtensions.cs (revision 0) +++ Application/Ringtoets/src/Application.Ringtoets.Storage/Create/StabilityPointStructures/StabilityPointStructuresFailureMechanismCreateExtensions.cs (revision ae14c5d4e4624fa87390e6d63bb419c648e12dda) @@ -0,0 +1,61 @@ +// 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 Application.Ringtoets.Storage.DbContext; +using Ringtoets.StabilityPointStructures.Data; + +namespace Application.Ringtoets.Storage.Create.StabilityPointStructures +{ + /// + /// Extension methods for related to creating a . + /// + internal static class StabilityPointStructuresFailureMechanismCreateExtensions + { + /// + /// Creates a based on the information of the . + /// + /// The failure mechanism to create a database entity for. + /// The object keeping track of create operations. + /// A new . + /// Thrown when is null. + internal static FailureMechanismEntity Create(this StabilityPointStructuresFailureMechanism mechanism, PersistenceRegistry registry) + { + var entity = mechanism.Create(FailureMechanismType.StabilityPointStructures, registry); + AddEntitiesForSectionResults(mechanism.SectionResults, registry); + + return entity; + } + + private static void AddEntitiesForSectionResults( + IEnumerable sectionResults, + PersistenceRegistry registry) + { + foreach (var failureMechanismSectionResult in sectionResults) + { + var sectionResultEntity = failureMechanismSectionResult.Create(registry); + var section = registry.Get(failureMechanismSectionResult.Section); + section.StabilityPointStructuresSectionResultEntities.Add(sectionResultEntity); + } + } + } +} \ No newline at end of file Index: Application/Ringtoets/src/Application.Ringtoets.Storage/Create/StabilityPointStructures/StabilityPointStructuresFailureMechanismSectionResultCreateExtensions.cs =================================================================== diff -u --- Application/Ringtoets/src/Application.Ringtoets.Storage/Create/StabilityPointStructures/StabilityPointStructuresFailureMechanismSectionResultCreateExtensions.cs (revision 0) +++ Application/Ringtoets/src/Application.Ringtoets.Storage/Create/StabilityPointStructures/StabilityPointStructuresFailureMechanismSectionResultCreateExtensions.cs (revision ae14c5d4e4624fa87390e6d63bb419c648e12dda) @@ -0,0 +1,56 @@ +// 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 Application.Ringtoets.Storage.DbContext; +using Ringtoets.StabilityPointStructures.Data; + +namespace Application.Ringtoets.Storage.Create.StabilityPointStructures +{ + /// + /// Extension methods for related to creating a + /// . + /// + internal static class StabilityPointStructuresFailureMechanismSectionResultCreateExtensions + { + /// + /// Creates a based on the information of the . + /// + /// The result to create a database entity for. + /// The object keeping track of create operations. + /// A new . + /// Thrown when is null. + internal static StabilityPointStructuresSectionResultEntity Create(this StabilityPointStructuresFailureMechanismSectionResult result, PersistenceRegistry registry) + { + if (registry == null) + { + throw new ArgumentNullException("registry"); + } + var sectionResultEntity = new StabilityPointStructuresSectionResultEntity + { + LayerTwoA = result.AssessmentLayerTwoA.ToNaNAsNull(), + LayerThree = result.AssessmentLayerThree.Value.ToNaNAsNull() + }; + + return sectionResultEntity; + } + } +} \ No newline at end of file Fisheye: Tag ae14c5d4e4624fa87390e6d63bb419c648e12dda refers to a dead (removed) revision in file `Application/Ringtoets/src/Application.Ringtoets.Storage/Create/StrengthStabilityPointConstruction/StrengthStabilityPointConstructionFailureMechanismCreateExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag ae14c5d4e4624fa87390e6d63bb419c648e12dda refers to a dead (removed) revision in file `Application/Ringtoets/src/Application.Ringtoets.Storage/Create/StrengthStabilityPointConstruction/StrengthStabilityPointConstructionFailureMechanismSectionResultCreateExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Application/Ringtoets/src/Application.Ringtoets.Storage/DbContext/DatabaseStructure.sql =================================================================== diff -u -rb3af39ba024b8e12fe238d85130697255db28c59 -rae14c5d4e4624fa87390e6d63bb419c648e12dda --- Application/Ringtoets/src/Application.Ringtoets.Storage/DbContext/DatabaseStructure.sql (.../DatabaseStructure.sql) (revision b3af39ba024b8e12fe238d85130697255db28c59) +++ Application/Ringtoets/src/Application.Ringtoets.Storage/DbContext/DatabaseStructure.sql (.../DatabaseStructure.sql) (revision ae14c5d4e4624fa87390e6d63bb419c648e12dda) @@ -1,6 +1,6 @@ /* ---------------------------------------------------- */ /* Generated by Enterprise Architect Version 12.0 */ -/* Created On : 20-Sep-2016 9:01:27 AM */ +/* Created On : 23-Sep-2016 11:38:21 AM */ /* DBMS : SQLite */ /* ---------------------------------------------------- */ @@ -117,7 +117,7 @@ DROP TABLE IF EXISTS 'StabilityStoneCoverSectionResultEntity' ; -DROP TABLE IF EXISTS 'StrengthStabilityPointConstructionSectionResultEntity' +DROP TABLE IF EXISTS 'StabilityPointStructuresSectionResultEntity' ; DROP TABLE IF EXISTS 'DikeProfileEntity' @@ -611,13 +611,13 @@ ) ; -CREATE TABLE 'StrengthStabilityPointConstructionSectionResultEntity' +CREATE TABLE 'StabilityPointStructuresSectionResultEntity' ( - 'StrengthStabilityPointConstructionSectionResultEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + 'StabilityPointStructuresSectionResultEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, 'FailureMechanismSectionEntityId' INTEGER NOT NULL, 'LayerTwoA' REAL, 'LayerThree' REAL, - CONSTRAINT 'FK_StrengthStabilityPointConstructionSectionResultEntity_FailureMechanismSectionEntity' FOREIGN KEY ('FailureMechanismSectionEntityId') REFERENCES 'FailureMechanismSectionEntity' ('FailureMechanismSectionEntityId') ON DELETE Cascade ON UPDATE Cascade + CONSTRAINT 'FK_StabilityPointStructuresSectionResultEntity_FailureMechanismSectionEntity' FOREIGN KEY ('FailureMechanismSectionEntityId') REFERENCES 'FailureMechanismSectionEntity' ('FailureMechanismSectionEntityId') ON DELETE Cascade ON UPDATE Cascade ) ; @@ -974,8 +974,8 @@ ON 'StabilityStoneCoverSectionResultEntity' ('FailureMechanismSectionEntityId' ASC) ; -CREATE INDEX 'IXFK_StrengthStabilityPointConstructionSectionResultEntity_FailureMechanismSectionEntity' - ON 'StrengthStabilityPointConstructionSectionResultEntity' ('FailureMechanismSectionEntityId' ASC) +CREATE INDEX 'IXFK_StabilityPointStructuresSectionResultEntity_FailureMechanismSectionEntity' + ON 'StabilityPointStructuresSectionResultEntity' ('FailureMechanismSectionEntityId' ASC) ; CREATE INDEX 'IXFK_DikeProfileEntity_FailureMechanismEntity' Index: Application/Ringtoets/src/Application.Ringtoets.Storage/DbContext/FailureMechanismSectionEntity.cs =================================================================== diff -u -rb3af39ba024b8e12fe238d85130697255db28c59 -rae14c5d4e4624fa87390e6d63bb419c648e12dda --- Application/Ringtoets/src/Application.Ringtoets.Storage/DbContext/FailureMechanismSectionEntity.cs (.../FailureMechanismSectionEntity.cs) (revision b3af39ba024b8e12fe238d85130697255db28c59) +++ Application/Ringtoets/src/Application.Ringtoets.Storage/DbContext/FailureMechanismSectionEntity.cs (.../FailureMechanismSectionEntity.cs) (revision ae14c5d4e4624fa87390e6d63bb419c648e12dda) @@ -38,6 +38,7 @@ [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] public FailureMechanismSectionEntity() { + this.ClosingStructuresSectionResultEntities = new HashSet(); this.DuneErosionSectionResultEntities = new HashSet(); this.GrassCoverErosionInwardsSectionResultEntities = new HashSet(); this.GrassCoverErosionOutwardsSectionResultEntities = new HashSet(); @@ -49,13 +50,12 @@ this.MicrostabilitySectionResultEntities = new HashSet(); this.PipingSectionResultEntities = new HashSet(); this.PipingStructureSectionResultEntities = new HashSet(); + this.StabilityPointStructuresSectionResultEntities = new HashSet(); this.StabilityStoneCoverSectionResultEntities = new HashSet(); this.StrengthStabilityLengthwiseConstructionSectionResultEntities = new HashSet(); - this.StrengthStabilityPointConstructionSectionResultEntities = new HashSet(); this.TechnicalInnovationSectionResultEntities = new HashSet(); this.WaterPressureAsphaltCoverSectionResultEntities = new HashSet(); this.WaveImpactAsphaltCoverSectionResultEntities = new HashSet(); - this.ClosingStructuresSectionResultEntities = new HashSet(); } public long FailureMechanismSectionEntityId { get; set; } @@ -64,6 +64,8 @@ public string FailureMechanismSectionPointXml { get; set; } [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection ClosingStructuresSectionResultEntities { get; set; } + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] public virtual ICollection DuneErosionSectionResultEntities { get; set; } public virtual FailureMechanismEntity FailureMechanismEntity { get; set; } [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] @@ -87,18 +89,16 @@ [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] public virtual ICollection PipingStructureSectionResultEntities { get; set; } [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection StabilityPointStructuresSectionResultEntities { get; set; } + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] public virtual ICollection StabilityStoneCoverSectionResultEntities { get; set; } [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] public virtual ICollection StrengthStabilityLengthwiseConstructionSectionResultEntities { get; set; } [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] - public virtual ICollection StrengthStabilityPointConstructionSectionResultEntities { get; set; } - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] public virtual ICollection TechnicalInnovationSectionResultEntities { get; set; } [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] public virtual ICollection WaterPressureAsphaltCoverSectionResultEntities { get; set; } [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] public virtual ICollection WaveImpactAsphaltCoverSectionResultEntities { get; set; } - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] - public virtual ICollection ClosingStructuresSectionResultEntities { get; set; } } } Index: Application/Ringtoets/src/Application.Ringtoets.Storage/DbContext/FailureMechanismType.cs =================================================================== diff -u -r5d46f6f7d54a327ba5fa13c6c8b1b10fb29be84e -rae14c5d4e4624fa87390e6d63bb419c648e12dda --- Application/Ringtoets/src/Application.Ringtoets.Storage/DbContext/FailureMechanismType.cs (.../FailureMechanismType.cs) (revision 5d46f6f7d54a327ba5fa13c6c8b1b10fb29be84e) +++ Application/Ringtoets/src/Application.Ringtoets.Storage/DbContext/FailureMechanismType.cs (.../FailureMechanismType.cs) (revision ae14c5d4e4624fa87390e6d63bb419c648e12dda) @@ -84,7 +84,7 @@ /// /// Sterkte en stabiliteit puntconstructies - STKWp /// - StrengthAndStabilityPointConstruction = 12, + StabilityPointStructures = 12, /// /// Macrostabiliteit buitenwaarts - STBU Index: Application/Ringtoets/src/Application.Ringtoets.Storage/DbContext/IRingtoetsEntities.cs =================================================================== diff -u -rb3af39ba024b8e12fe238d85130697255db28c59 -rae14c5d4e4624fa87390e6d63bb419c648e12dda --- Application/Ringtoets/src/Application.Ringtoets.Storage/DbContext/IRingtoetsEntities.cs (.../IRingtoetsEntities.cs) (revision b3af39ba024b8e12fe238d85130697255db28c59) +++ Application/Ringtoets/src/Application.Ringtoets.Storage/DbContext/IRingtoetsEntities.cs (.../IRingtoetsEntities.cs) (revision ae14c5d4e4624fa87390e6d63bb419c648e12dda) @@ -187,10 +187,10 @@ DbSet StabilityStoneCoverSectionResultEntities { get; } /// - /// Gets a of containing + /// Gets a of containing /// every entity found in the database. /// - DbSet StrengthStabilityPointConstructionSectionResultEntities { get; } + DbSet StabilityPointStructuresSectionResultEntities { get; } /// /// Gets a of containing Index: Application/Ringtoets/src/Application.Ringtoets.Storage/DbContext/RingtoetsEntities.Context.cs =================================================================== diff -u -rb3af39ba024b8e12fe238d85130697255db28c59 -rae14c5d4e4624fa87390e6d63bb419c648e12dda --- Application/Ringtoets/src/Application.Ringtoets.Storage/DbContext/RingtoetsEntities.Context.cs (.../RingtoetsEntities.Context.cs) (revision b3af39ba024b8e12fe238d85130697255db28c59) +++ Application/Ringtoets/src/Application.Ringtoets.Storage/DbContext/RingtoetsEntities.Context.cs (.../RingtoetsEntities.Context.cs) (revision ae14c5d4e4624fa87390e6d63bb419c648e12dda) @@ -55,6 +55,7 @@ public virtual DbSet AssessmentSectionEntities { get; set; } public virtual DbSet CalculationGroupEntities { get; set; } public virtual DbSet CharacteristicPointEntities { get; set; } + public virtual DbSet ClosingStructuresSectionResultEntities { get; set; } public virtual DbSet DikeProfileEntities { get; set; } public virtual DbSet DuneErosionSectionResultEntities { get; set; } public virtual DbSet FailureMechanismEntities { get; set; } @@ -85,20 +86,19 @@ public virtual DbSet ProjectEntities { get; set; } public virtual DbSet SoilLayerEntities { get; set; } public virtual DbSet SoilProfileEntities { get; set; } + public virtual DbSet StabilityPointStructuresSectionResultEntities { get; set; } public virtual DbSet StabilityStoneCoverSectionResultEntities { get; set; } public virtual DbSet StabilityStoneCoverWaveConditionsCalculationEntities { get; set; } public virtual DbSet StabilityStoneCoverWaveConditionsOutputEntities { get; set; } public virtual DbSet StochasticSoilModelEntities { get; set; } public virtual DbSet StochasticSoilProfileEntities { get; set; } public virtual DbSet StrengthStabilityLengthwiseConstructionSectionResultEntities { get; set; } - public virtual DbSet StrengthStabilityPointConstructionSectionResultEntities { get; set; } public virtual DbSet SurfaceLineEntities { get; set; } public virtual DbSet TechnicalInnovationSectionResultEntities { get; set; } public virtual DbSet VersionEntities { get; set; } public virtual DbSet WaterPressureAsphaltCoverSectionResultEntities { get; set; } public virtual DbSet WaveImpactAsphaltCoverSectionResultEntities { get; set; } public virtual DbSet WaveImpactAsphaltCoverWaveConditionsCalculationEntities { get; set; } public virtual DbSet WaveImpactAsphaltCoverWaveConditionsOutputEntities { get; set; } - public virtual DbSet ClosingStructuresSectionResultEntities { get; set; } } } Index: Application/Ringtoets/src/Application.Ringtoets.Storage/DbContext/RingtoetsEntities.Designer.cs =================================================================== diff -u -r3e5776001e28222d451a3af8488ba72cef6d017f -rae14c5d4e4624fa87390e6d63bb419c648e12dda --- Application/Ringtoets/src/Application.Ringtoets.Storage/DbContext/RingtoetsEntities.Designer.cs (.../RingtoetsEntities.Designer.cs) (revision 3e5776001e28222d451a3af8488ba72cef6d017f) +++ Application/Ringtoets/src/Application.Ringtoets.Storage/DbContext/RingtoetsEntities.Designer.cs (.../RingtoetsEntities.Designer.cs) (revision ae14c5d4e4624fa87390e6d63bb419c648e12dda) @@ -19,7 +19,7 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. -// T4 code generation is enabled for model 'D:\repos\WettelijkToetsInstrumentarium\Application\Ringtoets\src\Application.Ringtoets.Storage\DbContext\RingtoetsEntities.edmx'. +// T4 code generation is enabled for model 'D:\Projects\WTI\trunk\Application\Ringtoets\src\Application.Ringtoets.Storage\DbContext\RingtoetsEntities.edmx'. // To enable legacy code generation, change the value of the 'Code Generation Strategy' designer // property to 'Legacy ObjectContext'. This property is available in the Properties Window when the model // is open in the designer. Index: Application/Ringtoets/src/Application.Ringtoets.Storage/DbContext/RingtoetsEntities.edmx =================================================================== diff -u -rb3af39ba024b8e12fe238d85130697255db28c59 -rae14c5d4e4624fa87390e6d63bb419c648e12dda --- Application/Ringtoets/src/Application.Ringtoets.Storage/DbContext/RingtoetsEntities.edmx (.../RingtoetsEntities.edmx) (revision b3af39ba024b8e12fe238d85130697255db28c59) +++ Application/Ringtoets/src/Application.Ringtoets.Storage/DbContext/RingtoetsEntities.edmx (.../RingtoetsEntities.edmx) (revision ae14c5d4e4624fa87390e6d63bb419c648e12dda) @@ -432,6 +432,15 @@ + + + + + + + + + @@ -506,15 +515,6 @@ - - - - - - - - - @@ -1090,6 +1090,18 @@ + + + + + + + + + + + + @@ -1198,18 +1210,6 @@ - - - - - - - - - - - - @@ -1341,13 +1341,13 @@ + - @@ -1519,6 +1519,10 @@ + + + + @@ -1555,10 +1559,6 @@ - - - - @@ -1600,6 +1600,7 @@ + @@ -1630,13 +1631,13 @@ + - @@ -1688,6 +1689,10 @@ + + + + @@ -1772,6 +1777,10 @@ + + + + @@ -1780,10 +1789,6 @@ - - - - @@ -1876,11 +1881,6 @@ - - - - - @@ -1931,6 +1931,17 @@ + + + + + + + + + + + @@ -1991,6 +2002,7 @@ + @@ -2003,13 +2015,12 @@ + - - @@ -2392,6 +2403,16 @@ + + + + + + + + + + @@ -2478,16 +2499,6 @@ - - - - - - - - - - @@ -2714,6 +2725,18 @@ + + + + + + + + + + + + @@ -2966,38 +2989,38 @@ - + - + - + - + - + - + - + - + - + @@ -3278,29 +3301,6 @@ - - - - - - - - - - - - - - - - - - - - - - - @@ -3347,6 +3347,17 @@ + + + + + + + + + + + @@ -3757,6 +3768,16 @@ + + + + + + + + + + @@ -3837,16 +3858,6 @@ - - - - - - - - - - @@ -3937,17 +3948,6 @@ - - - - - - - - - - - Index: Application/Ringtoets/src/Application.Ringtoets.Storage/DbContext/RingtoetsEntities.edmx.diagram =================================================================== diff -u -rb3af39ba024b8e12fe238d85130697255db28c59 -rae14c5d4e4624fa87390e6d63bb419c648e12dda --- Application/Ringtoets/src/Application.Ringtoets.Storage/DbContext/RingtoetsEntities.edmx.diagram (.../RingtoetsEntities.edmx.diagram) (revision b3af39ba024b8e12fe238d85130697255db28c59) +++ Application/Ringtoets/src/Application.Ringtoets.Storage/DbContext/RingtoetsEntities.edmx.diagram (.../RingtoetsEntities.edmx.diagram) (revision ae14c5d4e4624fa87390e6d63bb419c648e12dda) @@ -4,54 +4,55 @@ - + - - - + + + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + - - - - - - - - - + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + - - - - + + + + @@ -63,6 +64,7 @@ + @@ -84,9 +86,9 @@ + - @@ -110,8 +112,6 @@ - - Index: Application/Ringtoets/src/Application.Ringtoets.Storage/DbContext/StabilityPointStructuresSectionResultEntity.cs =================================================================== diff -u --- Application/Ringtoets/src/Application.Ringtoets.Storage/DbContext/StabilityPointStructuresSectionResultEntity.cs (revision 0) +++ Application/Ringtoets/src/Application.Ringtoets.Storage/DbContext/StabilityPointStructuresSectionResultEntity.cs (revision ae14c5d4e4624fa87390e6d63bb419c648e12dda) @@ -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. + +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Application.Ringtoets.Storage.DbContext +{ + using System; + using System.Collections.Generic; + + public partial class StabilityPointStructuresSectionResultEntity + { + public long StabilityPointStructuresSectionResultEntityId { get; set; } + public long FailureMechanismSectionEntityId { get; set; } + public Nullable LayerTwoA { get; set; } + public Nullable LayerThree { get; set; } + + public virtual FailureMechanismSectionEntity FailureMechanismSectionEntity { get; set; } + } +} Fisheye: Tag ae14c5d4e4624fa87390e6d63bb419c648e12dda refers to a dead (removed) revision in file `Application/Ringtoets/src/Application.Ringtoets.Storage/DbContext/StrengthStabilityPointConstructionSectionResultEntity.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Application/Ringtoets/src/Application.Ringtoets.Storage/Read/AssessmentSectionEntityReadExtensions.cs =================================================================== diff -u -rb3af39ba024b8e12fe238d85130697255db28c59 -rae14c5d4e4624fa87390e6d63bb419c648e12dda --- Application/Ringtoets/src/Application.Ringtoets.Storage/Read/AssessmentSectionEntityReadExtensions.cs (.../AssessmentSectionEntityReadExtensions.cs) (revision b3af39ba024b8e12fe238d85130697255db28c59) +++ Application/Ringtoets/src/Application.Ringtoets.Storage/Read/AssessmentSectionEntityReadExtensions.cs (.../AssessmentSectionEntityReadExtensions.cs) (revision ae14c5d4e4624fa87390e6d63bb419c648e12dda) @@ -271,10 +271,10 @@ private static void ReadStrengthStabilityPointConstructionFailureMechanism(this AssessmentSectionEntity entity, AssessmentSection assessmentSection, ReadConversionCollector collector) { - var strengthStabilityPointConstructionFailureMechanismEntity = entity.FailureMechanismEntities.SingleOrDefault(fme => fme.FailureMechanismType == (int) FailureMechanismType.StrengthAndStabilityPointConstruction); + var strengthStabilityPointConstructionFailureMechanismEntity = entity.FailureMechanismEntities.SingleOrDefault(fme => fme.FailureMechanismType == (int) FailureMechanismType.StabilityPointStructures); if (strengthStabilityPointConstructionFailureMechanismEntity != null) { - strengthStabilityPointConstructionFailureMechanismEntity.ReadAsStrengthStabilityPointConstructionFailureMechanism(assessmentSection.StrengthStabilityPointConstruction, collector); + strengthStabilityPointConstructionFailureMechanismEntity.ReadAsStabilityPointStructuresFailureMechanism(assessmentSection.StabilityPointStructures, collector); } } } Index: Application/Ringtoets/src/Application.Ringtoets.Storage/Read/FailureMechanismEntityReadExtensions.cs =================================================================== diff -u -r3fad85f24665fdcfe75cba4e2f9ab30c2ca6a4b6 -rae14c5d4e4624fa87390e6d63bb419c648e12dda --- Application/Ringtoets/src/Application.Ringtoets.Storage/Read/FailureMechanismEntityReadExtensions.cs (.../FailureMechanismEntityReadExtensions.cs) (revision 3fad85f24665fdcfe75cba4e2f9ab30c2ca6a4b6) +++ Application/Ringtoets/src/Application.Ringtoets.Storage/Read/FailureMechanismEntityReadExtensions.cs (.../FailureMechanismEntityReadExtensions.cs) (revision ae14c5d4e4624fa87390e6d63bb419c648e12dda) @@ -27,6 +27,7 @@ using Application.Ringtoets.Storage.Read.GrassCoverErosionInwards; using Application.Ringtoets.Storage.Read.GrassCoverErosionOutwards; using Application.Ringtoets.Storage.Read.Piping; +using Application.Ringtoets.Storage.Read.StabilityPointStructures; using Application.Ringtoets.Storage.Read.WaveImpactAsphaltCover; using Core.Common.Base; using Ringtoets.ClosingStructures.Data; @@ -39,6 +40,7 @@ using Ringtoets.HydraRing.Data; using Ringtoets.Integration.Data.StandAlone; using Ringtoets.Piping.Data; +using Ringtoets.StabilityPointStructures.Data; using Ringtoets.StabilityStoneCover.Data; using Ringtoets.WaveImpactAsphaltCover.Data; @@ -327,7 +329,7 @@ entity.ReadCommonFailureMechanismProperties(failureMechanism, collector); entity.ReadClosingStructuresMechanismSectionResults(failureMechanism, collector); } - + private static void ReadClosingStructuresMechanismSectionResults(this FailureMechanismEntity entity, ClosingStructuresFailureMechanism failureMechanism, ReadConversionCollector collector) { foreach (var sectionResultEntity in entity.FailureMechanismSectionEntities.SelectMany(fms => fms.ClosingStructuresSectionResultEntities)) @@ -671,23 +673,23 @@ #endregion - #region Strength Stability Point Construction + #region Stability Point Structures /// /// Read the and use the information to update a . /// /// The to create for. /// The target of the read operation. /// The object keeping track of read operations. - internal static void ReadAsStrengthStabilityPointConstructionFailureMechanism(this FailureMechanismEntity entity, StrengthStabilityPointConstructionFailureMechanism failureMechanism, ReadConversionCollector collector) + internal static void ReadAsStabilityPointStructuresFailureMechanism(this FailureMechanismEntity entity, StabilityPointStructuresFailureMechanism failureMechanism, ReadConversionCollector collector) { entity.ReadCommonFailureMechanismProperties(failureMechanism, collector); - entity.ReadStrengthStabilityPointConstructionMechanismSectionResults(failureMechanism, collector); + entity.ReadStabilityPointStructuresMechanismSectionResults(failureMechanism, collector); } - private static void ReadStrengthStabilityPointConstructionMechanismSectionResults(this FailureMechanismEntity entity, StrengthStabilityPointConstructionFailureMechanism failureMechanism, ReadConversionCollector collector) + private static void ReadStabilityPointStructuresMechanismSectionResults(this FailureMechanismEntity entity, StabilityPointStructuresFailureMechanism failureMechanism, ReadConversionCollector collector) { - foreach (var sectionResultEntity in entity.FailureMechanismSectionEntities.SelectMany(fms => fms.StrengthStabilityPointConstructionSectionResultEntities)) + foreach (var sectionResultEntity in entity.FailureMechanismSectionEntities.SelectMany(fms => fms.StabilityPointStructuresSectionResultEntities)) { var failureMechanismSection = collector.Get(sectionResultEntity.FailureMechanismSectionEntity); var result = failureMechanism.SectionResults.Single(sr => ReferenceEquals(sr.Section, failureMechanismSection)); Index: Application/Ringtoets/src/Application.Ringtoets.Storage/Read/StabilityPointStructures/StabilityPointStructuresSectionResultEntityReadExtensions.cs =================================================================== diff -u --- Application/Ringtoets/src/Application.Ringtoets.Storage/Read/StabilityPointStructures/StabilityPointStructuresSectionResultEntityReadExtensions.cs (revision 0) +++ Application/Ringtoets/src/Application.Ringtoets.Storage/Read/StabilityPointStructures/StabilityPointStructuresSectionResultEntityReadExtensions.cs (revision ae14c5d4e4624fa87390e6d63bb419c648e12dda) @@ -0,0 +1,54 @@ +// 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 Application.Ringtoets.Storage.DbContext; +using Core.Common.Base.Data; +using Ringtoets.StabilityPointStructures.Data; + +namespace Application.Ringtoets.Storage.Read.StabilityPointStructures +{ + /// + /// This class defines extension methods for read operations for a based on the + /// . + /// + internal static class StabilityPointStructuresSectionResultEntityReadExtensions + { + /// + /// Reads the and use the information to update a + /// . + /// + /// The to create for. + /// The target of the read operation. + /// A new . + /// Thrown when is null. + internal static void Read(this StabilityPointStructuresSectionResultEntity entity, StabilityPointStructuresFailureMechanismSectionResult sectionResult) + { + if (sectionResult == null) + { + throw new ArgumentNullException("sectionResult"); + } + + sectionResult.AssessmentLayerTwoA = (RoundedDouble) entity.LayerTwoA.ToNullAsNaN(); + sectionResult.AssessmentLayerThree = (RoundedDouble) entity.LayerThree.ToNullAsNaN(); + } + } +} \ No newline at end of file Fisheye: Tag ae14c5d4e4624fa87390e6d63bb419c648e12dda refers to a dead (removed) revision in file `Application/Ringtoets/src/Application.Ringtoets.Storage/Read/StrengthStabilityPointConstructionSectionResultEntityReadExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Application.Ringtoets.Storage.Test.csproj =================================================================== diff -u -r3fad85f24665fdcfe75cba4e2f9ab30c2ca6a4b6 -rae14c5d4e4624fa87390e6d63bb419c648e12dda --- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Application.Ringtoets.Storage.Test.csproj (.../Application.Ringtoets.Storage.Test.csproj) (revision 3fad85f24665fdcfe75cba4e2f9ab30c2ca6a4b6) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Application.Ringtoets.Storage.Test.csproj (.../Application.Ringtoets.Storage.Test.csproj) (revision ae14c5d4e4624fa87390e6d63bb419c648e12dda) @@ -139,8 +139,8 @@ - - + + @@ -176,7 +176,7 @@ - + @@ -230,6 +230,10 @@ {87c2c553-c0bc-40bf-b1ea-b83bff357f27} Ringtoets.Revetment.Data + + {3D4B9740-8348-4434-8D77-B611FC6EE57F} + Ringtoets.StabilityPointStructures.Data + {567E0B69-5280-41CE-ADD6-443725A61C86} Ringtoets.WaveImpactAsphaltCover.Data Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/AssessmentSectionCreateExtensionsTest.cs =================================================================== diff -u -r1d86c8daf73d71b72c7a105b5f564ae7480a8d7f -rae14c5d4e4624fa87390e6d63bb419c648e12dda --- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/AssessmentSectionCreateExtensionsTest.cs (.../AssessmentSectionCreateExtensionsTest.cs) (revision 1d86c8daf73d71b72c7a105b5f564ae7480a8d7f) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/AssessmentSectionCreateExtensionsTest.cs (.../AssessmentSectionCreateExtensionsTest.cs) (revision ae14c5d4e4624fa87390e6d63bb419c648e12dda) @@ -101,7 +101,7 @@ Assert.IsNotNull(entity.FailureMechanismEntities.SingleOrDefault(fme => fme.FailureMechanismType == (short) FailureMechanismType.StructureHeight)); Assert.IsNotNull(entity.FailureMechanismEntities.SingleOrDefault(fme => fme.FailureMechanismType == (short) FailureMechanismType.ReliabilityClosingOfStructure)); Assert.IsNotNull(entity.FailureMechanismEntities.SingleOrDefault(fme => fme.FailureMechanismType == (short) FailureMechanismType.PipingAtStructure)); - Assert.IsNotNull(entity.FailureMechanismEntities.SingleOrDefault(fme => fme.FailureMechanismType == (short) FailureMechanismType.StrengthAndStabilityPointConstruction)); + Assert.IsNotNull(entity.FailureMechanismEntities.SingleOrDefault(fme => fme.FailureMechanismType == (short) FailureMechanismType.StabilityPointStructures)); Assert.IsNotNull(entity.FailureMechanismEntities.SingleOrDefault(fme => fme.FailureMechanismType == (short) FailureMechanismType.StrengthAndStabilityParallelConstruction)); Assert.IsNotNull(entity.FailureMechanismEntities.SingleOrDefault(fme => fme.FailureMechanismType == (short) FailureMechanismType.DuneErosion)); Assert.IsNotNull(entity.FailureMechanismEntities.SingleOrDefault(fme => fme.FailureMechanismType == (short) FailureMechanismType.TechnicalInnovations)); Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/StabilityPointStructures/StabilityPointStructuresFailureMechanismCreateExtensionsTest.cs =================================================================== diff -u --- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/StabilityPointStructures/StabilityPointStructuresFailureMechanismCreateExtensionsTest.cs (revision 0) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/StabilityPointStructures/StabilityPointStructuresFailureMechanismCreateExtensionsTest.cs (revision ae14c5d4e4624fa87390e6d63bb419c648e12dda) @@ -0,0 +1,121 @@ +// 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.Linq; +using Application.Ringtoets.Storage.Create; +using Application.Ringtoets.Storage.Create.StabilityPointStructures; +using Application.Ringtoets.Storage.DbContext; +using Application.Ringtoets.Storage.TestUtil; +using NUnit.Framework; +using Ringtoets.StabilityPointStructures.Data; + +namespace Application.Ringtoets.Storage.Test.Create.StabilityPointStructures +{ + [TestFixture] + public class StabilityPointStructuresFailureMechanismCreateExtensionsTest + { + [Test] + public void Create_WithoutPersistenceRegistry_ThrowsArgumentNullException() + { + // Setup + var failureMechanism = new StabilityPointStructuresFailureMechanism(); + + // Call + TestDelegate test = () => failureMechanism.Create(null); + + // Assert + var paramName = Assert.Throws(test).ParamName; + Assert.AreEqual("registry", paramName); + } + + [Test] + [TestCase(true)] + [TestCase(false)] + public void Create_WithCollectorAndPropertiesSet_ReturnsExpectedEntity(bool isRelevant) + { + // Setup + var failureMechanism = new StabilityPointStructuresFailureMechanism + { + IsRelevant = isRelevant, + Comments = "Some text" + }; + var registry = new PersistenceRegistry(); + + // Call + var entity = failureMechanism.Create(registry); + + // Assert + Assert.IsNotNull(entity); + Assert.AreEqual((short) FailureMechanismType.StabilityPointStructures, entity.FailureMechanismType); + Assert.AreEqual(Convert.ToByte(isRelevant), entity.IsRelevant); + Assert.AreEqual(failureMechanism.Comments, entity.Comments); + } + + [Test] + public void Create_StringPropertiesDoNotShareReference() + { + // Setup + const string originalComments = "Some text"; + var failureMechanism = new StabilityPointStructuresFailureMechanism + { + Comments = originalComments + }; + var registry = new PersistenceRegistry(); + + // Call + FailureMechanismEntity entity = failureMechanism.Create(registry); + + // Assert + Assert.AreNotSame(originalComments, entity.Comments, + "To create stable binary representations/fingerprints, it's really important that strings are not shared."); + Assert.AreEqual(originalComments, entity.Comments); + } + + [Test] + public void Create_WithoutSections_EmptyFailureMechanismSectionEntities() + { + // Setup + var failureMechanism = new StabilityPointStructuresFailureMechanism(); + + // Call + var entity = failureMechanism.Create(new PersistenceRegistry()); + + // Assert + Assert.IsEmpty(entity.FailureMechanismSectionEntities); + } + + [Test] + public void Create_WithSections_FailureMechanismSectionEntitiesCreated() + { + // Setup + var failureMechanism = new StabilityPointStructuresFailureMechanism(); + failureMechanism.AddSection(new TestFailureMechanismSection()); + + // Call + var entity = failureMechanism.Create(new PersistenceRegistry()); + + // Assert + Assert.AreEqual(1, entity.FailureMechanismSectionEntities.Count); + Assert.AreEqual(1, entity.FailureMechanismSectionEntities.SelectMany(fms => fms.StabilityPointStructuresSectionResultEntities).Count()); + } + } +} \ No newline at end of file Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/StabilityPointStructures/StabilityPointStructuresFailureMechanismSectionResultCreateExtensionsTest.cs =================================================================== diff -u --- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/StabilityPointStructures/StabilityPointStructuresFailureMechanismSectionResultCreateExtensionsTest.cs (revision 0) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/StabilityPointStructures/StabilityPointStructuresFailureMechanismSectionResultCreateExtensionsTest.cs (revision ae14c5d4e4624fa87390e6d63bb419c648e12dda) @@ -0,0 +1,101 @@ +// 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 Application.Ringtoets.Storage.Create; +using Application.Ringtoets.Storage.Create.StabilityPointStructures; +using Application.Ringtoets.Storage.TestUtil; +using Core.Common.Base.Data; +using NUnit.Framework; +using Ringtoets.StabilityPointStructures.Data; + +namespace Application.Ringtoets.Storage.Test.Create.StabilityPointStructures +{ + [TestFixture] + public class StabilityPointStructuresFailureMechanismSectionResultCreateExtensionsTest + { + [Test] + public void Create_WithoutPersistenceRegistry_ThrowsArgumentNullException() + { + // Setup + var sectionResult = new StabilityPointStructuresFailureMechanismSectionResult(new TestFailureMechanismSection()); + + // Call + TestDelegate test = () => sectionResult.Create(null); + + // Assert + Assert.Throws(test); + } + + [Test] + public void Create_VariousResults_ReturnsEntity( + [Values(true, false)] bool assessmentLayerOneResult, + [Values(0.2, 0.523)] double assessmentLayerTwoAResult, + [Values(3.2, 4.5)] double assessmentLayerThreeResult) + { + // Setup + var sectionResult = new StabilityPointStructuresFailureMechanismSectionResult(new TestFailureMechanismSection()) + { + AssessmentLayerTwoA = (RoundedDouble) assessmentLayerTwoAResult, + AssessmentLayerThree = (RoundedDouble) assessmentLayerThreeResult + }; + + // Call + var result = sectionResult.Create(new PersistenceRegistry()); + + // Assert + Assert.AreEqual(assessmentLayerTwoAResult, result.LayerTwoA); + Assert.AreEqual(assessmentLayerThreeResult, result.LayerThree); + } + + [Test] + public void Create_WithNaNLevel2aResult_ReturnsEntityWithExpectedResults() + { + // Setup + var sectionResult = new StabilityPointStructuresFailureMechanismSectionResult(new TestFailureMechanismSection()) + { + AssessmentLayerTwoA = (RoundedDouble) double.NaN + }; + + // Call + var result = sectionResult.Create(new PersistenceRegistry()); + + // Assert + Assert.IsNull(result.LayerTwoA); + } + + [Test] + public void Create_WithNaNLevel3Result_ReturnsEntityWithExpectedResults() + { + // Setup + var sectionResult = new StabilityPointStructuresFailureMechanismSectionResult(new TestFailureMechanismSection()) + { + AssessmentLayerThree = (RoundedDouble) double.NaN + }; + + // Call + var result = sectionResult.Create(new PersistenceRegistry()); + + // Assert + Assert.IsNull(result.LayerThree); + } + } +} \ No newline at end of file Fisheye: Tag ae14c5d4e4624fa87390e6d63bb419c648e12dda refers to a dead (removed) revision in file `Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/StrengthStabilityPointConstruction/StrengthStabilityPointConstructionFailureMechanismCreateExtensionsTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag ae14c5d4e4624fa87390e6d63bb419c648e12dda refers to a dead (removed) revision in file `Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/StrengthStabilityPointConstruction/StrengthStabilityPointConstructionFailureMechanismSectionResultCreateExtensionsTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/IntegrationTests/StorageSqLiteIntegrationTest.cs =================================================================== diff -u -r3fad85f24665fdcfe75cba4e2f9ab30c2ca6a4b6 -rae14c5d4e4624fa87390e6d63bb419c648e12dda --- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/IntegrationTests/StorageSqLiteIntegrationTest.cs (.../StorageSqLiteIntegrationTest.cs) (revision 3fad85f24665fdcfe75cba4e2f9ab30c2ca6a4b6) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/IntegrationTests/StorageSqLiteIntegrationTest.cs (.../StorageSqLiteIntegrationTest.cs) (revision ae14c5d4e4624fa87390e6d63bb419c648e12dda) @@ -50,6 +50,7 @@ using Ringtoets.Piping.Data; using Ringtoets.Piping.Primitives; using Ringtoets.Revetment.Data; +using Ringtoets.StabilityPointStructures.Data; using Ringtoets.StabilityStoneCover.Data; using Ringtoets.WaveImpactAsphaltCover.Data; @@ -336,8 +337,8 @@ expectedAssessmentSection.StabilityStoneCover.SectionResults, actualAssessmentSection.StabilityStoneCover.SectionResults); AssertFailureMechanismSectionResults( - expectedAssessmentSection.StrengthStabilityPointConstruction.SectionResults, - actualAssessmentSection.StrengthStabilityPointConstruction.SectionResults); + expectedAssessmentSection.StabilityPointStructures.SectionResults, + actualAssessmentSection.StabilityPointStructures.SectionResults); } } @@ -552,7 +553,7 @@ } } - private static void AssertFailureMechanismSectionResults(IEnumerable expectedSectionResults, IEnumerable actualSectionResults) + private static void AssertFailureMechanismSectionResults(IEnumerable expectedSectionResults, IEnumerable actualSectionResults) { var expectedSectionResultsArray = expectedSectionResults.ToArray(); var actualSectionResultsArray = actualSectionResults.ToArray(); @@ -561,8 +562,8 @@ for (var i = 0; i < expectedSectionResultsArray.Length; i++) { - StrengthStabilityPointConstructionFailureMechanismSectionResult expectedSection = expectedSectionResultsArray[i]; - StrengthStabilityPointConstructionFailureMechanismSectionResult actualSection = actualSectionResultsArray[i]; + StabilityPointStructuresFailureMechanismSectionResult expectedSection = expectedSectionResultsArray[i]; + StabilityPointStructuresFailureMechanismSectionResult actualSection = actualSectionResultsArray[i]; Assert.AreEqual(expectedSection.AssessmentLayerTwoA, actualSection.AssessmentLayerTwoA); Assert.AreEqual(expectedSection.AssessmentLayerThree, actualSection.AssessmentLayerThree); Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/AssessmentSectionEntityReadExtensionsTest.cs =================================================================== diff -u -rb3af39ba024b8e12fe238d85130697255db28c59 -rae14c5d4e4624fa87390e6d63bb419c648e12dda --- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/AssessmentSectionEntityReadExtensionsTest.cs (.../AssessmentSectionEntityReadExtensionsTest.cs) (revision b3af39ba024b8e12fe238d85130697255db28c59) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/AssessmentSectionEntityReadExtensionsTest.cs (.../AssessmentSectionEntityReadExtensionsTest.cs) (revision ae14c5d4e4624fa87390e6d63bb419c648e12dda) @@ -805,7 +805,7 @@ entity.FailureMechanismEntities.Add(CreateFailureMechanismEntity(isRelevant, microstabilityEntityComment, FailureMechanismType.Microstability)); entity.FailureMechanismEntities.Add(CreateFailureMechanismEntity(isRelevant, structureHeightEntityComment, FailureMechanismType.StructureHeight)); entity.FailureMechanismEntities.Add(CreateFailureMechanismEntity(isRelevant, closingEntityComment, FailureMechanismType.ReliabilityClosingOfStructure)); - entity.FailureMechanismEntities.Add(CreateFailureMechanismEntity(isRelevant, failingOfConstructionPointEntityComment, FailureMechanismType.StrengthAndStabilityPointConstruction)); + entity.FailureMechanismEntities.Add(CreateFailureMechanismEntity(isRelevant, failingOfConstructionPointEntityComment, FailureMechanismType.StabilityPointStructures)); entity.FailureMechanismEntities.Add(CreateFailureMechanismEntity(isRelevant, failingOfConstructionLengthwiseEntityComment, FailureMechanismType.StrengthAndStabilityParallelConstruction)); entity.FailureMechanismEntities.Add(CreateFailureMechanismEntity(isRelevant, waterPressureEntityComment, FailureMechanismType.WaterOverpressureAsphaltRevetment)); entity.FailureMechanismEntities.Add(CreateFailureMechanismEntity(isRelevant, grassCoverSlipoffOutwardsEntityComment, FailureMechanismType.GrassRevetmentSlidingOutwards)); @@ -824,7 +824,7 @@ AssertFailureMechanismEqual(isRelevant, microstabilityEntityComment, 2, section.Microstability); AssertFailureMechanismEqual(isRelevant, structureHeightEntityComment, 2, section.HeightStructures); AssertFailureMechanismEqual(isRelevant, closingEntityComment, 2, section.ClosingStructures); - AssertFailureMechanismEqual(isRelevant, failingOfConstructionPointEntityComment, 2, section.StrengthStabilityPointConstruction); + AssertFailureMechanismEqual(isRelevant, failingOfConstructionPointEntityComment, 2, section.StabilityPointStructures); AssertFailureMechanismEqual(isRelevant, failingOfConstructionLengthwiseEntityComment, 2, section.StrengthStabilityLengthwiseConstruction); AssertFailureMechanismEqual(isRelevant, waterPressureEntityComment, 2, section.WaterPressureAsphaltCover); AssertFailureMechanismEqual(isRelevant, grassCoverSlipoffOutwardsEntityComment, 2, section.GrassCoverSlipOffOutwards); Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/StabilityPointStructures/StabilityPointStructuresSectionResultEntityReadExtensionsTest.cs =================================================================== diff -u --- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/StabilityPointStructures/StabilityPointStructuresSectionResultEntityReadExtensionsTest.cs (revision 0) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/StabilityPointStructures/StabilityPointStructuresSectionResultEntityReadExtensionsTest.cs (revision ae14c5d4e4624fa87390e6d63bb419c648e12dda) @@ -0,0 +1,121 @@ +// 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 Application.Ringtoets.Storage.DbContext; +using Application.Ringtoets.Storage.Read; +using Application.Ringtoets.Storage.Read.StabilityPointStructures; +using Application.Ringtoets.Storage.TestUtil; +using NUnit.Framework; +using Ringtoets.StabilityPointStructures.Data; + +namespace Application.Ringtoets.Storage.Test.Read.StabilityPointStructures +{ + [TestFixture] + public class StabilityPointStructuresSectionResultEntityReadExtensionsTest + { + [Test] + public void Read_SectionResultIsNull_ThrowArgumentNullException() + { + // Setup + var entity = new StabilityPointStructuresSectionResultEntity(); + + // Call + TestDelegate call = () => entity.Read(null); + + // Assert + string paramName = Assert.Throws(call).ParamName; + Assert.AreEqual("sectionResult", paramName); + } + + [Test] + public void Read_WithDecimalParameterValues_ReturnStabilityPointStructuresSectionResultWithDoubleParameterValues() + { + // Setup + var random = new Random(21); + double layerThree = random.NextDouble(); + double layerTwoA = random.NextDouble(); + var collector = new ReadConversionCollector(); + + var failureMechanismSectionEntity = new FailureMechanismSectionEntity(); + collector.Read(failureMechanismSectionEntity, new TestFailureMechanismSection()); + var entity = new StabilityPointStructuresSectionResultEntity + { + LayerThree = layerThree, + LayerTwoA = layerTwoA, + FailureMechanismSectionEntity = failureMechanismSectionEntity + }; + var sectionResult = new StabilityPointStructuresFailureMechanismSectionResult(new TestFailureMechanismSection()); + + // Call + entity.Read(sectionResult); + + // Assert + Assert.IsNotNull(sectionResult); + Assert.AreEqual(layerTwoA, sectionResult.AssessmentLayerTwoA, 1e-6); + Assert.AreEqual(layerThree, sectionResult.AssessmentLayerThree, 1e-6); + } + + [Test] + public void Read_WithNullLayerTwoA_ReturnStabilityPointStructuresSectionResultWithNullParameters() + { + // Setup + var collector = new ReadConversionCollector(); + var failureMechanismSectionEntity = new FailureMechanismSectionEntity(); + collector.Read(failureMechanismSectionEntity, new TestFailureMechanismSection()); + var entity = new StabilityPointStructuresSectionResultEntity + { + LayerTwoA = null, + LayerThree = new Random(21).NextDouble(), + FailureMechanismSectionEntity = failureMechanismSectionEntity + }; + var sectionResult = new StabilityPointStructuresFailureMechanismSectionResult(new TestFailureMechanismSection()); + + // Call + entity.Read(sectionResult); + + // Assert + Assert.IsNaN(sectionResult.AssessmentLayerTwoA); + } + + [Test] + public void Read_WithNullLayerThree_ReturnStabilityPointStructuresSectionResultWithNullParameters() + { + // Setup + var collector = new ReadConversionCollector(); + var failureMechanismSectionEntity = new FailureMechanismSectionEntity(); + collector.Read(failureMechanismSectionEntity, new TestFailureMechanismSection()); + var entity = new StabilityPointStructuresSectionResultEntity + { + LayerTwoA = new Random(21).NextDouble(), + LayerThree = null, + FailureMechanismSectionEntity = failureMechanismSectionEntity + }; + var sectionResult = new StabilityPointStructuresFailureMechanismSectionResult(new TestFailureMechanismSection()); + + // Call + entity.Read(sectionResult); + + // Assert + Assert.IsNaN(sectionResult.AssessmentLayerThree); + } + } +} \ No newline at end of file Fisheye: Tag ae14c5d4e4624fa87390e6d63bb419c648e12dda refers to a dead (removed) revision in file `Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/StrengthStabilityPointConstructionSectionResultEntityReadExtensionsTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/packages.config =================================================================== diff -u -rfea3ed82dfb6dfcad535eef16efcbaa9c01564ed -rae14c5d4e4624fa87390e6d63bb419c648e12dda --- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/packages.config (.../packages.config) (revision fea3ed82dfb6dfcad535eef16efcbaa9c01564ed) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/packages.config (.../packages.config) (revision ae14c5d4e4624fa87390e6d63bb419c648e12dda) @@ -1,5 +1,4 @@  - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + STKWp + + + Kunstwerken - Sterkte en stabiliteit puntconstructies + + \ No newline at end of file Index: Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.Data/Ringtoets.StabilityPointStructures.Data.csproj =================================================================== diff -u -rca5e7dfd4081b7caffd668eb40fe80ea20da6862 -rae14c5d4e4624fa87390e6d63bb419c648e12dda --- Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.Data/Ringtoets.StabilityPointStructures.Data.csproj (.../Ringtoets.StabilityPointStructures.Data.csproj) (revision ca5e7dfd4081b7caffd668eb40fe80ea20da6862) +++ Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.Data/Ringtoets.StabilityPointStructures.Data.csproj (.../Ringtoets.StabilityPointStructures.Data.csproj) (revision ae14c5d4e4624fa87390e6d63bb419c648e12dda) @@ -40,12 +40,38 @@ Properties\GlobalAssembly.cs + + True + True + Resources.resx + + + Copying.licenseheader + + + {3BBFD65B-B277-4E50-AE6D-BD24C3434609} + Core.Common.Base + False + + + {D4200F43-3F72-4F42-AF0A-8CED416A38EC} + Ringtoets.Common.Data + False + + + + + PublicResXFileCodeGenerator + Resources.Designer.cs + Designer + + + + + \ No newline at end of file Index: Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Forms.Test/Ringtoets.StabilityPointStructures.Forms.Test.csproj =================================================================== diff -u -rca5e7dfd4081b7caffd668eb40fe80ea20da6862 -rae14c5d4e4624fa87390e6d63bb419c648e12dda --- Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Forms.Test/Ringtoets.StabilityPointStructures.Forms.Test.csproj (.../Ringtoets.StabilityPointStructures.Forms.Test.csproj) (revision ca5e7dfd4081b7caffd668eb40fe80ea20da6862) +++ Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Forms.Test/Ringtoets.StabilityPointStructures.Forms.Test.csproj (.../Ringtoets.StabilityPointStructures.Forms.Test.csproj) (revision ae14c5d4e4624fa87390e6d63bb419c648e12dda) @@ -37,20 +37,65 @@ none + + ..\..\..\..\packages\NUnit.2.6.4\lib\nunit.framework.dll + True + + + ..\..\..\..\lib\NUnitForms.dll + + Properties\GlobalAssembly.cs + + Copying.licenseheader + + + + {3BBFD65B-B277-4E50-AE6D-BD24C3434609} + Core.Common.Base + + + {9a2d67e6-26ac-4d17-b11a-2b4372f2f572} + Core.Common.Controls + + + {F49BD8B2-332A-4C91-A196-8CCE0A2C7D98} + Core.Common.Utils + + + {D4200F43-3F72-4F42-AF0A-8CED416A38EC} + Ringtoets.Common.Data + + + {4d840673-3812-4338-a352-84854e32b8a0} + Ringtoets.Common.Forms + + + {4843D6E5-066F-4795-94F5-1D53932DD03C} + Ringtoets.Common.Data.TestUtil + + + {3D4B9740-8348-4434-8D77-B611FC6EE57F} + Ringtoets.StabilityPointStructures.Data + + + {D5F0A6B0-8710-4345-ABA1-D934C8E6783D} + Ringtoets.StabilityPointStructures.Forms + + + + + \ No newline at end of file