Index: Ringtoets/Migration/test/Ringtoets.Migration.Integration.Test/MigrationTo181IntegrationTest.cs =================================================================== diff -u -r19382b3670a64bb81d862b8a423d2d4ed1736420 -re9a3ea2b12aec1bdf19ec28a3894cf6b0c0312c2 --- Ringtoets/Migration/test/Ringtoets.Migration.Integration.Test/MigrationTo181IntegrationTest.cs (.../MigrationTo181IntegrationTest.cs) (revision 19382b3670a64bb81d862b8a423d2d4ed1736420) +++ Ringtoets/Migration/test/Ringtoets.Migration.Integration.Test/MigrationTo181IntegrationTest.cs (.../MigrationTo181IntegrationTest.cs) (revision e9a3ea2b12aec1bdf19ec28a3894cf6b0c0312c2) @@ -126,8 +126,9 @@ AssertWaveConditionsCalculations(reader, sourceFilePath); MigratedSerializedDataTestHelper.AssertSerializedMacroStabilityInwardsOutput(reader); - MigratedSerializedDataTestHelper.AssertSerializedDikeProfile(reader); + MigratedSerializedDataTestHelper.AssertSerializedDikeProfileRoughnessPoints(reader); MigratedSerializedDataTestHelper.AssertSerializedSurfaceLine(reader); + MigratedSerializedDataTestHelper.AssertSerializedPoint2DCollection(reader); } AssertLogDatabase(logFilePath); @@ -637,7 +638,6 @@ "AND NEW.HydraulicDatabaseVersion IS OLD.HydraulicDatabaseVersion " + "AND NEW.HydraulicDatabaseLocation IS OLD.HydraulicDatabaseLocation " + "AND NEW.Composition = OLD.Composition " + - "AND NEW.ReferenceLinePointXml IS OLD.ReferenceLinePointXml " + "AND NEW.\"Order\" = OLD.\"Order\"; " + "DETACH DATABASE SOURCEPROJECT;"; @@ -1010,7 +1010,7 @@ /// The namespace is still present. /// The class name of the serialized data is still present. /// - public static void AssertSerializedDikeProfile(MigratedDatabaseReader reader) + public static void AssertSerializedDikeProfileRoughnessPoints(MigratedDatabaseReader reader) { string validateDikeGeometry = "SELECT " + @@ -1042,6 +1042,35 @@ reader.AssertReturnedDataIsValid(validateSurfaceLinePoints); } + + /// + /// Asserts the migrated serialized data related to serialized 2D point collections. + /// + /// The reader to read the migrated database. + /// Thrown when: + /// + /// The namespace is still present. + /// The class name of the serialized data is still present. + /// + public static void AssertSerializedPoint2DCollection(MigratedDatabaseReader reader) + { + reader.AssertReturnedDataIsValid(GenerateSerializedPoint2DValidationQuery("AssessmentSectionEntity", "ReferenceLinePointXml")); + reader.AssertReturnedDataIsValid(GenerateSerializedPoint2DValidationQuery("FailureMechanismSectionEntity", "FailureMechanismSectionPointXml")); + reader.AssertReturnedDataIsValid(GenerateSerializedPoint2DValidationQuery("StochasticSoilModelEntity", "StochasticSoilModelSegmentPointXml")); + reader.AssertReturnedDataIsValid(GenerateSerializedPoint2DValidationQuery("DikeProfileEntity", "ForeshoreXml")); + reader.AssertReturnedDataIsValid(GenerateSerializedPoint2DValidationQuery("ForeshoreProfileEntity", "GeometryXml")); + reader.AssertReturnedDataIsValid(GenerateSerializedPoint2DValidationQuery("MacroStabilityInwardsSoilLayerTwoDEntity", "OuterRingXml")); + } + + private static string GenerateSerializedPoint2DValidationQuery(string tableName, + string columnName) + { + return "SELECT " + + "COUNT() = 0 " + + $"FROM {tableName} " + + $"WHERE LIKE('%Point2DXmlSerializer%', {columnName}) " + + $"OR LIKE('%{oldNamespace}%', {columnName})"; + } } #endregion