Index: Application/Ringtoets/src/Application.Ringtoets.Migration.Core/EmbeddedResources/Migration_17.3_18.1.sql =================================================================== diff -u -r91404db66cdd2851fc83d18334425c83338efe68 -r04163c59056b871f2fe877b6727dd326b06c3298 --- Application/Ringtoets/src/Application.Ringtoets.Migration.Core/EmbeddedResources/Migration_17.3_18.1.sql (.../Migration_17.3_18.1.sql) (revision 91404db66cdd2851fc83d18334425c83338efe68) +++ Application/Ringtoets/src/Application.Ringtoets.Migration.Core/EmbeddedResources/Migration_17.3_18.1.sql (.../Migration_17.3_18.1.sql) (revision 04163c59056b871f2fe877b6727dd326b06c3298) @@ -569,22 +569,22 @@ FROM [SOURCEPROJECT].StabilityStoneCoverSectionResultEntity; INSERT INTO StabilityStoneCoverWaveConditionsCalculationEntity( [StabilityStoneCoverWaveConditionsCalculationEntityId], - [CalculationGroupEntityId], - [ForeshoreProfileEntityId], - [HydraulicLocationEntityId], - [Order], - [Name], - [Comments], - [UseBreakWater], - [BreakWaterType], - [BreakWaterHeight], - [UseForeshore], - [Orientation], - [UpperBoundaryRevetment], - [LowerBoundaryRevetment], - [UpperBoundaryWaterLevels], - [LowerBoundaryWaterLevels], - [StepSize], + [CalculationGroupEntityId], + [ForeshoreProfileEntityId], + [HydraulicLocationEntityId], + [Order], + [Name], + [Comments], + [UseBreakWater], + [BreakWaterType], + [BreakWaterHeight], + [UseForeshore], + [Orientation], + [UpperBoundaryRevetment], + [LowerBoundaryRevetment], + [UpperBoundaryWaterLevels], + [LowerBoundaryWaterLevels], + [StepSize], [CategoryType] ) SELECT Index: Application/Ringtoets/src/Application.Ringtoets.Storage/Create/GrassCoverErosionOutwards/GrassCoverErosionOutwardsWaveConditionsCalculationCreateExtensions.cs =================================================================== diff -u -r9fa942e5fd5968cb810f4657e12d91a58f4b1857 -r04163c59056b871f2fe877b6727dd326b06c3298 --- Application/Ringtoets/src/Application.Ringtoets.Storage/Create/GrassCoverErosionOutwards/GrassCoverErosionOutwardsWaveConditionsCalculationCreateExtensions.cs (.../GrassCoverErosionOutwardsWaveConditionsCalculationCreateExtensions.cs) (revision 9fa942e5fd5968cb810f4657e12d91a58f4b1857) +++ Application/Ringtoets/src/Application.Ringtoets.Storage/Create/GrassCoverErosionOutwards/GrassCoverErosionOutwardsWaveConditionsCalculationCreateExtensions.cs (.../GrassCoverErosionOutwardsWaveConditionsCalculationCreateExtensions.cs) (revision 04163c59056b871f2fe877b6727dd326b06c3298) @@ -85,7 +85,7 @@ entity.Orientation = calculationInput.Orientation.ToNaNAsNull(); entity.UseBreakWater = Convert.ToByte(calculationInput.UseBreakWater); - entity.BreakWaterType = (byte) calculationInput.BreakWater.Type; + entity.BreakWaterType = Convert.ToByte(calculationInput.BreakWater.Type); entity.BreakWaterHeight = calculationInput.BreakWater.Height.ToNaNAsNull(); entity.UseForeshore = Convert.ToByte(calculationInput.UseForeshore); entity.UpperBoundaryRevetment = calculationInput.UpperBoundaryRevetment.ToNaNAsNull(); Index: Application/Ringtoets/src/Application.Ringtoets.Storage/Create/WaveImpactAsphaltCover/WaveImpactAsphaltCoverWaveConditionsCalculationCreateExtensions.cs =================================================================== diff -u -r0e60a22413535f2ead76d3b566ca5b667d436410 -r04163c59056b871f2fe877b6727dd326b06c3298 --- Application/Ringtoets/src/Application.Ringtoets.Storage/Create/WaveImpactAsphaltCover/WaveImpactAsphaltCoverWaveConditionsCalculationCreateExtensions.cs (.../WaveImpactAsphaltCoverWaveConditionsCalculationCreateExtensions.cs) (revision 0e60a22413535f2ead76d3b566ca5b667d436410) +++ Application/Ringtoets/src/Application.Ringtoets.Storage/Create/WaveImpactAsphaltCover/WaveImpactAsphaltCoverWaveConditionsCalculationCreateExtensions.cs (.../WaveImpactAsphaltCoverWaveConditionsCalculationCreateExtensions.cs) (revision 04163c59056b871f2fe877b6727dd326b06c3298) @@ -85,7 +85,7 @@ entity.Orientation = calculationInput.Orientation.ToNaNAsNull(); entity.UseBreakWater = Convert.ToByte(calculationInput.UseBreakWater); - entity.BreakWaterType = (byte) calculationInput.BreakWater.Type; + entity.BreakWaterType = Convert.ToByte(calculationInput.BreakWater.Type); entity.BreakWaterHeight = calculationInput.BreakWater.Height.ToNaNAsNull(); entity.UseForeshore = Convert.ToByte(calculationInput.UseForeshore); entity.UpperBoundaryRevetment = calculationInput.UpperBoundaryRevetment.ToNaNAsNull(); Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/GrassCoverErosionOutwards/GrassCoverErosionOutwardsWaveConditionsCalculationCreateExtensionsTest.cs =================================================================== diff -u -r9fa942e5fd5968cb810f4657e12d91a58f4b1857 -r04163c59056b871f2fe877b6727dd326b06c3298 --- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/GrassCoverErosionOutwards/GrassCoverErosionOutwardsWaveConditionsCalculationCreateExtensionsTest.cs (.../GrassCoverErosionOutwardsWaveConditionsCalculationCreateExtensionsTest.cs) (revision 9fa942e5fd5968cb810f4657e12d91a58f4b1857) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/GrassCoverErosionOutwards/GrassCoverErosionOutwardsWaveConditionsCalculationCreateExtensionsTest.cs (.../GrassCoverErosionOutwardsWaveConditionsCalculationCreateExtensionsTest.cs) (revision 04163c59056b871f2fe877b6727dd326b06c3298) @@ -43,15 +43,15 @@ public void Create_CalculationNull_ThrowsArgumentNullException() { // Call - TestDelegate call = () => ((GrassCoverErosionOutwardsWaveConditionsCalculation)null).Create(new PersistenceRegistry(), 0); + TestDelegate call = () => ((GrassCoverErosionOutwardsWaveConditionsCalculation) null).Create(new PersistenceRegistry(), 0); // Assert var exception = Assert.Throws(call); Assert.AreEqual("calculation", exception.ParamName); } [Test] - public void Create_PersistenceRegistryIsNull_ThrowArgumentNullException() + public void Create_PersistenceRegistryNull_ThrowArgumentNullException() { // Setup var calculation = new GrassCoverErosionOutwardsWaveConditionsCalculation(); Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/StabilityStoneCover/StabilityStoneCoverWaveConditionsCalculationCreateExtensionsTest.cs =================================================================== diff -u -r307c64f9b0db863143e745bb8df2188ab570a8dc -r04163c59056b871f2fe877b6727dd326b06c3298 --- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/StabilityStoneCover/StabilityStoneCoverWaveConditionsCalculationCreateExtensionsTest.cs (.../StabilityStoneCoverWaveConditionsCalculationCreateExtensionsTest.cs) (revision 307c64f9b0db863143e745bb8df2188ab570a8dc) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/StabilityStoneCover/StabilityStoneCoverWaveConditionsCalculationCreateExtensionsTest.cs (.../StabilityStoneCoverWaveConditionsCalculationCreateExtensionsTest.cs) (revision 04163c59056b871f2fe877b6727dd326b06c3298) @@ -51,7 +51,7 @@ } [Test] - public void Create_PersistenceRegistryIsNull_ThrowArgumentNullException() + public void Create_PersistenceRegistryNull_ThrowArgumentNullException() { // Setup var calculation = new StabilityStoneCoverWaveConditionsCalculation(); Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/WaveImpactAsphaltCover/WaveImpactAsphaltCoverWaveConditionsCalculationCreateExtensionsTest.cs =================================================================== diff -u -r3e8d6a57d8a5f57f0b118bb92a7137aa4ddd78ea -r04163c59056b871f2fe877b6727dd326b06c3298 --- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/WaveImpactAsphaltCover/WaveImpactAsphaltCoverWaveConditionsCalculationCreateExtensionsTest.cs (.../WaveImpactAsphaltCoverWaveConditionsCalculationCreateExtensionsTest.cs) (revision 3e8d6a57d8a5f57f0b118bb92a7137aa4ddd78ea) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/WaveImpactAsphaltCover/WaveImpactAsphaltCoverWaveConditionsCalculationCreateExtensionsTest.cs (.../WaveImpactAsphaltCoverWaveConditionsCalculationCreateExtensionsTest.cs) (revision 04163c59056b871f2fe877b6727dd326b06c3298) @@ -51,7 +51,7 @@ } [Test] - public void Create_PersistenceRegistryIsNull_ThrowArgumentNullException() + public void Create_PersistenceRegistryNull_ThrowArgumentNullException() { // Setup var calculation = new WaveImpactAsphaltCoverWaveConditionsCalculation(); Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/IntegrationTests/MigrationTo181IntegrationTest.cs =================================================================== diff -u -r0f76397ef547eeee6bd3e9d1917b3a145d0b1257 -r04163c59056b871f2fe877b6727dd326b06c3298 --- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/IntegrationTests/MigrationTo181IntegrationTest.cs (.../MigrationTo181IntegrationTest.cs) (revision 0f76397ef547eeee6bd3e9d1917b3a145d0b1257) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/IntegrationTests/MigrationTo181IntegrationTest.cs (.../MigrationTo181IntegrationTest.cs) (revision 04163c59056b871f2fe877b6727dd326b06c3298) @@ -1899,10 +1899,10 @@ private readonly string sourceFilePath; /// - /// Creates a new instance of . + /// Creates a new instance of . /// /// The file path of the original database. - /// Thrown when + /// Thrown when /// is null or empty. public WaveConditionsCalculationValidationQueryGenerator(string sourceFilePath) { @@ -1922,7 +1922,7 @@ /// A query to validate the grass cover erosion outwards calculations. /// Thrown when /// is an invalid value of . - /// Thrown when is an unsupported value, + /// Thrown when is a valid value, /// but is unsupported. public string GetGrassCoverErosionOutwardsCalculationValidationQuery(NormativeNormType normType) { @@ -1981,7 +1981,7 @@ /// A query to validate the migrated stability stone cover calculations. /// Thrown when /// is an invalid value of . - /// Thrown when is an unsupported value, + /// Thrown when is a valid value, /// but is unsupported. public string GetStabilityStoneCoverCalculationValidationQuery(NormativeNormType normType) { @@ -2007,13 +2007,13 @@ } /// - /// Generates a query to validate if the stability stone cover calculations are migrated correctly. + /// Generates a query to validate if the wave impact asphalt cover calculations are migrated correctly. /// /// The norm type to generate the query for. - /// A query to validate the migrated stability stone cover calculations. + /// A query to validate the migrated wave impact asphalt cover calculations. /// Thrown when /// is an invalid value of . - /// Thrown when is an unsupported value, + /// Thrown when is a valid value, /// but is unsupported. public string GetWaveImpactAsphaltCoverCalculationValidationQuery(NormativeNormType normType) { @@ -2038,6 +2038,29 @@ "DETACH DATABASE SOURCEPROJECT;"; } + private static string GetCommonWaveConditionsCalculationPropertiesValidationString(NormativeNormType normType) + { + return "JOIN CalculationGroupEntity USING(CalculationGroupEntityId) " + + "JOIN FailureMechanismEntity USING(CalculationGroupEntityId) " + + "JOIN AssessmentSectionEntity ase USING(AssessmentSectionEntityId)" + + $"WHERE ase.NormativeNormType = {(int) normType} " + + "AND NEW.CalculationGroupEntityId = OLD.CalculationGroupEntityId " + + "AND NEW.ForeshoreProfileEntityId IS OLD.ForeshoreProfileEntityId " + + "AND NEW.\"Order\" = OLD.\"Order\" " + + "AND NEW.Name IS OLD.Name " + + "AND NEW.Comments IS OLD.Comments " + + "AND NEW.UseBreakWater = OLD.UseBreakWater " + + "AND NEW.BreakWaterType = OLD.BreakWaterType " + + "AND NEW.BreakWaterHeight IS OLD.BreakWaterHeight " + + "AND NEW.UseForeshore = OLD.UseForeshore " + + "AND NEW.Orientation IS OLD.Orientation " + + "AND NEW.UpperBoundaryRevetment IS OLD.UpperBoundaryRevetment " + + "AND NEW.LowerBoundaryRevetment IS OLD.LowerBoundaryRevetment " + + "AND NEW.UpperBoundaryWaterLevels IS OLD.UpperBoundaryWaterLevels " + + "AND NEW.LowerBoundaryWaterLevels IS OLD.LowerBoundaryWaterLevels " + + "AND NEW.StepSize = OLD.StepSize "; + } + /// /// Converts the to the corresponding category type from . /// @@ -2054,45 +2077,17 @@ throw new InvalidEnumArgumentException(nameof(normType), (int) normType, typeof(NormativeNormType)); } - FailureMechanismCategoryType categoryType; switch (normType) { case NormativeNormType.SignalingNorm: - categoryType = FailureMechanismCategoryType.MechanismSpecificSignalingNorm; - break; + return FailureMechanismCategoryType.MechanismSpecificSignalingNorm; case NormativeNormType.LowerLimitNorm: - categoryType = FailureMechanismCategoryType.MechanismSpecificLowerLimitNorm; - break; + return FailureMechanismCategoryType.MechanismSpecificLowerLimitNorm; default: throw new NotSupportedException(); } - - return categoryType; } - private static string GetCommonWaveConditionsCalculationPropertiesValidationString(NormativeNormType normType) - { - return "JOIN CalculationGroupEntity USING(CalculationGroupEntityId) " + - "JOIN FailureMechanismEntity USING(CalculationGroupEntityId) " + - "JOIN AssessmentSectionEntity ase USING(AssessmentSectionEntityId)" + - $"WHERE ase.NormativeNormType = {(int) normType} " + - "AND NEW.CalculationGroupEntityId = OLD.CalculationGroupEntityId " + - "AND NEW.ForeshoreProfileEntityId IS OLD.ForeshoreProfileEntityId " + - "AND NEW.\"Order\" = OLD.\"Order\" " + - "AND NEW.Name IS OLD.Name " + - "AND NEW.Comments IS OLD.Comments " + - "AND NEW.UseBreakWater = OLD.UseBreakWater " + - "AND NEW.BreakWaterType = OLD.BreakWaterType " + - "AND NEW.BreakWaterHeight IS OLD.BreakWaterHeight " + - "AND NEW.UseForeshore = OLD.UseForeshore " + - "AND NEW.Orientation IS OLD.Orientation " + - "AND NEW.UpperBoundaryRevetment IS OLD.UpperBoundaryRevetment " + - "AND NEW.LowerBoundaryRevetment IS OLD.LowerBoundaryRevetment " + - "AND NEW.UpperBoundaryWaterLevels IS OLD.UpperBoundaryWaterLevels " + - "AND NEW.LowerBoundaryWaterLevels IS OLD.LowerBoundaryWaterLevels " + - "AND NEW.StepSize = OLD.StepSize "; - } - /// /// Converts the to the corresponding category type from . /// @@ -2109,20 +2104,15 @@ throw new InvalidEnumArgumentException(nameof(normType), (int) normType, typeof(NormativeNormType)); } - AssessmentSectionCategoryType categoryType; switch (normType) { case NormativeNormType.SignalingNorm: - categoryType = AssessmentSectionCategoryType.SignalingNorm; - break; + return AssessmentSectionCategoryType.SignalingNorm; case NormativeNormType.LowerLimitNorm: - categoryType = AssessmentSectionCategoryType.LowerLimitNorm; - break; + return AssessmentSectionCategoryType.LowerLimitNorm; default: throw new NotSupportedException(); } - - return categoryType; } }