Index: Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Integration.Test/ClosingStructuresCalculationActivityIntegrationTest.cs =================================================================== diff -u -r3f40e34c76b06d66a6426c7e07fb3a101b4952cb -r4fdc5cd290f2b693868a250c9bb42bce09927fb5 --- Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Integration.Test/ClosingStructuresCalculationActivityIntegrationTest.cs (.../ClosingStructuresCalculationActivityIntegrationTest.cs) (revision 3f40e34c76b06d66a6426c7e07fb3a101b4952cb) +++ Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Integration.Test/ClosingStructuresCalculationActivityIntegrationTest.cs (.../ClosingStructuresCalculationActivityIntegrationTest.cs) (revision 4fdc5cd290f2b693868a250c9bb42bce09927fb5) @@ -105,11 +105,11 @@ new Point2D(1, 1) })); - var calculation = new TestClosingStructuresCalculation() + var calculation = new TestClosingStructuresCalculation { InputParameters = { - HydraulicBoundaryLocation = assessmentSection.HydraulicBoundaryDatabase.Locations.First(hl => hl.Id == 1300001), + HydraulicBoundaryLocation = assessmentSection.HydraulicBoundaryDatabase.Locations.First(hl => hl.Id == 1300001) } }; @@ -154,33 +154,40 @@ new Point2D(1, 1) })); - var calculation = new TestClosingStructuresCalculation() + var calculation = new TestClosingStructuresCalculation { InputParameters = { - HydraulicBoundaryLocation = new HydraulicBoundaryLocation(1, "test", 1, 1), + HydraulicBoundaryLocation = new HydraulicBoundaryLocation(1, "test", 1, 1) } }; var activity = new ClosingStructuresCalculationActivity(calculation, testDataPath, failureMechanism, assessmentSection); - // Call - Action call = () => activity.Run(); - - // Assert - TestHelper.AssertLogMessages(call, messages => + using (new HydraRingCalculatorFactoryConfig()) { - var msgs = messages.ToArray(); - Assert.AreEqual(6, msgs.Length); - StringAssert.StartsWith(string.Format("Validatie van '{0}' gestart om: ", calculation.Name), msgs[0]); - StringAssert.StartsWith(string.Format("Validatie van '{0}' beëindigd om: ", calculation.Name), msgs[1]); - StringAssert.StartsWith(string.Format("Berekening van '{0}' gestart om: ", calculation.Name), msgs[2]); - StringAssert.StartsWith(string.Format("De berekening voor kunstwerk sluiten '{0}' is niet gelukt. Bekijk het foutrapport door op details te klikken.", - calculation.Name), msgs[3]); - StringAssert.StartsWith("Betrouwbaarheid sluiting kunstwerk berekening is uitgevoerd op de tijdelijke locatie:", msgs[4]); - StringAssert.StartsWith(string.Format("Berekening van '{0}' beëindigd om: ", calculation.Name), msgs[5]); - }); - Assert.AreEqual(ActivityState.Failed, activity.State); + var calculator = ((TestHydraRingCalculatorFactory) HydraRingCalculatorFactory.Instance).StructuresClosureCalculator; + calculator.EndInFailure = true; + calculator.LastErrorContent = "Error"; + + // Call + Action call = () => activity.Run(); + + // Assert + TestHelper.AssertLogMessages(call, messages => + { + var msgs = messages.ToArray(); + Assert.AreEqual(6, msgs.Length); + StringAssert.StartsWith(string.Format("Validatie van '{0}' gestart om: ", calculation.Name), msgs[0]); + StringAssert.StartsWith(string.Format("Validatie van '{0}' beëindigd om: ", calculation.Name), msgs[1]); + StringAssert.StartsWith(string.Format("Berekening van '{0}' gestart om: ", calculation.Name), msgs[2]); + StringAssert.StartsWith(string.Format("De berekening voor kunstwerk sluiten '{0}' is niet gelukt. Bekijk het foutrapport door op details te klikken.", + calculation.Name), msgs[3]); + StringAssert.StartsWith("Betrouwbaarheid sluiting kunstwerk berekening is uitgevoerd op de tijdelijke locatie:", msgs[4]); + StringAssert.StartsWith(string.Format("Berekening van '{0}' beëindigd om: ", calculation.Name), msgs[5]); + }); + Assert.AreEqual(ActivityState.Failed, activity.State); + } } [Test] @@ -203,7 +210,7 @@ new Point2D(1, 1) })); - var calculation = new TestClosingStructuresCalculation() + var calculation = new TestClosingStructuresCalculation { InputParameters = { @@ -257,7 +264,7 @@ new Point2D(1, 1) })); - var calculation = new TestClosingStructuresCalculation() + var calculation = new TestClosingStructuresCalculation { InputParameters = { @@ -320,7 +327,7 @@ { InputParameters = { - HydraulicBoundaryLocation = assessmentSection.HydraulicBoundaryDatabase.Locations.First(hl => hl.Id == 1300001), + HydraulicBoundaryLocation = assessmentSection.HydraulicBoundaryDatabase.Locations.First(hl => hl.Id == 1300001) } }; @@ -365,11 +372,11 @@ new Point2D(1, 1) })); - var calculation = new StructuresCalculation() + var calculation = new StructuresCalculation { InputParameters = { - HydraulicBoundaryLocation = new HydraulicBoundaryLocation(1, "test", 1, 1), + HydraulicBoundaryLocation = new HydraulicBoundaryLocation(1, "test", 1, 1) } }; Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Integration.Test/HeightStructuresCalculationActivityIntegrationTest.cs =================================================================== diff -u -r636633d6507bef2735fd9b712b3a20feb3ac88c4 -r4fdc5cd290f2b693868a250c9bb42bce09927fb5 --- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Integration.Test/HeightStructuresCalculationActivityIntegrationTest.cs (.../HeightStructuresCalculationActivityIntegrationTest.cs) (revision 636633d6507bef2735fd9b712b3a20feb3ac88c4) +++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Integration.Test/HeightStructuresCalculationActivityIntegrationTest.cs (.../HeightStructuresCalculationActivityIntegrationTest.cs) (revision 4fdc5cd290f2b693868a250c9bb42bce09927fb5) @@ -105,7 +105,7 @@ new Point2D(1, 1) })); - var calculation = new TestHeightStructuresCalculation() + var calculation = new TestHeightStructuresCalculation { InputParameters = { @@ -155,7 +155,7 @@ new Point2D(1, 1) })); - var calculation = new TestHeightStructuresCalculation() + var calculation = new TestHeightStructuresCalculation { InputParameters = { @@ -166,22 +166,29 @@ var activity = new HeightStructuresCalculationActivity(calculation, testDataPath, failureMechanism, assessmentSection); - // Call - Action call = () => activity.Run(); - - // Assert - TestHelper.AssertLogMessages(call, messages => + using (new HydraRingCalculatorFactoryConfig()) { - var msgs = messages.ToArray(); - Assert.AreEqual(6, msgs.Length); - StringAssert.StartsWith(string.Format("Validatie van '{0}' gestart om: ", calculation.Name), msgs[0]); - StringAssert.StartsWith(string.Format("Validatie van '{0}' beëindigd om: ", calculation.Name), msgs[1]); - StringAssert.StartsWith(string.Format("Berekening van '{0}' gestart om: ", calculation.Name), msgs[2]); - StringAssert.StartsWith(string.Format("De berekening voor hoogte kunstwerk '{0}' is niet gelukt.", calculation.Name), msgs[3]); - StringAssert.StartsWith("Hoogte kunstwerk berekening is uitgevoerd op de tijdelijke locatie:", msgs[4]); - StringAssert.StartsWith(string.Format("Berekening van '{0}' beëindigd om: ", calculation.Name), msgs[5]); - }); - Assert.AreEqual(ActivityState.Failed, activity.State); + var calculator = ((TestHydraRingCalculatorFactory) HydraRingCalculatorFactory.Instance).StructuresOvertoppingCalculator; + calculator.EndInFailure = true; + calculator.LastErrorContent = "Error"; + + // Call + Action call = () => activity.Run(); + + // Assert + TestHelper.AssertLogMessages(call, messages => + { + var msgs = messages.ToArray(); + Assert.AreEqual(6, msgs.Length); + StringAssert.StartsWith(string.Format("Validatie van '{0}' gestart om: ", calculation.Name), msgs[0]); + StringAssert.StartsWith(string.Format("Validatie van '{0}' beëindigd om: ", calculation.Name), msgs[1]); + StringAssert.StartsWith(string.Format("Berekening van '{0}' gestart om: ", calculation.Name), msgs[2]); + StringAssert.StartsWith(string.Format("De berekening voor hoogte kunstwerk '{0}' is niet gelukt.", calculation.Name), msgs[3]); + StringAssert.StartsWith("Hoogte kunstwerk berekening is uitgevoerd op de tijdelijke locatie:", msgs[4]); + StringAssert.StartsWith(string.Format("Berekening van '{0}' beëindigd om: ", calculation.Name), msgs[5]); + }); + Assert.AreEqual(ActivityState.Failed, activity.State); + } } [Test] @@ -204,11 +211,11 @@ new Point2D(1, 1) })); - var calculation = new TestHeightStructuresCalculation() + var calculation = new TestHeightStructuresCalculation { InputParameters = { - HydraulicBoundaryLocation = assessmentSection.HydraulicBoundaryDatabase.Locations.First(hl => hl.Id == 1300001), + HydraulicBoundaryLocation = assessmentSection.HydraulicBoundaryDatabase.Locations.First(hl => hl.Id == 1300001) } }; @@ -258,7 +265,7 @@ new Point2D(1, 1) })); - var calculation = new TestHeightStructuresCalculation() + var calculation = new TestHeightStructuresCalculation { InputParameters = { Index: Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Integration.Test/StabilityPointStructuresCalculationActivityIntegrationTest.cs =================================================================== diff -u -rc238c8de03e71e09a71c68b6f28fb057ef8a1c4d -r4fdc5cd290f2b693868a250c9bb42bce09927fb5 --- Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Integration.Test/StabilityPointStructuresCalculationActivityIntegrationTest.cs (.../StabilityPointStructuresCalculationActivityIntegrationTest.cs) (revision c238c8de03e71e09a71c68b6f28fb057ef8a1c4d) +++ Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Integration.Test/StabilityPointStructuresCalculationActivityIntegrationTest.cs (.../StabilityPointStructuresCalculationActivityIntegrationTest.cs) (revision 4fdc5cd290f2b693868a250c9bb42bce09927fb5) @@ -105,7 +105,7 @@ new Point2D(1, 1) })); - var calculation = new TestStabilityPointStructuresCalculation() + var calculation = new TestStabilityPointStructuresCalculation { InputParameters = { @@ -156,7 +156,7 @@ new Point2D(1, 1) })); - var calculation = new TestStabilityPointStructuresCalculation() + var calculation = new TestStabilityPointStructuresCalculation { InputParameters = { @@ -168,22 +168,29 @@ var activity = new StabilityPointStructuresCalculationActivity(calculation, testDataPath, failureMechanism, assessmentSection); - // Call - Action call = () => activity.Run(); - - // Assert - TestHelper.AssertLogMessages(call, messages => + using (new HydraRingCalculatorFactoryConfig()) { - var msgs = messages.ToArray(); - Assert.AreEqual(6, msgs.Length); - StringAssert.StartsWith(string.Format("Validatie van '{0}' gestart om: ", calculation.Name), msgs[0]); - StringAssert.StartsWith(string.Format("Validatie van '{0}' beëindigd om: ", calculation.Name), msgs[1]); - StringAssert.StartsWith(string.Format("Berekening van '{0}' gestart om: ", calculation.Name), msgs[2]); - StringAssert.StartsWith(string.Format("De berekening voor kunstwerk puntconstructies '{0}' is niet gelukt.", calculation.Name), msgs[3]); - StringAssert.StartsWith("Puntconstructies berekening is uitgevoerd op de tijdelijke locatie:", msgs[4]); - StringAssert.StartsWith(string.Format("Berekening van '{0}' beëindigd om: ", calculation.Name), msgs[5]); - }); - Assert.AreEqual(ActivityState.Failed, activity.State); + var calculator = ((TestHydraRingCalculatorFactory) HydraRingCalculatorFactory.Instance).StructuresStabilityPointCalculator; + calculator.EndInFailure = true; + calculator.LastErrorContent = "Error"; + + // Call + Action call = () => activity.Run(); + + // Assert + TestHelper.AssertLogMessages(call, messages => + { + var msgs = messages.ToArray(); + Assert.AreEqual(6, msgs.Length); + StringAssert.StartsWith(string.Format("Validatie van '{0}' gestart om: ", calculation.Name), msgs[0]); + StringAssert.StartsWith(string.Format("Validatie van '{0}' beëindigd om: ", calculation.Name), msgs[1]); + StringAssert.StartsWith(string.Format("Berekening van '{0}' gestart om: ", calculation.Name), msgs[2]); + StringAssert.StartsWith(string.Format("De berekening voor kunstwerk puntconstructies '{0}' is niet gelukt.", calculation.Name), msgs[3]); + StringAssert.StartsWith("Puntconstructies berekening is uitgevoerd op de tijdelijke locatie:", msgs[4]); + StringAssert.StartsWith(string.Format("Berekening van '{0}' beëindigd om: ", calculation.Name), msgs[5]); + }); + Assert.AreEqual(ActivityState.Failed, activity.State); + } } [Test] @@ -206,7 +213,7 @@ new Point2D(1, 1) })); - var calculation = new TestStabilityPointStructuresCalculation() + var calculation = new TestStabilityPointStructuresCalculation { InputParameters = { @@ -261,7 +268,7 @@ new Point2D(1, 1) })); - var calculation = new TestStabilityPointStructuresCalculation() + var calculation = new TestStabilityPointStructuresCalculation { InputParameters = { @@ -372,11 +379,11 @@ new Point2D(1, 1) })); - var calculation = new StructuresCalculation() + var calculation = new StructuresCalculation { InputParameters = { - HydraulicBoundaryLocation = new HydraulicBoundaryLocation(1, "test", 1, 1), + HydraulicBoundaryLocation = new HydraulicBoundaryLocation(1, "test", 1, 1) } };