Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Plugin.Test/TreeNodeInfos/HeightStructuresCalculationContextTreeNodeInfoTest.cs =================================================================== diff -u -ree0d08c05fcf4226136c4822619b38db7d0d3959 -r028a46631860bbbf730867f1068b422d2683e074 --- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Plugin.Test/TreeNodeInfos/HeightStructuresCalculationContextTreeNodeInfoTest.cs (.../HeightStructuresCalculationContextTreeNodeInfoTest.cs) (revision ee0d08c05fcf4226136c4822619b38db7d0d3959) +++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Plugin.Test/TreeNodeInfos/HeightStructuresCalculationContextTreeNodeInfoTest.cs (.../HeightStructuresCalculationContextTreeNodeInfoTest.cs) (revision 028a46631860bbbf730867f1068b422d2683e074) @@ -387,18 +387,8 @@ // Then Assert.IsFalse(calculation.HasOutput); + AssertHeightStructuresInput(structure, calculation.InputParameters); - HeightStructuresInput inputParameters = calculation.InputParameters; - Assert.AreSame(structure, inputParameters.Structure); - Assert.AreEqual(structure.StructureNormalOrientation, inputParameters.StructureNormalOrientation); - Assert.AreEqual(structure.LevelCrestStructure, inputParameters.LevelCrestStructure); - Assert.AreEqual(structure.FlowWidthAtBottomProtection, inputParameters.FlowWidthAtBottomProtection); - Assert.AreEqual(structure.CriticalOvertoppingDischarge, inputParameters.CriticalOvertoppingDischarge); - Assert.AreEqual(structure.WidthFlowApertures, inputParameters.WidthFlowApertures); - Assert.AreEqual(structure.FailureProbabilityStructureWithErosion, inputParameters.FailureProbabilityStructureWithErosion); - Assert.AreEqual(structure.StorageStructureArea, inputParameters.StorageStructureArea); - Assert.AreEqual(structure.AllowedLevelIncreaseStorage, inputParameters.AllowedLevelIncreaseStorage); - // Note: observer assertions are verified in the TearDown() } } @@ -537,19 +527,8 @@ // Then Assert.IsFalse(calculation.HasOutput); + AssertHeightStructuresInput(structure, calculation.InputParameters); - HeightStructuresInput inputParameters = calculation.InputParameters; - Assert.AreSame(structure, inputParameters.Structure); - Assert.AreSame(structure, inputParameters.Structure); - Assert.AreEqual(structure.StructureNormalOrientation, inputParameters.StructureNormalOrientation); - Assert.AreEqual(structure.LevelCrestStructure, inputParameters.LevelCrestStructure); - Assert.AreEqual(structure.FlowWidthAtBottomProtection, inputParameters.FlowWidthAtBottomProtection); - Assert.AreEqual(structure.CriticalOvertoppingDischarge, inputParameters.CriticalOvertoppingDischarge); - Assert.AreEqual(structure.WidthFlowApertures, inputParameters.WidthFlowApertures); - Assert.AreEqual(structure.FailureProbabilityStructureWithErosion, inputParameters.FailureProbabilityStructureWithErosion); - Assert.AreEqual(structure.StorageStructureArea, inputParameters.StorageStructureArea); - Assert.AreEqual(structure.AllowedLevelIncreaseStorage, inputParameters.AllowedLevelIncreaseStorage); - string expectedMessage = "Wanneer het kunstwerk wijzigt als gevolg van het bijwerken, " + "zal het resultaat van deze berekening worden " + $"verwijderd.{Environment.NewLine}{Environment.NewLine}Weet u zeker dat u wilt doorgaan?"; @@ -612,19 +591,8 @@ // Then Assert.IsTrue(calculation.HasOutput); + AssertHeightStructuresInput(structure, calculation.InputParameters); - HeightStructuresInput inputParameters = calculation.InputParameters; - - Assert.AreSame(structure, inputParameters.Structure); - Assert.AreEqual(structure.StructureNormalOrientation, inputParameters.StructureNormalOrientation); - Assert.AreEqual(structure.LevelCrestStructure, inputParameters.LevelCrestStructure); - Assert.AreEqual(structure.FlowWidthAtBottomProtection, inputParameters.FlowWidthAtBottomProtection); - Assert.AreEqual(structure.CriticalOvertoppingDischarge, inputParameters.CriticalOvertoppingDischarge); - Assert.AreEqual(structure.WidthFlowApertures, inputParameters.WidthFlowApertures); - Assert.AreEqual(structure.FailureProbabilityStructureWithErosion, inputParameters.FailureProbabilityStructureWithErosion); - Assert.AreEqual(structure.StorageStructureArea, inputParameters.StorageStructureArea); - Assert.AreEqual(structure.AllowedLevelIncreaseStorage, inputParameters.AllowedLevelIncreaseStorage); - string expectedMessage = "Wanneer het kunstwerk wijzigt als gevolg van het bijwerken, " + "zal het resultaat van deze berekening worden " + $"verwijderd.{Environment.NewLine}{Environment.NewLine}Weet u zeker dat u wilt doorgaan?"; @@ -691,7 +659,7 @@ // Then Assert.IsFalse(calculation.HasOutput); - Assert.AreEqual(structure.StructureNormalOrientation, inputParameters.StructureNormalOrientation); + AssertHeightStructuresInput(structure, calculation.InputParameters); string expectedMessage = "Wanneer het kunstwerk wijzigt als gevolg van het bijwerken, " + "zal het resultaat van deze berekening worden " + @@ -1238,6 +1206,19 @@ structure.CopyProperties(structureToUpdateFrom); } + private static void AssertHeightStructuresInput(TestHeightStructure structure, HeightStructuresInput inputParameters) + { + Assert.AreSame(structure, inputParameters.Structure); + Assert.AreEqual(structure.StructureNormalOrientation, inputParameters.StructureNormalOrientation); + Assert.AreEqual(structure.LevelCrestStructure, inputParameters.LevelCrestStructure); + Assert.AreEqual(structure.FlowWidthAtBottomProtection, inputParameters.FlowWidthAtBottomProtection); + Assert.AreEqual(structure.CriticalOvertoppingDischarge, inputParameters.CriticalOvertoppingDischarge); + Assert.AreEqual(structure.WidthFlowApertures, inputParameters.WidthFlowApertures); + Assert.AreEqual(structure.FailureProbabilityStructureWithErosion, inputParameters.FailureProbabilityStructureWithErosion); + Assert.AreEqual(structure.StorageStructureArea, inputParameters.StorageStructureArea); + Assert.AreEqual(structure.AllowedLevelIncreaseStorage, inputParameters.AllowedLevelIncreaseStorage); + } + public override void TearDown() { plugin.Dispose();