Index: Application/Ringtoets/src/Application.Ringtoets.Migration.Core/EmbeddedResources/DatabaseStructure17.2.sql =================================================================== diff -u -r94145e339de94eb172e92b524faf8b10d94bb35c -r5d924a3334b0532730e8ea4bd9e97a5d48a72344 --- Application/Ringtoets/src/Application.Ringtoets.Migration.Core/EmbeddedResources/DatabaseStructure17.2.sql (.../DatabaseStructure17.2.sql) (revision 94145e339de94eb172e92b524faf8b10d94bb35c) +++ Application/Ringtoets/src/Application.Ringtoets.Migration.Core/EmbeddedResources/DatabaseStructure17.2.sql (.../DatabaseStructure17.2.sql) (revision 5d924a3334b0532730e8ea4bd9e97a5d48a72344) @@ -1,6 +1,6 @@ /* ---------------------------------------------------- */ /* Generated by Enterprise Architect Version 12.0 */ -/* Created On : 07-Aug-2017 11:23:28 */ +/* Created On : 15-Aug-2017 3:09:22 PM */ /* DBMS : SQLite */ /* ---------------------------------------------------- */ @@ -576,7 +576,8 @@ ( 'SoilProfileEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, 'Bottom' REAL, - 'Name' TEXT + 'Name' TEXT, + 'SourceType' TINYINT (1) NOT NULL -- Enum: 1 = SoilProfile1D, 2 = SoilProfile2D ) ; @@ -605,7 +606,6 @@ 'StochasticSoilProfileEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, 'SoilProfileEntityId' INTEGER NOT NULL, 'StochasticSoilModelEntityId' INTEGER NOT NULL, - 'Type' TINYINT (1) NOT NULL, -- Enum: 1 = SoilProfile1D, 2 = SoilProfile2D 'Probability' REAL NOT NULL, 'Order' INT (4) NOT NULL, CONSTRAINT 'FK_StochasticSoilProfileEntity_SoilProfileEntity' FOREIGN KEY ('SoilProfileEntityId') REFERENCES 'SoilProfileEntity' ('SoilProfileEntityId') ON DELETE Cascade ON UPDATE Cascade, Index: Application/Ringtoets/src/Application.Ringtoets.Migration.Core/EmbeddedResources/Migration_17.1_17.2.sql =================================================================== diff -u -rc48c65234bef938fd1c4700e5723e30bc50a7b31 -r5d924a3334b0532730e8ea4bd9e97a5d48a72344 --- Application/Ringtoets/src/Application.Ringtoets.Migration.Core/EmbeddedResources/Migration_17.1_17.2.sql (.../Migration_17.1_17.2.sql) (revision c48c65234bef938fd1c4700e5723e30bc50a7b31) +++ Application/Ringtoets/src/Application.Ringtoets.Migration.Core/EmbeddedResources/Migration_17.1_17.2.sql (.../Migration_17.1_17.2.sql) (revision 5d924a3334b0532730e8ea4bd9e97a5d48a72344) @@ -713,7 +713,22 @@ INSERT INTO PipingStructureSectionResultEntity SELECT * FROM [SOURCEPROJECT].PipingStructureSectionResultEntity; INSERT INTO ProjectEntity SELECT * FROM [SOURCEPROJECT].ProjectEntity; INSERT INTO SoilLayerEntity SELECT * FROM [SOURCEPROJECT].SoilLayerEntity; -INSERT INTO SoilProfileEntity SELECT * FROM [SOURCEPROJECT].SoilProfileEntity; +INSERT INTO SoilProfileEntity( + [SoilProfileEntityId], + [Bottom], + [Name], + [SourceType]) +SELECT + [SoilProfileEntityId], + [Bottom], + [Name], + ( + SELECT SSP.[Type] + FROM [SOURCEPROJECT].StochasticSoilProfileEntity SSP + WHERE SSP.SoilProfileEntityId IS SP.SoilProfileEntityId + LIMIT 1 + ) AS [SourceType] +FROM [SOURCEPROJECT].SoilProfileEntity SP; INSERT INTO StabilityPointStructureEntity ( [StabilityPointStructureEntityId], [FailureMechanismEntityId], @@ -1043,7 +1058,19 @@ [StochasticSoilModelSegmentPointXml], [Order] FROM [SOURCEPROJECT].StochasticSoilModelEntity; -INSERT INTO StochasticSoilProfileEntity SELECT * FROM [SOURCEPROJECT].StochasticSoilProfileEntity; +INSERT INTO StochasticSoilProfileEntity( + [StochasticSoilProfileEntityId], + [SoilProfileEntityId], + [StochasticSoilModelEntityId], + [Probability], + [Order]) +SELECT + [StochasticSoilProfileEntityId], + [SoilProfileEntityId], + [StochasticSoilModelEntityId], + [Probability], + [Order] + FROM [SOURCEPROJECT].StochasticSoilProfileEntity; INSERT INTO StrengthStabilityLengthwiseConstructionSectionResultEntity SELECT * FROM [SOURCEPROJECT].StrengthStabilityLengthwiseConstructionSectionResultEntity; INSERT INTO SurfaceLineEntity SELECT * FROM [SOURCEPROJECT].SurfaceLineEntity; INSERT INTO TechnicalInnovationSectionResultEntity SELECT * FROM [SOURCEPROJECT].TechnicalInnovationSectionResultEntity; Index: Application/Ringtoets/src/Application.Ringtoets.Storage/Create/AssessmentSectionCreateExtensions.cs =================================================================== diff -u -r2e265dc8a3c902ebdfdcdf0f1071f9c3c872d822 -r5d924a3334b0532730e8ea4bd9e97a5d48a72344 --- Application/Ringtoets/src/Application.Ringtoets.Storage/Create/AssessmentSectionCreateExtensions.cs (.../AssessmentSectionCreateExtensions.cs) (revision 2e265dc8a3c902ebdfdcdf0f1071f9c3c872d822) +++ Application/Ringtoets/src/Application.Ringtoets.Storage/Create/AssessmentSectionCreateExtensions.cs (.../AssessmentSectionCreateExtensions.cs) (revision 5d924a3334b0532730e8ea4bd9e97a5d48a72344) @@ -27,8 +27,8 @@ using Application.Ringtoets.Storage.Create.GrassCoverSlipOffInwards; using Application.Ringtoets.Storage.Create.GrassCoverSlipOffOutwards; using Application.Ringtoets.Storage.Create.HeightStructures; -using Application.Ringtoets.Storage.Create.MacroStabilityInwards; using Application.Ringtoets.Storage.Create.MacrostabilityOutwards; +using Application.Ringtoets.Storage.Create.MacroStabilityInwards; using Application.Ringtoets.Storage.Create.Microstability; using Application.Ringtoets.Storage.Create.Piping; using Application.Ringtoets.Storage.Create.PipingStructure; Index: Application/Ringtoets/src/Application.Ringtoets.Storage/Create/IllustrationPoints/IllustrationPointResultCreateExtensions.cs =================================================================== diff -u -ref5e8f54613f8dd00da958f15f730aa4a1899223 -r5d924a3334b0532730e8ea4bd9e97a5d48a72344 --- Application/Ringtoets/src/Application.Ringtoets.Storage/Create/IllustrationPoints/IllustrationPointResultCreateExtensions.cs (.../IllustrationPointResultCreateExtensions.cs) (revision ef5e8f54613f8dd00da958f15f730aa4a1899223) +++ Application/Ringtoets/src/Application.Ringtoets.Storage/Create/IllustrationPoints/IllustrationPointResultCreateExtensions.cs (.../IllustrationPointResultCreateExtensions.cs) (revision 5d924a3334b0532730e8ea4bd9e97a5d48a72344) @@ -51,7 +51,7 @@ throw new ArgumentNullException(nameof(illustrationPointResult)); } - var entity = new IllustrationPointResultEntity() + var entity = new IllustrationPointResultEntity { Description = illustrationPointResult.Description.DeepClone(), Value = illustrationPointResult.Value, Index: Application/Ringtoets/src/Application.Ringtoets.Storage/Create/StructuresOutputCreateExtensions.cs =================================================================== diff -u -r699aed8b7cadb16fa905b2e54c8174d0d5747b99 -r5d924a3334b0532730e8ea4bd9e97a5d48a72344 --- Application/Ringtoets/src/Application.Ringtoets.Storage/Create/StructuresOutputCreateExtensions.cs (.../StructuresOutputCreateExtensions.cs) (revision 699aed8b7cadb16fa905b2e54c8174d0d5747b99) +++ Application/Ringtoets/src/Application.Ringtoets.Storage/Create/StructuresOutputCreateExtensions.cs (.../StructuresOutputCreateExtensions.cs) (revision 5d924a3334b0532730e8ea4bd9e97a5d48a72344) @@ -65,7 +65,7 @@ { outputEntity.GeneralResultFaultTreeIllustrationPointEntity = structuresOutput.GeneralResult - .CreateGeneralResultFaultTreeIllustrationPointEntity(); + .CreateGeneralResultFaultTreeIllustrationPointEntity(); } } } Index: Application/Ringtoets/src/Application.Ringtoets.Storage/DbContext/RingtoetsEntities.Designer.cs =================================================================== diff -u -re6a591b93ec33becef19b4d71f3d49de0fbd7f10 -r5d924a3334b0532730e8ea4bd9e97a5d48a72344 --- Application/Ringtoets/src/Application.Ringtoets.Storage/DbContext/RingtoetsEntities.Designer.cs (.../RingtoetsEntities.Designer.cs) (revision e6a591b93ec33becef19b4d71f3d49de0fbd7f10) +++ Application/Ringtoets/src/Application.Ringtoets.Storage/DbContext/RingtoetsEntities.Designer.cs (.../RingtoetsEntities.Designer.cs) (revision 5d924a3334b0532730e8ea4bd9e97a5d48a72344) @@ -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:\Projects\WTITrunk\Application\Ringtoets\src\Application.Ringtoets.Storage\DbContext\RingtoetsEntities.edmx'. +// T4 code generation is enabled for model 'D:\WTI\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 -r94145e339de94eb172e92b524faf8b10d94bb35c -r5d924a3334b0532730e8ea4bd9e97a5d48a72344 --- Application/Ringtoets/src/Application.Ringtoets.Storage/DbContext/RingtoetsEntities.edmx (.../RingtoetsEntities.edmx) (revision 94145e339de94eb172e92b524faf8b10d94bb35c) +++ Application/Ringtoets/src/Application.Ringtoets.Storage/DbContext/RingtoetsEntities.edmx (.../RingtoetsEntities.edmx) (revision 5d924a3334b0532730e8ea4bd9e97a5d48a72344) @@ -4,7 +4,7 @@ - + @@ -831,6 +831,7 @@ + @@ -1076,7 +1077,6 @@ - @@ -4695,6 +4695,7 @@ + @@ -4967,7 +4968,6 @@ - @@ -7321,6 +7321,7 @@ + @@ -7580,7 +7581,6 @@ - Index: Application/Ringtoets/src/Application.Ringtoets.Storage/DbContext/RingtoetsEntities.edmx.diagram =================================================================== diff -u -r94145e339de94eb172e92b524faf8b10d94bb35c -r5d924a3334b0532730e8ea4bd9e97a5d48a72344 --- Application/Ringtoets/src/Application.Ringtoets.Storage/DbContext/RingtoetsEntities.edmx.diagram (.../RingtoetsEntities.edmx.diagram) (revision 94145e339de94eb172e92b524faf8b10d94bb35c) +++ Application/Ringtoets/src/Application.Ringtoets.Storage/DbContext/RingtoetsEntities.edmx.diagram (.../RingtoetsEntities.edmx.diagram) (revision 5d924a3334b0532730e8ea4bd9e97a5d48a72344) @@ -6,85 +6,85 @@ - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - + + + + + + + + + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - - - - + + + + - - - - - + + + + + Index: Application/Ringtoets/src/Application.Ringtoets.Storage/DbContext/SoilProfileEntity.cs =================================================================== diff -u -r3fb0df0ed6e64657154700ee7706e035d5bf99f5 -r5d924a3334b0532730e8ea4bd9e97a5d48a72344 --- Application/Ringtoets/src/Application.Ringtoets.Storage/DbContext/SoilProfileEntity.cs (.../SoilProfileEntity.cs) (revision 3fb0df0ed6e64657154700ee7706e035d5bf99f5) +++ Application/Ringtoets/src/Application.Ringtoets.Storage/DbContext/SoilProfileEntity.cs (.../SoilProfileEntity.cs) (revision 5d924a3334b0532730e8ea4bd9e97a5d48a72344) @@ -45,6 +45,7 @@ public long SoilProfileEntityId { get; set; } public double? Bottom { get; set; } public string Name { get; set; } + public byte SourceType { get; set; } [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] public virtual ICollection SoilLayerEntities { get; set; } Index: Application/Ringtoets/src/Application.Ringtoets.Storage/DbContext/StochasticSoilProfileEntity.cs =================================================================== diff -u -r3fb0df0ed6e64657154700ee7706e035d5bf99f5 -r5d924a3334b0532730e8ea4bd9e97a5d48a72344 --- Application/Ringtoets/src/Application.Ringtoets.Storage/DbContext/StochasticSoilProfileEntity.cs (.../StochasticSoilProfileEntity.cs) (revision 3fb0df0ed6e64657154700ee7706e035d5bf99f5) +++ Application/Ringtoets/src/Application.Ringtoets.Storage/DbContext/StochasticSoilProfileEntity.cs (.../StochasticSoilProfileEntity.cs) (revision 5d924a3334b0532730e8ea4bd9e97a5d48a72344) @@ -44,7 +44,6 @@ public long StochasticSoilProfileEntityId { get; set; } public long SoilProfileEntityId { get; set; } public long StochasticSoilModelEntityId { get; set; } - public byte Type { get; set; } public double Probability { get; set; } public int Order { get; set; } Index: Application/Ringtoets/src/Application.Ringtoets.Storage/Read/FailureMechanismEntityReadExtensions.cs =================================================================== diff -u -rf909c714921a6c7c24772a7510ce5ad134f70cf5 -r5d924a3334b0532730e8ea4bd9e97a5d48a72344 --- Application/Ringtoets/src/Application.Ringtoets.Storage/Read/FailureMechanismEntityReadExtensions.cs (.../FailureMechanismEntityReadExtensions.cs) (revision f909c714921a6c7c24772a7510ce5ad134f70cf5) +++ Application/Ringtoets/src/Application.Ringtoets.Storage/Read/FailureMechanismEntityReadExtensions.cs (.../FailureMechanismEntityReadExtensions.cs) (revision 5d924a3334b0532730e8ea4bd9e97a5d48a72344) @@ -50,8 +50,6 @@ using Ringtoets.StabilityPointStructures.Data; using Ringtoets.StabilityStoneCover.Data; using Ringtoets.WaveImpactAsphaltCover.Data; -using GeneralPipingInput = Ringtoets.Piping.Data.GeneralPipingInput; -using PipingFailureMechanismSectionResult = Ringtoets.Piping.Data.PipingFailureMechanismSectionResult; namespace Application.Ringtoets.Storage.Read { Index: Application/Ringtoets/src/Application.Ringtoets.Storage/Read/HydraulicLocationOutputEntityReadExtensions.cs =================================================================== diff -u -r19d976fb7e64bc4c23ca6a601eb47d876b1fecff -r5d924a3334b0532730e8ea4bd9e97a5d48a72344 --- Application/Ringtoets/src/Application.Ringtoets.Storage/Read/HydraulicLocationOutputEntityReadExtensions.cs (.../HydraulicLocationOutputEntityReadExtensions.cs) (revision 19d976fb7e64bc4c23ca6a601eb47d876b1fecff) +++ Application/Ringtoets/src/Application.Ringtoets.Storage/Read/HydraulicLocationOutputEntityReadExtensions.cs (.../HydraulicLocationOutputEntityReadExtensions.cs) (revision 5d924a3334b0532730e8ea4bd9e97a5d48a72344) @@ -43,7 +43,7 @@ entity.TargetReliability.ToNullAsNaN(), entity.CalculatedProbability.ToNullAsNaN(), entity.CalculatedReliability.ToNullAsNaN(), - (CalculationConvergence) entity.CalculationConvergence, + (CalculationConvergence) entity.CalculationConvergence, entity.GeneralResultSubMechanismIllustrationPointEntity?.Read()); } } Index: Application/Ringtoets/src/Application.Ringtoets.Storage/Read/Piping/SoilProfileEntityReadExtensions.cs =================================================================== diff -u -r3fb0df0ed6e64657154700ee7706e035d5bf99f5 -r5d924a3334b0532730e8ea4bd9e97a5d48a72344 --- Application/Ringtoets/src/Application.Ringtoets.Storage/Read/Piping/SoilProfileEntityReadExtensions.cs (.../SoilProfileEntityReadExtensions.cs) (revision 3fb0df0ed6e64657154700ee7706e035d5bf99f5) +++ Application/Ringtoets/src/Application.Ringtoets.Storage/Read/Piping/SoilProfileEntityReadExtensions.cs (.../SoilProfileEntityReadExtensions.cs) (revision 5d924a3334b0532730e8ea4bd9e97a5d48a72344) @@ -53,7 +53,11 @@ return collector.Get(entity); } IEnumerable layers = entity.SoilLayerEntities.OrderBy(sl => sl.Order).Select(sl => sl.Read()); - var pipingSoilProfile = new PipingSoilProfile(entity.Name, entity.Bottom.ToNullAsNaN(), layers, SoilProfileType.SoilProfile1D, -1); + var pipingSoilProfile = new PipingSoilProfile(entity.Name, + entity.Bottom.ToNullAsNaN(), + layers, + (SoilProfileType) entity.SourceType, + -1); collector.Read(entity, pipingSoilProfile); return pipingSoilProfile; Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/IntegrationTests/MigrationTo172IntegrationTest.cs =================================================================== diff -u -rc48c65234bef938fd1c4700e5723e30bc50a7b31 -r5d924a3334b0532730e8ea4bd9e97a5d48a72344 --- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/IntegrationTests/MigrationTo172IntegrationTest.cs (.../MigrationTo172IntegrationTest.cs) (revision c48c65234bef938fd1c4700e5723e30bc50a7b31) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/IntegrationTests/MigrationTo172IntegrationTest.cs (.../MigrationTo172IntegrationTest.cs) (revision 5d924a3334b0532730e8ea4bd9e97a5d48a72344) @@ -72,6 +72,8 @@ AssertStabilityPointStructures(reader); AssertForeshoreProfiles(reader); + AssertSoilProfiles(reader, sourceFilePath); + AssertVersions(reader); AssertDatabase(reader); } @@ -219,7 +221,7 @@ foreach (string table in tables) { string validateMigratedTable = - $"ATTACH DATABASE[{sourceFilePath}] AS SOURCEPROJECT; " + + $"ATTACH DATABASE \"{sourceFilePath}\" AS SOURCEPROJECT; " + $"SELECT COUNT() = (SELECT COUNT() FROM [SOURCEPROJECT].{table}) " + $"FROM {table};" + "DETACH SOURCEPROJECT;"; @@ -534,6 +536,17 @@ reader.AssertReturnedDataIsValid(validateStabilityPointStructures); } + private static void AssertSoilProfiles(MigratedDatabaseReader reader, string sourceFilePath) + { + string validateSoilProfiles = + $"ATTACH DATABASE \"{sourceFilePath}\" AS SOURCEPROJECT; " + + "SELECT COUNT() = (SELECT COUNT() FROM [SOURCEPROJECT].SoilProfileEntity) " + + "FROM SoilProfileEntity " + + "WHERE [SourceType] IN (1,2);" + + "DETACH SOURCEPROJECT;"; + reader.AssertReturnedDataIsValid(validateSoilProfiles); + } + /// /// Database reader for migrated database. /// Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/Piping/SoilProfileEntityReadExtensionsTest.cs =================================================================== diff -u -r3fb0df0ed6e64657154700ee7706e035d5bf99f5 -r5d924a3334b0532730e8ea4bd9e97a5d48a72344 --- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/Piping/SoilProfileEntityReadExtensionsTest.cs (.../SoilProfileEntityReadExtensionsTest.cs) (revision 3fb0df0ed6e64657154700ee7706e035d5bf99f5) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/Piping/SoilProfileEntityReadExtensionsTest.cs (.../SoilProfileEntityReadExtensionsTest.cs) (revision 5d924a3334b0532730e8ea4bd9e97a5d48a72344) @@ -24,6 +24,7 @@ using Application.Ringtoets.Storage.DbContext; using Application.Ringtoets.Storage.Read; using Application.Ringtoets.Storage.Read.Piping; +using Core.Common.TestUtil; using NUnit.Framework; using Ringtoets.Piping.Primitives; @@ -47,18 +48,18 @@ } [Test] - [TestCase(true)] - [TestCase(false)] - public void Read_WithCollector_ReturnsNewPipingSoilProfileWithPropertiesSetAndEntityRegistered(bool isRelevant) + public void Read_WithCollector_ReturnsNewPipingSoilProfileWithPropertiesSetAndEntityRegistered() { // Setup const string testName = "testName"; var random = new Random(21); double bottom = random.NextDouble(); + var sourceType = random.NextEnumValue(); var entity = new SoilProfileEntity { Name = testName, Bottom = bottom, + SourceType = (byte) sourceType, SoilLayerEntities = { new SoilLayerEntity @@ -84,6 +85,7 @@ Assert.IsNotNull(profile); Assert.AreEqual(testName, profile.Name); Assert.AreEqual(bottom, profile.Bottom, 1e-6); + Assert.AreEqual(sourceType, profile.SoilProfileType); CollectionAssert.AreEqual(new[] { "B", @@ -94,12 +96,16 @@ } [Test] - [TestCase(true)] - [TestCase(false)] - public void Read_WithCollectorWithoutLayers_ThrowsArgumentException(bool isRelevant) + public void Read_WithCollectorWithoutLayers_ThrowsArgumentException() { // Setup - var entity = new SoilProfileEntity(); + var random = new Random(21); + var entity = new SoilProfileEntity + { + Name = "Name", + Bottom = random.NextDouble(), + SourceType = (byte) random.NextEnumValue() + }; var collector = new ReadConversionCollector(); // Call @@ -114,11 +120,13 @@ { // Setup const string testName = "testName"; - double bottom = new Random(21).NextDouble(); + var random = new Random(21); + double bottom = random.NextDouble(); var entity = new SoilProfileEntity { Name = testName, Bottom = bottom, + SourceType = (byte) random.NextEnumValue(), SoilLayerEntities = { new SoilLayerEntity Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/Piping/StochasticSoilProfileEntityReadExtensionsTest.cs =================================================================== diff -u -r26f527fb809a2325c8f883ece9da01a8f8040eb3 -r5d924a3334b0532730e8ea4bd9e97a5d48a72344 --- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/Piping/StochasticSoilProfileEntityReadExtensionsTest.cs (.../StochasticSoilProfileEntityReadExtensionsTest.cs) (revision 26f527fb809a2325c8f883ece9da01a8f8040eb3) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/Piping/StochasticSoilProfileEntityReadExtensionsTest.cs (.../StochasticSoilProfileEntityReadExtensionsTest.cs) (revision 5d924a3334b0532730e8ea4bd9e97a5d48a72344) @@ -23,8 +23,10 @@ using Application.Ringtoets.Storage.DbContext; using Application.Ringtoets.Storage.Read; using Application.Ringtoets.Storage.Read.Piping; +using Core.Common.TestUtil; using NUnit.Framework; using Ringtoets.Piping.Data.SoilProfile; +using Ringtoets.Piping.Primitives; namespace Application.Ringtoets.Storage.Test.Read.Piping { @@ -46,19 +48,17 @@ } [Test] - [TestCase(1)] - [TestCase(2)] - public void Read_WithCollector_ReturnsNewStochasticSoilProfileWithPropertiesSetAndEntityRegistered(byte soilProfileType) + public void Read_WithCollector_ReturnsNewStochasticSoilProfileWithPropertiesSetAndEntityRegistered() { // Setup var random = new Random(21); double probability = random.NextDouble(); var entity = new StochasticSoilProfileEntity { Probability = probability, - Type = soilProfileType, SoilProfileEntity = new SoilProfileEntity { + SourceType = (byte) random.NextEnumValue(), SoilLayerEntities = { new SoilLayerEntity() @@ -80,9 +80,11 @@ public void Read_WithCollectorDifferentStochasticSoilProfileEntitiesWithSameSoilProfileEntity_ReturnsStochasticSoilProfilesWithSamePipingSoilProfile() { // Setup - double probability = new Random(21).NextDouble(); + var random = new Random(21); + double probability = random.NextDouble(); var soilProfileEntity = new SoilProfileEntity { + SourceType = (byte) random.NextEnumValue(), SoilLayerEntities = { new SoilLayerEntity() @@ -114,10 +116,12 @@ public void Read_SameStochasticSoilProfileEntityMultipleTimes_ReturnSameStochasticSoilProfile() { // Setup + var random = new Random(9); var entity = new StochasticSoilProfileEntity { SoilProfileEntity = new SoilProfileEntity { + SourceType = (byte) random.NextEnumValue(), SoilLayerEntities = { new SoilLayerEntity() Index: build/DatabaseStructure.sql =================================================================== diff -u -rfa5908fb8590411787b87f1d342ba819fcd4d4a8 -r5d924a3334b0532730e8ea4bd9e97a5d48a72344 --- build/DatabaseStructure.sql (.../DatabaseStructure.sql) (revision fa5908fb8590411787b87f1d342ba819fcd4d4a8) +++ build/DatabaseStructure.sql (.../DatabaseStructure.sql) (revision 5d924a3334b0532730e8ea4bd9e97a5d48a72344) @@ -1,6 +1,6 @@ /* ---------------------------------------------------- */ /* Generated by Enterprise Architect Version 12.0 */ -/* Created On : 07-Aug-2017 11:23:28 */ +/* Created On : 15-Aug-2017 3:09:22 PM */ /* DBMS : SQLite */ /* ---------------------------------------------------- */ @@ -576,7 +576,8 @@ ( 'SoilProfileEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, 'Bottom' REAL, - 'Name' TEXT + 'Name' TEXT, + 'SourceType' TINYINT (1) NOT NULL -- Enum: 1 = SoilProfile1D, 2 = SoilProfile2D ) ; @@ -605,7 +606,6 @@ 'StochasticSoilProfileEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, 'SoilProfileEntityId' INTEGER NOT NULL, 'StochasticSoilModelEntityId' INTEGER NOT NULL, - 'Type' TINYINT (1) NOT NULL, -- Enum: 1 = SoilProfile1D, 2 = SoilProfile2D 'Probability' REAL NOT NULL, 'Order' INT (4) NOT NULL, CONSTRAINT 'FK_StochasticSoilProfileEntity_SoilProfileEntity' FOREIGN KEY ('SoilProfileEntityId') REFERENCES 'SoilProfileEntity' ('SoilProfileEntityId') ON DELETE Cascade ON UPDATE Cascade, Index: design/DatabaseDesign.eap =================================================================== diff -u -r94145e339de94eb172e92b524faf8b10d94bb35c -r5d924a3334b0532730e8ea4bd9e97a5d48a72344 Binary files differ