Index: Application/Ringtoets/src/Application.Ringtoets.Migration.Core/EmbeddedResources/DatabaseStructure17.2.sql =================================================================== diff -u -rafec64f46fa0be3500d2d7b357ad7ce589b5dc66 -rc001c83924455e2040eda334a044058f64d0f800 --- Application/Ringtoets/src/Application.Ringtoets.Migration.Core/EmbeddedResources/DatabaseStructure17.2.sql (.../DatabaseStructure17.2.sql) (revision afec64f46fa0be3500d2d7b357ad7ce589b5dc66) +++ Application/Ringtoets/src/Application.Ringtoets.Migration.Core/EmbeddedResources/DatabaseStructure17.2.sql (.../DatabaseStructure17.2.sql) (revision c001c83924455e2040eda334a044058f64d0f800) @@ -1,6 +1,6 @@ /* ---------------------------------------------------- */ /* Generated by Enterprise Architect Version 12.0 */ -/* Created On : 24-May-2017 09:11:16 */ +/* Created On : 29-May-2017 10:11:01 AM */ /* DBMS : SQLite */ /* ---------------------------------------------------- */ @@ -1079,8 +1079,8 @@ 'HeightStructureEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, 'FailureMechanismEntityId' INTEGER NOT NULL, 'Order' INT (4) NOT NULL, - 'Name' VARCHAR (260), - 'Id' VARCHAR (260), + 'Name' VARCHAR (260) NOT NULL, + 'Id' VARCHAR (260) NOT NULL, 'X' REAL, 'Y' REAL, 'StructureNormalOrientation' REAL, @@ -1145,8 +1145,8 @@ 'ClosingStructureEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, 'FailureMechanismEntityId' INTEGER NOT NULL, 'Order' INT (4) NOT NULL, - 'Name' VARCHAR (260), - 'Id' VARCHAR (260), + 'Name' VARCHAR (260) NOT NULL, + 'Id' VARCHAR (260) NOT NULL, 'X' REAL, 'Y' REAL, 'StructureNormalOrientation' REAL, @@ -1249,8 +1249,8 @@ 'StabilityPointStructureEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, 'FailureMechanismEntityId' INTEGER NOT NULL, 'Order' INT (4) NOT NULL, - 'Name' VARCHAR (260), - 'Id' VARCHAR (260), + 'Name' VARCHAR (260) NOT NULL, + 'Id' VARCHAR (260) NOT NULL, 'X' REAL, 'Y' REAL, 'StructureNormalOrientation' REAL, Index: Application/Ringtoets/src/Application.Ringtoets.Migration.Core/EmbeddedResources/Migration_17.1_17.2.sql =================================================================== diff -u -rc1ed7c2c08607f068dec05a7aee55c824c764f4f -rc001c83924455e2040eda334a044058f64d0f800 --- Application/Ringtoets/src/Application.Ringtoets.Migration.Core/EmbeddedResources/Migration_17.1_17.2.sql (.../Migration_17.1_17.2.sql) (revision c1ed7c2c08607f068dec05a7aee55c824c764f4f) +++ Application/Ringtoets/src/Application.Ringtoets.Migration.Core/EmbeddedResources/Migration_17.1_17.2.sql (.../Migration_17.1_17.2.sql) (revision c001c83924455e2040eda334a044058f64d0f800) @@ -385,7 +385,6 @@ AND SPS.[FailuremechanismEntityId] = [FailuremechanismEntityId]) AS Suffix FROM [SOURCEPROJECT].StabilityPointStructureEntity SPS JOIN (SELECT MAX(LENGTH([Id])) AS MaxLength FROM [SOURCEPROJECT].StabilityPointStructureEntity)); -SELECT * FROM [SOURCEPROJECT].StabilityPointStructureEntity; INSERT INTO StabilityPointStructuresCalculationEntity SELECT * FROM [SOURCEPROJECT].StabilityPointStructuresCalculationEntity; INSERT INTO StabilityPointStructuresFailureMechanismMetaEntity ( [StabilityPointStructuresFailureMechanismMetaEntityId], @@ -401,7 +400,7 @@ CASE WHEN COUNT([StabilityPointStructureEntityId]) THEN "Onbekend" ELSE NULL END FROM [SOURCEPROJECT].StabilityPointStructuresFailureMechanismMetaEntity LEFT JOIN [SOURCEPROJECT].ForeshoreProfileEntity USING (FailureMechanismEntityId) - LEFT JOIN StabilityPointStructureEntity USING (FailureMechanismEntityId) + LEFT JOIN [SOURCEPROJECT].StabilityPointStructureEntity USING (FailureMechanismEntityId) GROUP BY FailureMechanismEntityId; INSERT INTO StabilityPointStructuresOutputEntity SELECT * FROM [SOURCEPROJECT].StabilityPointStructuresOutputEntity; INSERT INTO StabilityPointStructuresSectionResultEntity SELECT * FROM [SOURCEPROJECT].StabilityPointStructuresSectionResultEntity; Index: Application/Ringtoets/src/Application.Ringtoets.Storage/DbContext/RingtoetsEntities.Designer.cs =================================================================== diff -u -r3fb0df0ed6e64657154700ee7706e035d5bf99f5 -rc001c83924455e2040eda334a044058f64d0f800 --- Application/Ringtoets/src/Application.Ringtoets.Storage/DbContext/RingtoetsEntities.Designer.cs (.../RingtoetsEntities.Designer.cs) (revision 3fb0df0ed6e64657154700ee7706e035d5bf99f5) +++ Application/Ringtoets/src/Application.Ringtoets.Storage/DbContext/RingtoetsEntities.Designer.cs (.../RingtoetsEntities.Designer.cs) (revision c001c83924455e2040eda334a044058f64d0f800) @@ -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:\Checkout\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 -rafec64f46fa0be3500d2d7b357ad7ce589b5dc66 -rc001c83924455e2040eda334a044058f64d0f800 --- Application/Ringtoets/src/Application.Ringtoets.Storage/DbContext/RingtoetsEntities.edmx (.../RingtoetsEntities.edmx) (revision afec64f46fa0be3500d2d7b357ad7ce589b5dc66) +++ Application/Ringtoets/src/Application.Ringtoets.Storage/DbContext/RingtoetsEntities.edmx (.../RingtoetsEntities.edmx) (revision c001c83924455e2040eda334a044058f64d0f800) @@ -4,7 +4,7 @@ - + @@ -68,8 +68,8 @@ - - + + @@ -478,8 +478,8 @@ - - + + @@ -754,8 +754,8 @@ - - + + @@ -3202,8 +3202,8 @@ - - + + @@ -3704,8 +3704,8 @@ - - + + @@ -4020,8 +4020,8 @@ - - + + Index: Application/Ringtoets/src/Application.Ringtoets.Storage/DbContext/RingtoetsEntities.edmx.diagram =================================================================== diff -u -rafec64f46fa0be3500d2d7b357ad7ce589b5dc66 -rc001c83924455e2040eda334a044058f64d0f800 --- Application/Ringtoets/src/Application.Ringtoets.Storage/DbContext/RingtoetsEntities.edmx.diagram (.../RingtoetsEntities.edmx.diagram) (revision afec64f46fa0be3500d2d7b357ad7ce589b5dc66) +++ Application/Ringtoets/src/Application.Ringtoets.Storage/DbContext/RingtoetsEntities.edmx.diagram (.../RingtoetsEntities.edmx.diagram) (revision c001c83924455e2040eda334a044058f64d0f800) @@ -9,73 +9,73 @@ - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - + + + + + + + + + - - + + - - - - - - - - - - - - - + + + + + + + + + + + + + - - - - - + + + + + Index: Application/Ringtoets/src/Application.Ringtoets.Storage/Read/FailureMechanismEntityReadExtensions.cs =================================================================== diff -u -r99f60b3252ff2b7e79b482f4c0ac0099914b9928 -rc001c83924455e2040eda334a044058f64d0f800 --- Application/Ringtoets/src/Application.Ringtoets.Storage/Read/FailureMechanismEntityReadExtensions.cs (.../FailureMechanismEntityReadExtensions.cs) (revision 99f60b3252ff2b7e79b482f4c0ac0099914b9928) +++ Application/Ringtoets/src/Application.Ringtoets.Storage/Read/FailureMechanismEntityReadExtensions.cs (.../FailureMechanismEntityReadExtensions.cs) (revision c001c83924455e2040eda334a044058f64d0f800) @@ -936,15 +936,15 @@ private static void ReadStabilityPointStructures(this FailureMechanismEntity entity, StructureCollection stabilityPointStructures, - string stabilityPointStructuresSourcePath, + string sourcePath, ReadConversionCollector collector) { - if (stabilityPointStructuresSourcePath != null) + if (sourcePath != null) { stabilityPointStructures.AddRange(entity.StabilityPointStructureEntities .OrderBy(fpe => fpe.Order) .Select(structureEntity => structureEntity.Read(collector)), - stabilityPointStructuresSourcePath); + sourcePath); } } Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/FailureMechanismEntityReadExtensionsTest.cs =================================================================== diff -u -r99f60b3252ff2b7e79b482f4c0ac0099914b9928 -rc001c83924455e2040eda334a044058f64d0f800 --- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/FailureMechanismEntityReadExtensionsTest.cs (.../FailureMechanismEntityReadExtensionsTest.cs) (revision 99f60b3252ff2b7e79b482f4c0ac0099914b9928) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/FailureMechanismEntityReadExtensionsTest.cs (.../FailureMechanismEntityReadExtensionsTest.cs) (revision c001c83924455e2040eda334a044058f64d0f800) @@ -1401,6 +1401,36 @@ } [Test] + public void ReadAsHeightStructuresFailureMechanism_WithoutHeightStructuresWithSourcePath_ReturnsFailureMechanismWithSourcePathSet() + { + // Setup + const string path = "path/to/closingStructues"; + var entity = new FailureMechanismEntity + { + CalculationGroupEntity = new CalculationGroupEntity(), + HeightStructuresFailureMechanismMetaEntities = + { + new HeightStructuresFailureMechanismMetaEntity + { + N = 7, + HeightStructureCollectionSourcePath = path + } + } + }; + var collector = new ReadConversionCollector(); + var failureMechanism = new HeightStructuresFailureMechanism(); + + // Call + entity.ReadAsHeightStructuresFailureMechanism(failureMechanism, collector); + + // Assert + StructureCollection heightStructures = + failureMechanism.HeightStructures; + Assert.AreEqual(0, heightStructures.Count); + Assert.AreEqual(path, heightStructures.SourcePath); + } + + [Test] public void ReadAsHeightStructuresFailureMechanism_WithHeightStructures_ReturnFailureMechanismWithHeightStructuresSet() { // Setup @@ -1602,6 +1632,35 @@ } [Test] + public void ReadAsClosingStructuresFailureMechanism_WithoutClosingStructuresWithSourcePath_ReturnsFailureMechanismWithSourcePathSet() + { + // Setup + const string path = "path/to/closingStructues"; + var entity = new FailureMechanismEntity + { + CalculationGroupEntity = new CalculationGroupEntity(), + ClosingStructuresFailureMechanismMetaEntities = + { + new ClosingStructuresFailureMechanismMetaEntity + { + ClosingStructureCollectionSourcePath = path + } + } + }; + var collector = new ReadConversionCollector(); + var failureMechanism = new ClosingStructuresFailureMechanism(); + + // Call + entity.ReadAsClosingStructuresFailureMechanism(failureMechanism, collector); + + // Assert + StructureCollection closingStructures = + failureMechanism.ClosingStructures; + Assert.AreEqual(0, closingStructures.Count); + Assert.AreEqual(path, closingStructures.SourcePath); + } + + [Test] public void ReadAsClosingStructuresFailureMechanism_WithClosingStructures_ReturnFailureMechanismWithClosingStructuresSet() { // Setup Index: build/DatabaseStructure.sql =================================================================== diff -u -rafec64f46fa0be3500d2d7b357ad7ce589b5dc66 -rc001c83924455e2040eda334a044058f64d0f800 --- build/DatabaseStructure.sql (.../DatabaseStructure.sql) (revision afec64f46fa0be3500d2d7b357ad7ce589b5dc66) +++ build/DatabaseStructure.sql (.../DatabaseStructure.sql) (revision c001c83924455e2040eda334a044058f64d0f800) @@ -1,6 +1,6 @@ /* ---------------------------------------------------- */ /* Generated by Enterprise Architect Version 12.0 */ -/* Created On : 24-May-2017 09:11:16 */ +/* Created On : 29-May-2017 10:11:01 AM */ /* DBMS : SQLite */ /* ---------------------------------------------------- */ @@ -1079,8 +1079,8 @@ 'HeightStructureEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, 'FailureMechanismEntityId' INTEGER NOT NULL, 'Order' INT (4) NOT NULL, - 'Name' VARCHAR (260), - 'Id' VARCHAR (260), + 'Name' VARCHAR (260) NOT NULL, + 'Id' VARCHAR (260) NOT NULL, 'X' REAL, 'Y' REAL, 'StructureNormalOrientation' REAL, @@ -1145,8 +1145,8 @@ 'ClosingStructureEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, 'FailureMechanismEntityId' INTEGER NOT NULL, 'Order' INT (4) NOT NULL, - 'Name' VARCHAR (260), - 'Id' VARCHAR (260), + 'Name' VARCHAR (260) NOT NULL, + 'Id' VARCHAR (260) NOT NULL, 'X' REAL, 'Y' REAL, 'StructureNormalOrientation' REAL, @@ -1249,8 +1249,8 @@ 'StabilityPointStructureEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, 'FailureMechanismEntityId' INTEGER NOT NULL, 'Order' INT (4) NOT NULL, - 'Name' VARCHAR (260), - 'Id' VARCHAR (260), + 'Name' VARCHAR (260) NOT NULL, + 'Id' VARCHAR (260) NOT NULL, 'X' REAL, 'Y' REAL, 'StructureNormalOrientation' REAL, Index: design/DatabaseDesign.eap =================================================================== diff -u -rafec64f46fa0be3500d2d7b357ad7ce589b5dc66 -rc001c83924455e2040eda334a044058f64d0f800 Binary files differ