Index: Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Plugin.Test/TreeNodeInfos/ClosingStructuresCalculationGroupContextTreeNodeInfoTest.cs =================================================================== diff -u -r5f489223b4d730eec42acd55533dd012d10dd1ca -r5bca160555d6a573d0defcea46dd4e60e16cc274 --- Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Plugin.Test/TreeNodeInfos/ClosingStructuresCalculationGroupContextTreeNodeInfoTest.cs (.../ClosingStructuresCalculationGroupContextTreeNodeInfoTest.cs) (revision 5f489223b4d730eec42acd55533dd012d10dd1ca) +++ Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Plugin.Test/TreeNodeInfos/ClosingStructuresCalculationGroupContextTreeNodeInfoTest.cs (.../ClosingStructuresCalculationGroupContextTreeNodeInfoTest.cs) (revision 5bca160555d6a573d0defcea46dd4e60e16cc274) @@ -885,12 +885,22 @@ ClosingStructure structure1 = new TestClosingStructure("Structure 1"); ClosingStructure structure2 = new TestClosingStructure("Structure 2"); + var existingCalculationGroup = new CalculationGroup(); + var existingCalculation = new StructuresCalculation(); var failureMechanism = new ClosingStructuresFailureMechanism { ClosingStructures = { structure1, structure2 + }, + CalculationsGroup = + { + Children = + { + existingCalculationGroup, + existingCalculation + } } }; @@ -925,9 +935,12 @@ contextMenu.Items[contextMenuGenerateCalculationsIndexRootGroup].PerformClick(); // Then - var closingStructuresCalculations = failureMechanism.Calculations.OfType>().ToArray(); - Assert.AreEqual(1, closingStructuresCalculations.Length); - Assert.AreSame(structure1, closingStructuresCalculations[0].InputParameters.Structure); + Assert.AreEqual(3, failureMechanism.CalculationsGroup.Children.Count); + Assert.AreSame(existingCalculationGroup, failureMechanism.CalculationsGroup.Children[0]); + Assert.AreSame(existingCalculation, failureMechanism.CalculationsGroup.Children[1]); + var generatedCalculation = failureMechanism.CalculationsGroup.Children[2] as StructuresCalculation; + Assert.IsNotNull(generatedCalculation); + Assert.AreSame(structure1, generatedCalculation.InputParameters.Structure); } } } Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/TreeNodeInfos/GrassCoverErosionInwardsCalculationGroupContextTreeNodeInfoTest.cs =================================================================== diff -u -r9448c9f34da890e184722d00c3f8b4f765a246b0 -r5bca160555d6a573d0defcea46dd4e60e16cc274 --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/TreeNodeInfos/GrassCoverErosionInwardsCalculationGroupContextTreeNodeInfoTest.cs (.../GrassCoverErosionInwardsCalculationGroupContextTreeNodeInfoTest.cs) (revision 9448c9f34da890e184722d00c3f8b4f765a246b0) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/TreeNodeInfos/GrassCoverErosionInwardsCalculationGroupContextTreeNodeInfoTest.cs (.../GrassCoverErosionInwardsCalculationGroupContextTreeNodeInfoTest.cs) (revision 5bca160555d6a573d0defcea46dd4e60e16cc274) @@ -1100,12 +1100,22 @@ DikeProfile dikeProfile1 = new TestDikeProfile("Dike profile 1"); DikeProfile dikeProfile2 = new TestDikeProfile("Dike profile 2"); + var existingCalculationGroup = new CalculationGroup(); + var existingCalculation = new GrassCoverErosionInwardsCalculation(); var failureMechanism = new GrassCoverErosionInwardsFailureMechanism { DikeProfiles = { dikeProfile1, dikeProfile2 + }, + CalculationsGroup = + { + Children = + { + existingCalculationGroup, + existingCalculation + } } }; @@ -1140,9 +1150,12 @@ contextMenu.Items[contextMenuGenerateCalculationsIndexRootGroup].PerformClick(); // Then - var grassCoverErosionInwardsCalculations = failureMechanism.Calculations.OfType().ToArray(); - Assert.AreEqual(1, grassCoverErosionInwardsCalculations.Length); - Assert.AreSame(dikeProfile1, grassCoverErosionInwardsCalculations[0].InputParameters.DikeProfile); + Assert.AreEqual(3, failureMechanism.CalculationsGroup.Children.Count); + Assert.AreSame(existingCalculationGroup, failureMechanism.CalculationsGroup.Children[0]); + Assert.AreSame(existingCalculation, failureMechanism.CalculationsGroup.Children[1]); + var generatedCalculation = failureMechanism.CalculationsGroup.Children[2] as GrassCoverErosionInwardsCalculation; + Assert.IsNotNull(generatedCalculation); + Assert.AreSame(dikeProfile1, generatedCalculation.InputParameters.DikeProfile); } } } Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Plugin.Test/TreeNodeInfos/HeightStructuresCalculationGroupContextTreeNodeInfoTest.cs =================================================================== diff -u -rb25389d952b8ac86e61c5e822124b2c250ae3e55 -r5bca160555d6a573d0defcea46dd4e60e16cc274 --- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Plugin.Test/TreeNodeInfos/HeightStructuresCalculationGroupContextTreeNodeInfoTest.cs (.../HeightStructuresCalculationGroupContextTreeNodeInfoTest.cs) (revision b25389d952b8ac86e61c5e822124b2c250ae3e55) +++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Plugin.Test/TreeNodeInfos/HeightStructuresCalculationGroupContextTreeNodeInfoTest.cs (.../HeightStructuresCalculationGroupContextTreeNodeInfoTest.cs) (revision 5bca160555d6a573d0defcea46dd4e60e16cc274) @@ -1039,12 +1039,22 @@ HeightStructure structure1 = new TestHeightStructure("Structure 1"); HeightStructure structure2 = new TestHeightStructure("Structure 2"); + var existingCalculationGroup = new CalculationGroup(); + var existingCalculation = new StructuresCalculation(); var failureMechanism = new HeightStructuresFailureMechanism { HeightStructures = { structure1, structure2 + }, + CalculationsGroup = + { + Children = + { + existingCalculationGroup, + existingCalculation + } } }; @@ -1079,9 +1089,12 @@ contextMenu.Items[contextMenuGenerateCalculationsIndexRootGroup].PerformClick(); // Then - var heightStructuresCalculations = failureMechanism.Calculations.OfType>().ToArray(); - Assert.AreEqual(1, heightStructuresCalculations.Length); - Assert.AreSame(structure1, heightStructuresCalculations[0].InputParameters.Structure); + Assert.AreEqual(3, failureMechanism.CalculationsGroup.Children.Count); + Assert.AreSame(existingCalculationGroup, failureMechanism.CalculationsGroup.Children[0]); + Assert.AreSame(existingCalculation, failureMechanism.CalculationsGroup.Children[1]); + var generatedCalculation = failureMechanism.CalculationsGroup.Children[2] as StructuresCalculation; + Assert.IsNotNull(generatedCalculation); + Assert.AreSame(structure1, generatedCalculation.InputParameters.Structure); } } } Index: Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Plugin.Test/TreeNodeInfos/StabilityPointStructuresCalculationGroupContextTreeNodeInfoTest.cs =================================================================== diff -u -r59d8943b166f40b1d8b3595b43b2a524e719b2ef -r5bca160555d6a573d0defcea46dd4e60e16cc274 --- Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Plugin.Test/TreeNodeInfos/StabilityPointStructuresCalculationGroupContextTreeNodeInfoTest.cs (.../StabilityPointStructuresCalculationGroupContextTreeNodeInfoTest.cs) (revision 59d8943b166f40b1d8b3595b43b2a524e719b2ef) +++ Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Plugin.Test/TreeNodeInfos/StabilityPointStructuresCalculationGroupContextTreeNodeInfoTest.cs (.../StabilityPointStructuresCalculationGroupContextTreeNodeInfoTest.cs) (revision 5bca160555d6a573d0defcea46dd4e60e16cc274) @@ -875,12 +875,22 @@ StabilityPointStructure structure1 = new TestStabilityPointStructure("Structure 1"); StabilityPointStructure structure2 = new TestStabilityPointStructure("Structure 2"); + var existingCalculationGroup = new CalculationGroup(); + var existingCalculation = new StructuresCalculation(); var failureMechanism = new StabilityPointStructuresFailureMechanism { StabilityPointStructures = { structure1, structure2 + }, + CalculationsGroup = + { + Children = + { + existingCalculationGroup, + existingCalculation + } } }; @@ -915,9 +925,12 @@ contextMenu.Items[contextMenuGenerateCalculationsIndexRootGroup].PerformClick(); // Then - StructuresCalculation[] stabilityPointStructuresCalculations = failureMechanism.Calculations.OfType>().ToArray(); - Assert.AreEqual(1, stabilityPointStructuresCalculations.Length); - Assert.AreSame(structure1, stabilityPointStructuresCalculations[0].InputParameters.Structure); + Assert.AreEqual(3, failureMechanism.CalculationsGroup.Children.Count); + Assert.AreSame(existingCalculationGroup, failureMechanism.CalculationsGroup.Children[0]); + Assert.AreSame(existingCalculation, failureMechanism.CalculationsGroup.Children[1]); + var generatedCalculation = failureMechanism.CalculationsGroup.Children[2] as StructuresCalculation; + Assert.IsNotNull(generatedCalculation); + Assert.AreSame(structure1, generatedCalculation.InputParameters.Structure); } } }