Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.TestUtil/MacroStabilityInwardsViewChartDataAssert.cs =================================================================== diff -u -r89a30d666e2e684db9d72ed16c3be18a6afad391 -r7585d2fd78627d94d55ffa16423af90a91e4efd4 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.TestUtil/MacroStabilityInwardsViewChartDataAssert.cs (.../MacroStabilityInwardsViewChartDataAssert.cs) (revision 89a30d666e2e684db9d72ed16c3be18a6afad391) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.TestUtil/MacroStabilityInwardsViewChartDataAssert.cs (.../MacroStabilityInwardsViewChartDataAssert.cs) (revision 7585d2fd78627d94d55ffa16423af90a91e4efd4) @@ -51,24 +51,30 @@ } /// - /// Asserts whether corresponds to . + /// Asserts whether corresponds to , + /// and . /// - /// The original . + /// The + /// that should be represented as series in . + /// The expected name of . + /// Indicator whether areas should be present. /// The actual . - /// Indicator whether areas are present. - /// Thrown when - /// does not correspond to . - public static void AssertSoilProfileChartData(MacroStabilityInwardsStochasticSoilProfile original, ChartData actual, bool mapDataShouldContainAreas) + /// Thrown when does not correspond + /// to , or + /// . + public static void AssertSoilProfileChartData(IMacroStabilityInwardsSoilProfileUnderSurfaceLine soilProfileUnderSurface, string expectedName, bool mapDataShouldContainAreas, ChartData actual) { Assert.IsInstanceOf(actual); var soilProfileChartData = (ChartDataCollection) actual; - int expectedLayerCount = original.SoilProfile.Layers.Count(); - Assert.AreEqual(expectedLayerCount + 1, soilProfileChartData.Collection.Count()); - Assert.AreEqual(original.SoilProfile.Name, soilProfileChartData.Name); + IMacroStabilityInwardsSoilLayer2D[] layers = soilProfileUnderSurface?.GetLayersRecursively().ToArray() ?? new IMacroStabilityInwardsSoilLayer2D[0]; + int expectedLayerCount = layers.Length; - string[] expectedSoilLayerNames = original.SoilProfile.Layers.Select((l, i) => $"{i + 1} {l.Data.MaterialName}").Reverse().ToArray(); + Assert.AreEqual(expectedLayerCount, soilProfileChartData.Collection.Count()); + Assert.AreEqual(expectedName, soilProfileChartData.Name); + string[] expectedSoilLayerNames = layers.Select((l, i) => $"{i + 1} {l.Data.MaterialName}").Reverse().ToArray(); + for (var i = 0; i < expectedLayerCount; i++) { var chartMultipleAreaData = soilProfileChartData.Collection.ElementAt(i) as ChartMultipleAreaData; @@ -77,11 +83,6 @@ Assert.AreEqual(expectedSoilLayerNames[i], chartMultipleAreaData.Name); Assert.AreEqual(mapDataShouldContainAreas, chartMultipleAreaData.Areas.Any()); } - - var holesMultipleAreaData = soilProfileChartData.Collection.Last() as ChartMultipleAreaData; - Assert.IsNotNull(holesMultipleAreaData); - Assert.AreEqual("Binnenringen", holesMultipleAreaData.Name); - Assert.IsFalse(holesMultipleAreaData.Areas.Any()); } } } \ No newline at end of file