Index: Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Service.Test/ClosingStructuresCalculationServiceTest.cs =================================================================== diff -u -r84db6d79354723db5626dbb9ff7361d2a70d66d1 -rdd8f41ce9d9ff9fd570874721a114560c7a71013 --- Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Service.Test/ClosingStructuresCalculationServiceTest.cs (.../ClosingStructuresCalculationServiceTest.cs) (revision 84db6d79354723db5626dbb9ff7361d2a70d66d1) +++ Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Service.Test/ClosingStructuresCalculationServiceTest.cs (.../ClosingStructuresCalculationServiceTest.cs) (revision dd8f41ce9d9ff9fd570874721a114560c7a71013) @@ -91,17 +91,17 @@ var calculation = new TestClosingStructuresCalculation(); - bool isValid = false; + var isValid = false; // Call Action call = () => isValid = ClosingStructuresCalculationService.Validate(calculation, assessmentSectionStub); // Assert TestHelper.AssertLogMessages(call, messages => { - var msgs = messages.ToArray(); + string[] msgs = messages.ToArray(); Assert.AreEqual(3, msgs.Length); - var name = calculation.Name; + string name = calculation.Name; StringAssert.StartsWith($"Validatie van '{name}' gestart om: ", msgs[0]); StringAssert.StartsWith("Validatie mislukt: Fout bij het lezen van bestand", msgs[1]); StringAssert.StartsWith($"Validatie van '{name}' beƫindigd om: ", msgs[2]); @@ -124,17 +124,17 @@ var calculation = new TestClosingStructuresCalculation(); - bool isValid = false; + var isValid = false; // Call Action call = () => isValid = ClosingStructuresCalculationService.Validate(calculation, assessmentSectionStub); // Assert TestHelper.AssertLogMessages(call, messages => { - var msgs = messages.ToArray(); + string[] msgs = messages.ToArray(); Assert.AreEqual(3, msgs.Length); - var name = calculation.Name; + string name = calculation.Name; StringAssert.StartsWith($"Validatie van '{name}' gestart om: ", msgs[0]); StringAssert.StartsWith("Validatie mislukt: Fout bij het lezen van bestand", msgs[1]); StringAssert.StartsWith($"Validatie van '{name}' beƫindigd om: ", msgs[2]); @@ -166,15 +166,15 @@ } }; - bool isValid = false; + var isValid = false; // Call Action call = () => isValid = ClosingStructuresCalculationService.Validate(calculation, assessmentSectionStub); // Assert TestHelper.AssertLogMessages(call, messages => { - var msgs = messages.ToArray(); + string[] msgs = messages.ToArray(); Assert.AreEqual(3, msgs.Length); StringAssert.StartsWith($"Validatie van '{name}' gestart om: ", msgs[0]); Assert.AreEqual("Validatie mislukt: Er is geen hydraulische randvoorwaardenlocatie geselecteerd.", msgs[1]); @@ -207,15 +207,15 @@ } }; - bool isValid = false; + var isValid = false; // Call Action call = () => isValid = ClosingStructuresCalculationService.Validate(calculation, assessmentSectionStub); // Assert TestHelper.AssertLogMessages(call, messages => { - var msgs = messages.ToArray(); + string[] msgs = messages.ToArray(); Assert.AreEqual(3, msgs.Length); StringAssert.StartsWith($"Validatie van '{name}' gestart om: ", msgs[0]); Assert.AreEqual("Validatie mislukt: Er is geen kunstwerk geselecteerd.", msgs[1]); @@ -249,15 +249,15 @@ SetInvalidInputParameters(calculation.InputParameters, (RoundedDouble) value); - bool isValid = false; + var isValid = false; // Call Action call = () => isValid = ClosingStructuresCalculationService.Validate(calculation, assessmentSectionStub); // Assert TestHelper.AssertLogMessages(call, messages => { - var msgs = messages.ToArray(); + string[] msgs = messages.ToArray(); Assert.AreEqual(20, msgs.Length); StringAssert.StartsWith($"Validatie van '{name}' gestart om: ", msgs[0]); Assert.AreEqual($"Validatie mislukt: De verwachtingswaarde voor '{stormDuration}' moet een positief getal zijn.", msgs[1]); @@ -311,15 +311,15 @@ }; SetInvalidInputParameters(calculation.InputParameters, (RoundedDouble) value); - bool isValid = false; + var isValid = false; // Call Action call = () => isValid = ClosingStructuresCalculationService.Validate(calculation, assessmentSectionStub); // Assert TestHelper.AssertLogMessages(call, messages => { - var msgs = messages.ToArray(); + string[] msgs = messages.ToArray(); Assert.AreEqual(21, msgs.Length); StringAssert.StartsWith($"Validatie van '{name}' gestart om: ", msgs[0]); Assert.AreEqual($"Validatie mislukt: De verwachtingswaarde voor '{stormDuration}' moet een positief getal zijn.", msgs[1]); @@ -374,15 +374,15 @@ }; SetInvalidInputParameters(calculation.InputParameters, (RoundedDouble) value); - bool isValid = false; + var isValid = false; // Call Action call = () => isValid = ClosingStructuresCalculationService.Validate(calculation, assessmentSectionStub); // Assert TestHelper.AssertLogMessages(call, messages => { - var msgs = messages.ToArray(); + string[] msgs = messages.ToArray(); Assert.AreEqual(19, msgs.Length); StringAssert.StartsWith($"Validatie van '{name}' gestart om: ", msgs[0]); Assert.AreEqual($"Validatie mislukt: De verwachtingswaarde voor '{stormDuration}' moet een positief getal zijn.", msgs[1]); @@ -432,7 +432,7 @@ }; // Call - bool isValid = false; + var isValid = false; TestDelegate call = () => isValid = ClosingStructuresCalculationService.Validate(calculation, assessmentSectionStub); // Assert @@ -471,15 +471,15 @@ } }; - bool isValid = false; + var isValid = false; // Call Action call = () => isValid = ClosingStructuresCalculationService.Validate(calculation, assessmentSectionStub); // Assert TestHelper.AssertLogMessages(call, messages => { - var msgs = messages.ToArray(); + string[] msgs = messages.ToArray(); Assert.AreEqual(3, msgs.Length); StringAssert.StartsWith($"Validatie van '{name}' gestart om: ", msgs[0]); Assert.AreEqual("Validatie mislukt: De waarde voor 'hoogte' van de dam moet een concreet getal zijn.", msgs[1]); @@ -568,7 +568,7 @@ using (new HydraRingCalculatorFactoryConfig()) { - var calculator = ((TestHydraRingCalculatorFactory) HydraRingCalculatorFactory.Instance).StructuresClosureCalculator; + TestStructuresClosureCalculator calculator = ((TestHydraRingCalculatorFactory) HydraRingCalculatorFactory.Instance).StructuresClosureCalculator; // Call TestDelegate call = () => service.Calculate(calculation, @@ -617,7 +617,7 @@ using (new HydraRingCalculatorFactoryConfig()) { - var calculator = ((TestHydraRingCalculatorFactory) HydraRingCalculatorFactory.Instance).StructuresClosureCalculator; + TestStructuresClosureCalculator calculator = ((TestHydraRingCalculatorFactory) HydraRingCalculatorFactory.Instance).StructuresClosureCalculator; // Call new ClosingStructuresCalculationService().Calculate(calculation, @@ -658,7 +658,7 @@ input.WidthFlowApertures.Mean, input.WidthFlowApertures.StandardDeviation, input.DeviationWaveDirection); - StructuresClosureVerticalWallCalculationInput actualInput = (StructuresClosureVerticalWallCalculationInput) calculationInputs[0]; + var actualInput = (StructuresClosureVerticalWallCalculationInput) calculationInputs[0]; HydraRingDataEqualityHelper.AreEqual(expectedInput, actualInput); Assert.IsFalse(calculator.IsCanceled); } @@ -695,7 +695,7 @@ using (new HydraRingCalculatorFactoryConfig()) { - var calculator = ((TestHydraRingCalculatorFactory) HydraRingCalculatorFactory.Instance).StructuresClosureCalculator; + TestStructuresClosureCalculator calculator = ((TestHydraRingCalculatorFactory) HydraRingCalculatorFactory.Instance).StructuresClosureCalculator; // Call new ClosingStructuresCalculationService().Calculate(calculation, @@ -735,7 +735,7 @@ input.InsideWaterLevel.Mean, input.InsideWaterLevel.StandardDeviation, input.WidthFlowApertures.Mean, input.WidthFlowApertures.StandardDeviation); - StructuresClosureLowSillCalculationInput actualInput = (StructuresClosureLowSillCalculationInput) calculationInputs[0]; + var actualInput = (StructuresClosureLowSillCalculationInput) calculationInputs[0]; HydraRingDataEqualityHelper.AreEqual(expectedInput, actualInput); Assert.IsFalse(calculator.IsCanceled); } @@ -772,7 +772,7 @@ using (new HydraRingCalculatorFactoryConfig()) { - var calculator = ((TestHydraRingCalculatorFactory) HydraRingCalculatorFactory.Instance).StructuresClosureCalculator; + TestStructuresClosureCalculator calculator = ((TestHydraRingCalculatorFactory) HydraRingCalculatorFactory.Instance).StructuresClosureCalculator; // Call new ClosingStructuresCalculationService().Calculate(calculation, @@ -810,7 +810,7 @@ input.AreaFlowApertures.Mean, input.AreaFlowApertures.StandardDeviation, input.InsideWaterLevel.Mean, input.InsideWaterLevel.StandardDeviation); - StructuresClosureFloodedCulvertCalculationInput actualInput = (StructuresClosureFloodedCulvertCalculationInput) calculationInputs[0]; + var actualInput = (StructuresClosureFloodedCulvertCalculationInput) calculationInputs[0]; HydraRingDataEqualityHelper.AreEqual(expectedInput, actualInput); Assert.IsFalse(calculator.IsCanceled); } @@ -874,7 +874,7 @@ // Assert TestHelper.AssertLogMessages(call, messages => { - var msgs = messages.ToArray(); + string[] msgs = messages.ToArray(); Assert.AreEqual(3, msgs.Length); StringAssert.StartsWith($"Berekening van '{calculation.Name}' gestart om: ", msgs[0]); StringAssert.StartsWith("Betrouwbaarheid sluiting kunstwerk berekening is uitgevoerd op de tijdelijke locatie", msgs[1]); @@ -912,7 +912,7 @@ using (new HydraRingCalculatorFactoryConfig()) { - var calculator = ((TestHydraRingCalculatorFactory) HydraRingCalculatorFactory.Instance).StructuresClosureCalculator; + TestStructuresClosureCalculator calculator = ((TestHydraRingCalculatorFactory) HydraRingCalculatorFactory.Instance).StructuresClosureCalculator; var service = new ClosingStructuresCalculationService(); calculator.CalculationFinishedHandler += (s, e) => service.Cancel(); @@ -955,7 +955,7 @@ using (new HydraRingCalculatorFactoryConfig()) { - var calculator = ((TestHydraRingCalculatorFactory) HydraRingCalculatorFactory.Instance).StructuresClosureCalculator; + TestStructuresClosureCalculator calculator = ((TestHydraRingCalculatorFactory) HydraRingCalculatorFactory.Instance).StructuresClosureCalculator; calculator.LastErrorFileContent = "An error occurred"; calculator.EndInFailure = true; @@ -980,7 +980,7 @@ // Assert TestHelper.AssertLogMessages(call, messages => { - var msgs = messages.ToArray(); + string[] msgs = messages.ToArray(); Assert.AreEqual(4, msgs.Length); StringAssert.StartsWith($"Berekening van '{calculation.Name}' gestart om: ", msgs[0]); StringAssert.StartsWith($"De berekening voor kunstwerk sluiten '{calculation.Name}' is niet gelukt. Bekijk het foutrapport door op details te klikken.", msgs[1]); @@ -1019,7 +1019,7 @@ using (new HydraRingCalculatorFactoryConfig()) { - var calculator = ((TestHydraRingCalculatorFactory) HydraRingCalculatorFactory.Instance).StructuresClosureCalculator; + TestStructuresClosureCalculator calculator = ((TestHydraRingCalculatorFactory) HydraRingCalculatorFactory.Instance).StructuresClosureCalculator; calculator.EndInFailure = true; var exceptionThrown = false; @@ -1043,7 +1043,7 @@ // Assert TestHelper.AssertLogMessages(call, messages => { - var msgs = messages.ToArray(); + string[] msgs = messages.ToArray(); Assert.AreEqual(4, msgs.Length); StringAssert.StartsWith($"Berekening van '{calculation.Name}' gestart om: ", msgs[0]); StringAssert.StartsWith($"De berekening voor kunstwerk sluiten '{calculation.Name}' is niet gelukt. Er is geen foutrapport beschikbaar.", msgs[1]); @@ -1082,12 +1082,12 @@ using (new HydraRingCalculatorFactoryConfig()) { - var calculator = ((TestHydraRingCalculatorFactory) HydraRingCalculatorFactory.Instance).StructuresClosureCalculator; + TestStructuresClosureCalculator calculator = ((TestHydraRingCalculatorFactory) HydraRingCalculatorFactory.Instance).StructuresClosureCalculator; calculator.EndInFailure = false; calculator.LastErrorFileContent = "An error occurred"; var exceptionThrown = false; - var exceptionMessage = string.Empty; + string exceptionMessage = string.Empty; // Call Action call = () => @@ -1109,7 +1109,7 @@ // Assert TestHelper.AssertLogMessages(call, messages => { - var msgs = messages.ToArray(); + string[] msgs = messages.ToArray(); Assert.AreEqual(4, msgs.Length); StringAssert.StartsWith($"Berekening van '{calculation.Name}' gestart om: ", msgs[0]); StringAssert.StartsWith($"De berekening voor kunstwerk sluiten '{calculation.Name}' is niet gelukt. Bekijk het foutrapport door op details te klikken.", msgs[1]);