Index: Core/Common/src/Core.Common.Base/Properties/Resources.Designer.cs =================================================================== diff -u -r454c559173fa5069917f2aab1a4d65ddbb019b3a -r5e6eacaf76f765ba77febee673e9e94895e46feb --- Core/Common/src/Core.Common.Base/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 454c559173fa5069917f2aab1a4d65ddbb019b3a) +++ Core/Common/src/Core.Common.Base/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 5e6eacaf76f765ba77febee673e9e94895e46feb) @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.18444 +// Runtime Version:4.0.30319.17929 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -116,16 +116,6 @@ } /// - /// Looks up a localized string similar to Gras erosie kruin en binnentalud '{0}' niet gelukt.. - /// - public static string GrassCoverErosionInwardsCalculationService_Calculate_Error_in_grass_cover_erosion_inwards_0_calculation { - get { - return ResourceManager.GetString("GrassCoverErosionInwardsCalculationService_Calculate_Error_in_grass_cover_erosion" + - "_inwards_0_calculation", resourceCulture); - } - } - - /// /// Looks up a localized string similar to Dijkprofielen. /// public static string GrassCoverErosionInwardsGuiPlugin_DikeProfilesContext_DisplayName { Index: Core/Common/src/Core.Common.Base/Properties/Resources.resx =================================================================== diff -u -r454c559173fa5069917f2aab1a4d65ddbb019b3a -r5e6eacaf76f765ba77febee673e9e94895e46feb --- Core/Common/src/Core.Common.Base/Properties/Resources.resx (.../Resources.resx) (revision 454c559173fa5069917f2aab1a4d65ddbb019b3a) +++ Core/Common/src/Core.Common.Base/Properties/Resources.resx (.../Resources.resx) (revision 5e6eacaf76f765ba77febee673e9e94895e46feb) @@ -177,9 +177,6 @@ De waarde moet tussen 0 en 1 zijn. - - Gras erosie kruin en binnentalud '{0}' niet gelukt. - Dijkprofielen Index: Ringtoets/Common/src/Ringtoets.Common.Service/CalculationServiceHelper.cs =================================================================== diff -u -r49d90fb457184cd520ada77ee07774405985abd5 -r5e6eacaf76f765ba77febee673e9e94895e46feb --- Ringtoets/Common/src/Ringtoets.Common.Service/CalculationServiceHelper.cs (.../CalculationServiceHelper.cs) (revision 49d90fb457184cd520ada77ee07774405985abd5) +++ Ringtoets/Common/src/Ringtoets.Common.Service/CalculationServiceHelper.cs (.../CalculationServiceHelper.cs) (revision 5e6eacaf76f765ba77febee673e9e94895e46feb) @@ -20,7 +20,7 @@ // All rights reserved. using System; -using System.Collections.Generic; +using System.Linq; using log4net; using Ringtoets.Common.Service.Properties; @@ -31,39 +31,42 @@ /// public static class CalculationServiceHelper { - private static readonly ILog calculationServiceHelperLogger = LogManager.GetLogger(typeof(CalculationServiceHelper)); + private static readonly ILog log = LogManager.GetLogger(typeof(CalculationServiceHelper)); /// - /// Template method for performing validation. + /// Method for performing validation. Error and status information is logged during + /// the execution of the operation. /// /// The name of the calculation. /// The method used to perform the validation. - /// False if contains validation errors; True otherwise. - public static bool PerformValidation(string name, Func> validationFunc) + /// True if has no validation errors; False otherwise. + public static bool PerformValidation(string name, Func validationFunc) { LogValidationBeginTime(name); var inputValidationResults = validationFunc(); - if (inputValidationResults.Count > 0) + if (inputValidationResults.Any()) { - LogMessagesAsError(Resources.Error_in_validation_0, inputValidationResults.ToArray()); + LogMessagesAsError(Resources.Error_in_validation_0, inputValidationResults); } LogValidationEndTime(name); - return inputValidationResults.Count == 0; + return !inputValidationResults.Any(); } /// - /// Template method for performing calculations. + /// Method for performing calculations. Error and status information is logged during + /// the execution of the operation. /// /// The output type. /// The name of the calculation. /// The method used to perform the calculation. - /// The error message to show when the output is null. - /// on a successful calculation, null otherwise. - public static T PerformCalculation(string name, Func calculationFunc, string errorMessage) + /// The error message to show when the output is null. + /// on a successful calculation, null otherwise. + /// When throws an exception, this will not be catched in this method. + public static T PerformCalculation(string name, Func calculationFunc, string outputIsNullErrorMessage) { LogCalculationBeginTime(name); @@ -73,7 +76,7 @@ if (output == null) { - LogMessagesAsError(errorMessage, name); + LogMessagesAsError(outputIsNullErrorMessage, name); } return output; @@ -93,47 +96,47 @@ { foreach (var errorMessage in errorMessages) { - calculationServiceHelperLogger.ErrorFormat(format, errorMessage); + log.ErrorFormat(format, errorMessage); } } /// /// Logs the begin time of the validation. /// - /// The name used for the log message. + /// The name of the object being validated. public static void LogValidationBeginTime(string name) { - calculationServiceHelperLogger.Info(string.Format(Resources.Validation_Subject_0_started_Time_1_, + log.Info(string.Format(Resources.Validation_Subject_0_started_Time_1_, name, DateTimeService.CurrentTimeAsString)); } /// /// Logs the end time of the validation. /// - /// The name used for the log message. + /// The name of the object being validated. public static void LogValidationEndTime(string name) { - calculationServiceHelperLogger.Info(string.Format(Resources.Validation_Subject_0_ended_Time_1_, + log.Info(string.Format(Resources.Validation_Subject_0_ended_Time_1_, name, DateTimeService.CurrentTimeAsString)); } /// /// Logs the begin time of the calculation. /// - /// The name used for the log message. + /// The name of the calculation being started. public static void LogCalculationBeginTime(string name) { - calculationServiceHelperLogger.Info(string.Format(Resources.Calculation_Subject_0_started_Time_1_, + log.Info(string.Format(Resources.Calculation_Subject_0_started_Time_1_, name, DateTimeService.CurrentTimeAsString)); } /// /// Logs the end time of the calculation. /// - /// The name used for the log message. + /// TThe name of the calculation that has ended. public static void LogCalculationEndTime(string name) { - calculationServiceHelperLogger.Info(string.Format(Resources.Calculation_Subject_0_ended_Time_1_, + log.Info(string.Format(Resources.Calculation_Subject_0_ended_Time_1_, name, DateTimeService.CurrentTimeAsString)); } } Index: Ringtoets/Common/test/Ringtoets.Common.Service.Test/CalculationServiceHelperTest.cs =================================================================== diff -u -r49d90fb457184cd520ada77ee07774405985abd5 -r5e6eacaf76f765ba77febee673e9e94895e46feb --- Ringtoets/Common/test/Ringtoets.Common.Service.Test/CalculationServiceHelperTest.cs (.../CalculationServiceHelperTest.cs) (revision 49d90fb457184cd520ada77ee07774405985abd5) +++ Ringtoets/Common/test/Ringtoets.Common.Service.Test/CalculationServiceHelperTest.cs (.../CalculationServiceHelperTest.cs) (revision 5e6eacaf76f765ba77febee673e9e94895e46feb) @@ -20,7 +20,7 @@ // All rights reserved. using System; -using System.Collections.Generic; +using System.Globalization; using System.Linq; using Core.Common.TestUtil; using NUnit.Framework; @@ -35,8 +35,10 @@ { // Setup string name = "Test name"; - List errorMessages = new List(); - errorMessages.Add("Error message 1"); + string[] errorMessages = + { + "Error message 1" + }; // Call bool valid = false; @@ -59,7 +61,8 @@ { // Setup string name = "Test name"; - List errorMessages = new List(); + string[] errorMessages = + {}; // Call bool valid = false; @@ -82,7 +85,7 @@ // Setup string name = "Test name"; string errorMessage = "There was an error: {0}"; - + object output = null; // Call @@ -152,6 +155,7 @@ { // Setup var name = "Test name"; + DateTime dateTime = DateTime.Now; // Call Action call = () => CalculationServiceHelper.LogValidationBeginTime(name); @@ -162,6 +166,8 @@ var msgs = messages.ToArray(); Assert.AreEqual(1, msgs.Length); StringAssert.StartsWith(string.Format("Validatie van '{0}' gestart om:", name), msgs[0]); + + AssertLogTime(msgs[0], dateTime); }); } @@ -170,6 +176,7 @@ { // Setup var name = "Test name"; + DateTime dateTime = DateTime.Now; // Call Action call = () => CalculationServiceHelper.LogValidationEndTime(name); @@ -180,6 +187,8 @@ var msgs = messages.ToArray(); Assert.AreEqual(1, msgs.Length); StringAssert.StartsWith(string.Format("Validatie van '{0}' beëindigd om:", name), msgs[0]); + + AssertLogTime(msgs[0], dateTime); }); } @@ -188,6 +197,7 @@ { // Setup var name = "Test name"; + DateTime dateTime = DateTime.Now; // Call Action call = () => CalculationServiceHelper.LogCalculationBeginTime(name); @@ -198,6 +208,8 @@ var msgs = messages.ToArray(); Assert.AreEqual(1, msgs.Length); StringAssert.StartsWith(string.Format("Berekening van '{0}' gestart om:", name), msgs[0]); + + AssertLogTime(msgs[0], dateTime); }); } @@ -206,6 +218,7 @@ { // Setup var name = "Test name"; + DateTime dateTime = DateTime.Now; // Call Action call = () => CalculationServiceHelper.LogCalculationEndTime(name); @@ -216,7 +229,19 @@ var msgs = messages.ToArray(); Assert.AreEqual(1, msgs.Length); StringAssert.StartsWith(string.Format("Berekening van '{0}' beëindigd om:", name), msgs[0]); + + AssertLogTime(msgs[0], dateTime); }); } + + private static void AssertLogTime(string message, DateTime dateTime) + { + string[] logMessageArray = message.Split(':'); + string logMessageDateTime = string.Format("{0}:{1}:{2}", logMessageArray[1], logMessageArray[2], logMessageArray[3]).Substring(1); + + DateTime dateTimeFromLog = DateTime.ParseExact(logMessageDateTime, "HH:mm:ss", CultureInfo.CurrentCulture); + TimeSpan timeSpan = dateTimeFromLog - dateTime; + Assert.LessOrEqual(timeSpan, TimeSpan.FromMilliseconds(500)); + } } -} +} \ No newline at end of file Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Plugin/GrassCoverErosionInwardsGuiPlugin.cs =================================================================== diff -u -raf83c5308c30a462589f45eecd5ba0dfac0cda00 -r5e6eacaf76f765ba77febee673e9e94895e46feb --- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Plugin/GrassCoverErosionInwardsGuiPlugin.cs (.../GrassCoverErosionInwardsGuiPlugin.cs) (revision af83c5308c30a462589f45eecd5ba0dfac0cda00) +++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Plugin/GrassCoverErosionInwardsGuiPlugin.cs (.../GrassCoverErosionInwardsGuiPlugin.cs) (revision 5e6eacaf76f765ba77febee673e9e94895e46feb) @@ -167,10 +167,10 @@ ActivityProgressDialogRunner.Run(Gui.MainWindow, calculations.Select(calc => new GrassCoverErosionInwardsCalculationActivity(calc, Path.GetDirectoryName(assessmentSection.HydraulicBoundaryDatabase.FilePath), failureMechanism, - assessmentSection)).ToList()); + assessmentSection)).ToArray()); } - private static string AllDataAvailable(IAssessmentSection assessmentSection, GrassCoverErosionInwardsFailureMechanism failureMechanism) + private static string ValidateAllDataAvailableAndGetErrorMessage(IAssessmentSection assessmentSection, GrassCoverErosionInwardsFailureMechanism failureMechanism) { if (!failureMechanism.Sections.Any()) { @@ -274,7 +274,7 @@ .AddSeparator() .AddToggleRelevancyOfFailureMechanismItem(grassCoverErosionInwardsFailureMechanismContext, RemoveAllViewsForItem) .AddSeparator() - .AddPerformAllCalculationsInFailureMechanismItem(grassCoverErosionInwardsFailureMechanismContext, CalculateAll, EnablePerformAllCalculationsInFailureMechanism) + .AddPerformAllCalculationsInFailureMechanismItem(grassCoverErosionInwardsFailureMechanismContext, CalculateAll, ValidateAllDataAvailableAndGetErrorMessageForCalculationsInFailureMechanism) .AddClearAllCalculationOutputInFailureMechanismItem(grassCoverErosionInwardsFailureMechanismContext.WrappedData) .AddSeparator() .AddImportItem() @@ -303,9 +303,9 @@ .Build(); } - private static string EnablePerformAllCalculationsInFailureMechanism(GrassCoverErosionInwardsFailureMechanismContext context) + private static string ValidateAllDataAvailableAndGetErrorMessageForCalculationsInFailureMechanism(GrassCoverErosionInwardsFailureMechanismContext context) { - return AllDataAvailable(context.Parent, context.WrappedData); + return ValidateAllDataAvailableAndGetErrorMessage(context.Parent, context.WrappedData); } private void CalculateAll(GrassCoverErosionInwardsFailureMechanismContext context) @@ -362,7 +362,7 @@ builder.AddCreateCalculationGroupItem(group) .AddCreateCalculationItem(context, AddCalculation) .AddSeparator() - .AddPerformAllCalculationsInGroupItem(group, context, CalculateAll, EnablePerformAllCalculationsInGroup) + .AddPerformAllCalculationsInGroupItem(group, context, CalculateAll, ValidateAllDataAvailableAndGetErrorMessageForCalculationsInGroup) .AddClearAllCalculationOutputInGroupItem(group) .AddSeparator(); @@ -401,9 +401,9 @@ context.WrappedData.NotifyObservers(); } - private static string EnablePerformAllCalculationsInGroup(GrassCoverErosionInwardsCalculationGroupContext context) + private static string ValidateAllDataAvailableAndGetErrorMessageForCalculationsInGroup(GrassCoverErosionInwardsCalculationGroupContext context) { - return AllDataAvailable(context.AssessmentSection, context.FailureMechanism); + return ValidateAllDataAvailableAndGetErrorMessage(context.AssessmentSection, context.FailureMechanism); } private void CalculateAll(CalculationGroup group, GrassCoverErosionInwardsCalculationGroupContext context) @@ -444,7 +444,7 @@ GrassCoverErosionInwardsCalculation calculation = context.WrappedData; - return builder.AddPerformCalculationItem(calculation, context, Calculate, EnablePerformCalculation) + return builder.AddPerformCalculationItem(calculation, context, Calculate, ValidateAllDataAvailableAndGetErrorMessageForCalculation) .AddClearCalculationOutputItem(calculation) .AddSeparator() .AddRenameItem() @@ -460,9 +460,9 @@ .Build(); } - private static string EnablePerformCalculation(GrassCoverErosionInwardsCalculationContext context) + private static string ValidateAllDataAvailableAndGetErrorMessageForCalculation(GrassCoverErosionInwardsCalculationContext context) { - return AllDataAvailable(context.AssessmentSection, context.FailureMechanism); + return ValidateAllDataAvailableAndGetErrorMessage(context.AssessmentSection, context.FailureMechanism); } private void Calculate(GrassCoverErosionInwardsCalculation calculation, GrassCoverErosionInwardsCalculationContext context) Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Service/GrassCoverErosionInwardsCalculationActivity.cs =================================================================== diff -u -r6ccc539ce58e63f0e0fbff0da189c87b65146129 -r5e6eacaf76f765ba77febee673e9e94895e46feb --- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Service/GrassCoverErosionInwardsCalculationActivity.cs (.../GrassCoverErosionInwardsCalculationActivity.cs) (revision 6ccc539ce58e63f0e0fbff0da189c87b65146129) +++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Service/GrassCoverErosionInwardsCalculationActivity.cs (.../GrassCoverErosionInwardsCalculationActivity.cs) (revision 5e6eacaf76f765ba77febee673e9e94895e46feb) @@ -39,14 +39,6 @@ private readonly GrassCoverErosionInwardsFailureMechanism failureMechanism; private readonly IAssessmentSection assessmentSection; - public override string Name - { - get - { - return calculation.Name; - } - } - /// /// Creates a new instance of . /// @@ -63,9 +55,17 @@ this.assessmentSection = assessmentSection; } + public override string Name + { + get + { + return calculation.Name; + } + } + protected override void OnRun() { - var failureMechanismSection = failureMechanism.Sections.First(); // TODO: Obtain dike section based on cross section of structure with reference line + var failureMechanismSection = failureMechanism.Sections.First(); // TODO: Obtain dike section based on cross section of dike profile with reference line PerformRun(() => GrassCoverErosionInwardsCalculationService.Validate(calculation, assessmentSection), () => calculation.ClearOutput(), Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Service/GrassCoverErosionInwardsCalculationService.cs =================================================================== diff -u -r49d90fb457184cd520ada77ee07774405985abd5 -r5e6eacaf76f765ba77febee673e9e94895e46feb --- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Service/GrassCoverErosionInwardsCalculationService.cs (.../GrassCoverErosionInwardsCalculationService.cs) (revision 49d90fb457184cd520ada77ee07774405985abd5) +++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Service/GrassCoverErosionInwardsCalculationService.cs (.../GrassCoverErosionInwardsCalculationService.cs) (revision 5e6eacaf76f765ba77febee673e9e94895e46feb) @@ -21,11 +21,11 @@ using System.Collections.Generic; using System.Linq; -using Core.Common.Base.Properties; using Ringtoets.Common.Data.AssessmentSection; using Ringtoets.Common.Data.FailureMechanism; using Ringtoets.Common.Service; using Ringtoets.GrassCoverErosionInwards.Data; +using Ringtoets.GrassCoverErosionInwards.Service.Properties; using Ringtoets.HydraRing.Calculation.Data; using Ringtoets.HydraRing.Calculation.Data.Input.Overtopping; using Ringtoets.HydraRing.Calculation.Data.Output; @@ -46,27 +46,27 @@ /// /// The for which to validate the values. /// The for which to validate the values. - /// False if contains validation errors; True otherwise. + /// Truec> if has no validation errors; Falsec> otherwise. internal static bool Validate(GrassCoverErosionInwardsCalculation calculation, IAssessmentSection assessmentSection) { return CalculationServiceHelper.PerformValidation(calculation.Name, () => ValidateInput(calculation.InputParameters, assessmentSection)); } /// - /// Performs a height structures calculation based on the supplied and sets + /// Performs a grass cover erosion inwards calculation based on the supplied and sets /// if the calculation was successful. Error and status information is logged during the execution of the operation. /// - /// The to base the input for the calculation upon. + /// The that holds all the information required to perform the calculation. /// The directory of the HLCD file that should be used for performing the calculation. /// The to create input with. /// The id of the ring to perform the calculation for. - /// The to create the input with for the calculation. + /// Calculation input parameters that apply to all instances. /// A on a successful calculation, null otherwise. internal static ExceedanceProbabilityCalculationOutput Calculate(GrassCoverErosionInwardsCalculation calculation, string hlcdDirectory, FailureMechanismSection failureMechanismSection, string ringId, GeneralGrassCoverErosionInwardsInput generalInput) { - var input = CreateInput(calculation, failureMechanismSection, generalInput); + OvertoppingCalculationInput input = CreateInput(calculation, failureMechanismSection, generalInput); return CalculationServiceHelper.PerformCalculation(calculation.Name, () => HydraRingCalculationService.PerformCalculation(hlcdDirectory, ringId, HydraRingTimeIntegrationSchemeType.FBC, HydraRingUncertaintiesType.All, input), @@ -75,7 +75,7 @@ private static OvertoppingCalculationInput CreateInput(GrassCoverErosionInwardsCalculation calculation, FailureMechanismSection failureMechanismSection, GeneralGrassCoverErosionInwardsInput generalInput) { - return new OvertoppingCalculationInput((int) calculation.InputParameters.HydraulicBoundaryLocation.Id, + return new OvertoppingCalculationInput(calculation.InputParameters.HydraulicBoundaryLocation.Id, new HydraRingSection(1, failureMechanismSection.Name, failureMechanismSection.GetSectionLength(), calculation.InputParameters.Orientation), calculation.InputParameters.DikeHeight, generalInput.CriticalOvertoppingModelFactor, @@ -92,12 +92,12 @@ private static HydraRingBreakWater ParseBreakWater(GrassCoverErosionInwardsInput input) { - return input.UseBreakWater ? new HydraRingBreakWater((int)input.BreakWater.Type, input.BreakWater.Height) : null; + return input.UseBreakWater ? new HydraRingBreakWater((int) input.BreakWater.Type, input.BreakWater.Height) : null; } private static IEnumerable ParseForeshore(GrassCoverErosionInwardsInput input) { - var firstProfileSection = input.ForeshoreGeometry.FirstOrDefault(); + ProfileSection firstProfileSection = input.ForeshoreGeometry.FirstOrDefault(); if (!input.UseForeshore || firstProfileSection == null) { yield break; @@ -113,7 +113,7 @@ private static IEnumerable ParseProfilePoints(IEnumerable profileSections) { - var firstProfileSection = profileSections.FirstOrDefault(); + RoughnessProfileSection firstProfileSection = profileSections.FirstOrDefault(); if (firstProfileSection == null) { yield break; @@ -128,7 +128,7 @@ } } - private static List ValidateInput(GrassCoverErosionInwardsInput inputParameters, IAssessmentSection assessmentSection) + private static string[] ValidateInput(GrassCoverErosionInwardsInput inputParameters, IAssessmentSection assessmentSection) { List validationResult = new List(); @@ -144,7 +144,7 @@ validationResult.Add(validationProblem); } - return validationResult; + return validationResult.ToArray(); } } } \ No newline at end of file Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Service/Properties/Resources.Designer.cs =================================================================== diff -u --- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Service/Properties/Resources.Designer.cs (revision 0) +++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Service/Properties/Resources.Designer.cs (revision 5e6eacaf76f765ba77febee673e9e94895e46feb) @@ -0,0 +1,73 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.17929 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Ringtoets.GrassCoverErosionInwards.Service.Properties { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Ringtoets.GrassCoverErosionInwards.Service.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized string similar to De berekening voor grasbekleding erosie kruin en binnentalud '{0}' is niet gelukt.. + /// + internal static string GrassCoverErosionInwardsCalculationService_Calculate_Error_in_grass_cover_erosion_inwards_0_calculation { + get { + return ResourceManager.GetString("GrassCoverErosionInwardsCalculationService_Calculate_Error_in_grass_cover_erosion" + + "_inwards_0_calculation", resourceCulture); + } + } + } +} Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Service/Properties/Resources.resx =================================================================== diff -u --- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Service/Properties/Resources.resx (revision 0) +++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Service/Properties/Resources.resx (revision 5e6eacaf76f765ba77febee673e9e94895e46feb) @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + De berekening voor grasbekleding erosie kruin en binnentalud '{0}' is niet gelukt. + + \ No newline at end of file Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Service/Ringtoets.GrassCoverErosionInwards.Service.csproj =================================================================== diff -u -r0a51f20ac93373a43f79bb4c6327bce1d46545c6 -r5e6eacaf76f765ba77febee673e9e94895e46feb --- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Service/Ringtoets.GrassCoverErosionInwards.Service.csproj (.../Ringtoets.GrassCoverErosionInwards.Service.csproj) (revision 0a51f20ac93373a43f79bb4c6327bce1d46545c6) +++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Service/Ringtoets.GrassCoverErosionInwards.Service.csproj (.../Ringtoets.GrassCoverErosionInwards.Service.csproj) (revision 5e6eacaf76f765ba77febee673e9e94895e46feb) @@ -32,10 +32,6 @@ AllRules.ruleset - - ..\..\..\..\packages\log4net.2.0.4\lib\net40-full\log4net.dll - True - @@ -46,6 +42,11 @@ + + True + True + Resources.resx + @@ -93,8 +94,13 @@ Copying.licenseheader - + + + ResXFileCodeGenerator + Resources.Designer.cs + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + De berekening voor hoogte kunstwerk '{0}' is niet gelukt. + + \ No newline at end of file Fisheye: Tag 5e6eacaf76f765ba77febee673e9e94895e46feb refers to a dead (removed) revision in file `Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Service/Resources.Designer.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 5e6eacaf76f765ba77febee673e9e94895e46feb refers to a dead (removed) revision in file `Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Service/Resources.resx'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Service/Ringtoets.HeightStructures.Service.csproj =================================================================== diff -u -r0a51f20ac93373a43f79bb4c6327bce1d46545c6 -r5e6eacaf76f765ba77febee673e9e94895e46feb --- Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Service/Ringtoets.HeightStructures.Service.csproj (.../Ringtoets.HeightStructures.Service.csproj) (revision 0a51f20ac93373a43f79bb4c6327bce1d46545c6) +++ Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Service/Ringtoets.HeightStructures.Service.csproj (.../Ringtoets.HeightStructures.Service.csproj) (revision 5e6eacaf76f765ba77febee673e9e94895e46feb) @@ -46,7 +46,7 @@ - + True True Resources.resx @@ -101,7 +101,7 @@ - + ResXFileCodeGenerator Resources.Designer.cs Designer Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/TreeNodeInfos/HeightStructuresCalculationContextTreeNodeInfoTest.cs =================================================================== diff -u -r0a51f20ac93373a43f79bb4c6327bce1d46545c6 -r5e6eacaf76f765ba77febee673e9e94895e46feb --- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/TreeNodeInfos/HeightStructuresCalculationContextTreeNodeInfoTest.cs (.../HeightStructuresCalculationContextTreeNodeInfoTest.cs) (revision 0a51f20ac93373a43f79bb4c6327bce1d46545c6) +++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/TreeNodeInfos/HeightStructuresCalculationContextTreeNodeInfoTest.cs (.../HeightStructuresCalculationContextTreeNodeInfoTest.cs) (revision 5e6eacaf76f765ba77febee673e9e94895e46feb) @@ -465,7 +465,7 @@ 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("Hoogte kunstwerk '{0}' niet gelukt.", calculation.Name), msgs[3]); + StringAssert.StartsWith(String.Format("De berekening voor hoogte kunstwerk '{0}' is niet gelukt.", calculation.Name), msgs[3]); StringAssert.StartsWith(String.Format("Berekening van '{0}' beëindigd om: ", calculation.Name), msgs[4]); }); Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/TreeNodeInfos/HeightStructuresCalculationGroupContextTreeNodeInfoTest.cs =================================================================== diff -u -r0a51f20ac93373a43f79bb4c6327bce1d46545c6 -r5e6eacaf76f765ba77febee673e9e94895e46feb --- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/TreeNodeInfos/HeightStructuresCalculationGroupContextTreeNodeInfoTest.cs (.../HeightStructuresCalculationGroupContextTreeNodeInfoTest.cs) (revision 0a51f20ac93373a43f79bb4c6327bce1d46545c6) +++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/TreeNodeInfos/HeightStructuresCalculationGroupContextTreeNodeInfoTest.cs (.../HeightStructuresCalculationGroupContextTreeNodeInfoTest.cs) (revision 5e6eacaf76f765ba77febee673e9e94895e46feb) @@ -607,12 +607,12 @@ StringAssert.StartsWith("Validatie van 'A' gestart om: ", messageList[0]); StringAssert.StartsWith("Validatie van 'A' beëindigd om: ", messageList[1]); StringAssert.StartsWith("Berekening van 'A' gestart om: ", messageList[2]); - Assert.AreEqual("Hoogte kunstwerk 'A' niet gelukt.", messageList[3]); + Assert.AreEqual("De berekening voor hoogte kunstwerk 'A' is niet gelukt.", messageList[3]); StringAssert.StartsWith("Berekening van 'A' beëindigd om: ", messageList[4]); StringAssert.StartsWith("Validatie van 'B' gestart om: ", messageList[5]); StringAssert.StartsWith("Validatie van 'B' beëindigd om: ", messageList[6]); StringAssert.StartsWith("Berekening van 'B' gestart om: ", messageList[7]); - Assert.AreEqual("Hoogte kunstwerk 'B' niet gelukt.", messageList[8]); + Assert.AreEqual("De berekening voor hoogte kunstwerk 'B' is niet gelukt.", messageList[8]); StringAssert.StartsWith("Berekening van 'B' beëindigd om: ", messageList[9]); Assert.AreEqual("Uitvoeren van 'A' is mislukt.", messageList[10]); Assert.AreEqual("Uitvoeren van 'B' is mislukt.", messageList[11]); Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/TreeNodeInfos/HeightStructuresFailureMechanismContextTreeNodeInfoTest.cs =================================================================== diff -u -r0a51f20ac93373a43f79bb4c6327bce1d46545c6 -r5e6eacaf76f765ba77febee673e9e94895e46feb --- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/TreeNodeInfos/HeightStructuresFailureMechanismContextTreeNodeInfoTest.cs (.../HeightStructuresFailureMechanismContextTreeNodeInfoTest.cs) (revision 0a51f20ac93373a43f79bb4c6327bce1d46545c6) +++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/TreeNodeInfos/HeightStructuresFailureMechanismContextTreeNodeInfoTest.cs (.../HeightStructuresFailureMechanismContextTreeNodeInfoTest.cs) (revision 5e6eacaf76f765ba77febee673e9e94895e46feb) @@ -589,12 +589,12 @@ StringAssert.StartsWith("Validatie van 'A' gestart om: ", messageList[0]); StringAssert.StartsWith("Validatie van 'A' beëindigd om: ", messageList[1]); StringAssert.StartsWith("Berekening van 'A' gestart om: ", messageList[2]); - Assert.AreEqual("Hoogte kunstwerk 'A' niet gelukt.", messageList[3]); + Assert.AreEqual("De berekening voor hoogte kunstwerk 'A' is niet gelukt.", messageList[3]); StringAssert.StartsWith("Berekening van 'A' beëindigd om: ", messageList[4]); StringAssert.StartsWith("Validatie van 'B' gestart om: ", messageList[5]); StringAssert.StartsWith("Validatie van 'B' beëindigd om: ", messageList[6]); StringAssert.StartsWith("Berekening van 'B' gestart om: ", messageList[7]); - Assert.AreEqual("Hoogte kunstwerk 'B' niet gelukt.", messageList[8]); + Assert.AreEqual("De berekening voor hoogte kunstwerk 'B' is niet gelukt.", messageList[8]); StringAssert.StartsWith("Berekening van 'B' beëindigd om: ", messageList[9]); Assert.AreEqual("Uitvoeren van 'A' is mislukt.", messageList[10]); Assert.AreEqual("Uitvoeren van 'B' is mislukt.", messageList[11]); Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Integration.Test/HeightStructuresCalculationActivityIntegrationTest.cs =================================================================== diff -u -r6ccc539ce58e63f0e0fbff0da189c87b65146129 -r5e6eacaf76f765ba77febee673e9e94895e46feb --- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Integration.Test/HeightStructuresCalculationActivityIntegrationTest.cs (.../HeightStructuresCalculationActivityIntegrationTest.cs) (revision 6ccc539ce58e63f0e0fbff0da189c87b65146129) +++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Integration.Test/HeightStructuresCalculationActivityIntegrationTest.cs (.../HeightStructuresCalculationActivityIntegrationTest.cs) (revision 5e6eacaf76f765ba77febee673e9e94895e46feb) @@ -207,7 +207,7 @@ 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("Hoogte kunstwerk '{0}' niet gelukt.", calculation.Name), msgs[3]); + StringAssert.StartsWith(string.Format("De berekening voor hoogte kunstwerk '{0}' is niet gelukt.", calculation.Name), msgs[3]); StringAssert.StartsWith(string.Format("Berekening van '{0}' beëindigd om: ", calculation.Name), msgs[4]); }); Assert.AreEqual(ActivityState.Failed, activity.State); Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Integration.Test/HeightStructuresCalculationServiceIntegrationTest.cs =================================================================== diff -u -r0a51f20ac93373a43f79bb4c6327bce1d46545c6 -r5e6eacaf76f765ba77febee673e9e94895e46feb --- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Integration.Test/HeightStructuresCalculationServiceIntegrationTest.cs (.../HeightStructuresCalculationServiceIntegrationTest.cs) (revision 0a51f20ac93373a43f79bb4c6327bce1d46545c6) +++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Integration.Test/HeightStructuresCalculationServiceIntegrationTest.cs (.../HeightStructuresCalculationServiceIntegrationTest.cs) (revision 5e6eacaf76f765ba77febee673e9e94895e46feb) @@ -46,11 +46,7 @@ { // Setup var assessmentSection = new AssessmentSection(AssessmentSectionComposition.Dike); - string validFilePath = Path.Combine(testDataPath, "HRD dutch coast south.sqlite"); - using (var importer = new HydraulicBoundaryDatabaseImporter()) - { - importer.Import(assessmentSection, validFilePath); - } + ImportHydraulicBoundaryDatabase(assessmentSection); const string name = ""; @@ -59,7 +55,6 @@ Name = name }; - // Call bool isValid = false; Action call = () => isValid = HeightStructuresCalculationService.Validate(calculation, assessmentSection); @@ -99,7 +94,6 @@ } }; - // Call bool isValid = false; Action call = () => isValid = HeightStructuresCalculationService.Validate(calculation, assessmentSection); @@ -121,11 +115,7 @@ { // Setup var assessmentSection = new AssessmentSection(AssessmentSectionComposition.Dike); - string validFilePath = Path.Combine(testDataPath, "HRD dutch coast south.sqlite"); - using (var importer = new HydraulicBoundaryDatabaseImporter()) - { - importer.Import(assessmentSection, validFilePath); - } + ImportHydraulicBoundaryDatabase(assessmentSection); const string name = ""; @@ -138,7 +128,6 @@ } }; - // Call bool isValid = false; Action call = () => isValid = HeightStructuresCalculationService.Validate(calculation, assessmentSection); @@ -159,17 +148,10 @@ { // Setup var assessmentSection = new AssessmentSection(AssessmentSectionComposition.Dike); + ImportHydraulicBoundaryDatabase(assessmentSection); - string validFilePath = Path.Combine(testDataPath, "HRD dutch coast south.sqlite"); - - using (var importer = new HydraulicBoundaryDatabaseImporter()) + assessmentSection.HeightStructures.AddSection(new FailureMechanismSection("test section", new[] { - importer.Import(assessmentSection, validFilePath); - } - - var failureMechanism = new HeightStructuresFailureMechanism(); - failureMechanism.AddSection(new FailureMechanismSection("test section", new[] - { new Point2D(0, 0), new Point2D(1, 1) })); @@ -182,11 +164,11 @@ } }; - var failureMechanismSection = failureMechanism.Sections.First(); + var failureMechanismSection = assessmentSection.HeightStructures.Sections.First(); ExceedanceProbabilityCalculationOutput output = null; // Call - Action call = () => output = HeightStructuresCalculationService.Calculate(calculation, testDataPath, failureMechanismSection, failureMechanismSection.Name, failureMechanism.GeneralInput); + Action call = () => output = HeightStructuresCalculationService.Calculate(calculation, testDataPath, failureMechanismSection, failureMechanismSection.Name, assessmentSection.HeightStructures.GeneralInput); // Assert TestHelper.AssertLogMessages(call, messages => @@ -204,17 +186,10 @@ { // Setup var assessmentSection = new AssessmentSection(AssessmentSectionComposition.Dike); + ImportHydraulicBoundaryDatabase(assessmentSection); - string validFilePath = Path.Combine(testDataPath, "HRD dutch coast south.sqlite"); - - using (var importer = new HydraulicBoundaryDatabaseImporter()) + assessmentSection.HeightStructures.AddSection(new FailureMechanismSection("test section", new[] { - importer.Import(assessmentSection, validFilePath); - } - - var failureMechanism = new HeightStructuresFailureMechanism(); - failureMechanism.AddSection(new FailureMechanismSection("test section", new[] - { new Point2D(0, 0), new Point2D(1, 1) })); @@ -227,22 +202,31 @@ } }; - var failureMechanismSection = failureMechanism.Sections.First(); + var failureMechanismSection = assessmentSection.HeightStructures.Sections.First(); ExceedanceProbabilityCalculationOutput output = null; // Call - Action call = () => output = HeightStructuresCalculationService.Calculate(calculation, testDataPath, failureMechanismSection, failureMechanismSection.Name, failureMechanism.GeneralInput); + Action call = () => output = HeightStructuresCalculationService.Calculate(calculation, testDataPath, failureMechanismSection, failureMechanismSection.Name, assessmentSection.HeightStructures.GeneralInput); // Assert TestHelper.AssertLogMessages(call, messages => { var msgs = messages.ToArray(); Assert.AreEqual(3, msgs.Length); StringAssert.StartsWith(string.Format("Berekening van '{0}' gestart om: ", calculation.Name), msgs[0]); - StringAssert.StartsWith(string.Format("Hoogte kunstwerk '{0}' niet gelukt.", calculation.Name), msgs[1]); + StringAssert.StartsWith(string.Format("De berekening voor hoogte kunstwerk '{0}' is niet gelukt.", calculation.Name), msgs[1]); StringAssert.StartsWith(string.Format("Berekening van '{0}' beëindigd om: ", calculation.Name), msgs[2]); }); Assert.IsNull(output); } + + private void ImportHydraulicBoundaryDatabase(AssessmentSection assessmentSection) + { + string validFilePath = Path.Combine(testDataPath, "HRD dutch coast south.sqlite"); + using (var importer = new HydraulicBoundaryDatabaseImporter()) + { + importer.Import(assessmentSection, validFilePath); + } + } } } \ No newline at end of file Index: Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Activities/HydraRingActivity.cs =================================================================== diff -u -r6ccc539ce58e63f0e0fbff0da189c87b65146129 -r5e6eacaf76f765ba77febee673e9e94895e46feb --- Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Activities/HydraRingActivity.cs (.../HydraRingActivity.cs) (revision 6ccc539ce58e63f0e0fbff0da189c87b65146129) +++ Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Activities/HydraRingActivity.cs (.../HydraRingActivity.cs) (revision 5e6eacaf76f765ba77febee673e9e94895e46feb) @@ -32,7 +32,7 @@ public abstract class HydraRingActivity : Activity { /// - /// The output of the activity. + /// The output of the calculation. /// protected T Output; @@ -46,7 +46,10 @@ protected abstract override void OnFinish(); /// - /// Template method for performing the run of the activity. + /// Method for performing the run of the activity. The calculation will be validated + /// and after the validation is successful, the will be performed. + /// After that the calculation will be performed. Error and status information is logged during + /// the execution of the operation. /// /// The method to perform for validation. /// The method to perform for clearing the data of the output to set. @@ -71,11 +74,13 @@ } /// - /// Template method for performing the finish of the activity. + /// Method for performing the finish of the activity. If the calculation is successfull + /// executed, the output will be set on the calculation. After that the observers of + /// will be notified. /// /// The method to set the output on the object. /// The object to notify the observers upon. - protected void PerformFinish(Action setOutputAction, Observable observableObject) + protected void PerformFinish(Action setOutputAction, IObservable observableObject) { if (State == ActivityState.Executed) { Index: Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Data/Input/ExceedanceProbabilityCalculationInput.cs =================================================================== diff -u -rb9f6d46631bdb16c2f1e65e791dd31e9380ccd6e -r5e6eacaf76f765ba77febee673e9e94895e46feb --- Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Data/Input/ExceedanceProbabilityCalculationInput.cs (.../ExceedanceProbabilityCalculationInput.cs) (revision b9f6d46631bdb16c2f1e65e791dd31e9380ccd6e) +++ Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Data/Input/ExceedanceProbabilityCalculationInput.cs (.../ExceedanceProbabilityCalculationInput.cs) (revision 5e6eacaf76f765ba77febee673e9e94895e46feb) @@ -31,7 +31,7 @@ /// Creates a new instance of the class. /// /// The id of the hydraulic station to use during the calculation. - protected ExceedanceProbabilityCalculationInput(int hydraulicBoundaryLocationId) : base(hydraulicBoundaryLocationId) {} + protected ExceedanceProbabilityCalculationInput(long hydraulicBoundaryLocationId) : base(hydraulicBoundaryLocationId) {} public override int CalculationTypeId { Index: Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Data/Input/HydraRingCalculationInput.cs =================================================================== diff -u -r61f2445be56feb2180cb0990d8889164c17b79f0 -r5e6eacaf76f765ba77febee673e9e94895e46feb --- Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Data/Input/HydraRingCalculationInput.cs (.../HydraRingCalculationInput.cs) (revision 61f2445be56feb2180cb0990d8889164c17b79f0) +++ Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Data/Input/HydraRingCalculationInput.cs (.../HydraRingCalculationInput.cs) (revision 5e6eacaf76f765ba77febee673e9e94895e46feb) @@ -28,13 +28,13 @@ /// public abstract class HydraRingCalculationInput { - private readonly int hydraulicBoundaryLocationId; + private readonly long hydraulicBoundaryLocationId; /// /// Creates a new instance of the class. /// /// The id of the hydraulic station to use during the calculation. - protected HydraRingCalculationInput(int hydraulicBoundaryLocationId) + protected HydraRingCalculationInput(long hydraulicBoundaryLocationId) { this.hydraulicBoundaryLocationId = hydraulicBoundaryLocationId; } @@ -57,7 +57,7 @@ /// /// Gets the id of the hydraulic station to use during the calculation. /// - public int HydraulicBoundaryLocationId + public long HydraulicBoundaryLocationId { get { Index: Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Data/Input/Hydraulics/AssessmentLevelCalculationInput.cs =================================================================== diff -u -r315378ecfaa9a06a553863ca91b8f4d6252e7bae -r5e6eacaf76f765ba77febee673e9e94895e46feb --- Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Data/Input/Hydraulics/AssessmentLevelCalculationInput.cs (.../AssessmentLevelCalculationInput.cs) (revision 315378ecfaa9a06a553863ca91b8f4d6252e7bae) +++ Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Data/Input/Hydraulics/AssessmentLevelCalculationInput.cs (.../AssessmentLevelCalculationInput.cs) (revision 5e6eacaf76f765ba77febee673e9e94895e46feb) @@ -33,11 +33,12 @@ /// /// Creates a new instance of the class. /// + /// The id of the section to use during the calculation. /// The id of the hydraulic station to use during the calculation. /// The norm to use during the calculation. - public AssessmentLevelCalculationInput(int hydraulicBoundaryLocationId, double norm) : base(hydraulicBoundaryLocationId, norm) + public AssessmentLevelCalculationInput(int sectionId, long hydraulicBoundaryLocationId, double norm) : base(hydraulicBoundaryLocationId, norm) { - section = new HydraRingSection(HydraulicBoundaryLocationId, HydraulicBoundaryLocationId.ToString(), double.NaN, double.NaN); + section = new HydraRingSection(sectionId, sectionId.ToString(), double.NaN, double.NaN); } public override HydraRingFailureMechanismType FailureMechanismType Index: Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Data/Input/Overtopping/OvertoppingCalculationInput.cs =================================================================== diff -u -rfe12df1b9f055c64ed8c26123d9c45bea6490bcc -r5e6eacaf76f765ba77febee673e9e94895e46feb --- Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Data/Input/Overtopping/OvertoppingCalculationInput.cs (.../OvertoppingCalculationInput.cs) (revision fe12df1b9f055c64ed8c26123d9c45bea6490bcc) +++ Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Data/Input/Overtopping/OvertoppingCalculationInput.cs (.../OvertoppingCalculationInput.cs) (revision 5e6eacaf76f765ba77febee673e9e94895e46feb) @@ -68,7 +68,7 @@ /// The profile points to use during the calculation. /// The foreland points to use during the calculation. /// The break water to use during the calculation. - public OvertoppingCalculationInput(int hydraulicBoundaryLocationId, HydraRingSection hydraRingSection, + public OvertoppingCalculationInput(long hydraulicBoundaryLocationId, HydraRingSection hydraRingSection, double hydraRingDikeHeight, double hydraRingModelFactorCriticalOvertopping, double hydraRingFactorFbMean, double hydraRingFactorFbStandardDeviation, double hydraRingFactorFnMean, double hydraRingFactorFnStandardDeviation, Index: Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Data/Input/Structures/StructuresOvertoppingCalculationInput.cs =================================================================== diff -u -rc3e8e71b2aab5a4168295d6527c5a139cd626bab -r5e6eacaf76f765ba77febee673e9e94895e46feb --- Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Data/Input/Structures/StructuresOvertoppingCalculationInput.cs (.../StructuresOvertoppingCalculationInput.cs) (revision c3e8e71b2aab5a4168295d6527c5a139cd626bab) +++ Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Data/Input/Structures/StructuresOvertoppingCalculationInput.cs (.../StructuresOvertoppingCalculationInput.cs) (revision 5e6eacaf76f765ba77febee673e9e94895e46feb) @@ -85,7 +85,7 @@ /// The deviation of the wave direction to use during the calculation. /// The mean of the storm duration to use during the calculation. /// The variation of the storm duration to use during the calculation. - public StructuresOvertoppingCalculationInput(int hydraulicBoundaryLocationId, HydraRingSection hydraRingSection, + public StructuresOvertoppingCalculationInput(long hydraulicBoundaryLocationId, HydraRingSection hydraRingSection, double hydraRingGravitationalAcceleration, double hydraRingModelFactorOvertoppingFlowMean, double hydraRingModelFactorOvertoppingFlowStandardDeviation, double hydraRingLevelOfCrestOfStructureMean, double hydraRingLevelOfCrestOfStructureStandardDeviation, Index: Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Data/Input/TargetProbabilityCalculationInput.cs =================================================================== diff -u -rb9f6d46631bdb16c2f1e65e791dd31e9380ccd6e -r5e6eacaf76f765ba77febee673e9e94895e46feb --- Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Data/Input/TargetProbabilityCalculationInput.cs (.../TargetProbabilityCalculationInput.cs) (revision b9f6d46631bdb16c2f1e65e791dd31e9380ccd6e) +++ Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Data/Input/TargetProbabilityCalculationInput.cs (.../TargetProbabilityCalculationInput.cs) (revision 5e6eacaf76f765ba77febee673e9e94895e46feb) @@ -37,7 +37,7 @@ /// The id of the hydraulic station to use during the calculation. /// The norm to use during the calculation. /// As a part of the constructor, the is automatically converted into a reliability index. - protected TargetProbabilityCalculationInput(int hydraulicBoundaryLocationId, double norm) : base(hydraulicBoundaryLocationId) + protected TargetProbabilityCalculationInput(long hydraulicBoundaryLocationId, double norm) : base(hydraulicBoundaryLocationId) { beta = -Normal.InvCDF(0.0, 1.0, 1.0/norm); } Index: Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Activities/HydraRingActivityTest.cs =================================================================== diff -u -rb5c11c4e073b7e10365ddbe62f83418ebaba14c4 -r5e6eacaf76f765ba77febee673e9e94895e46feb --- Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Activities/HydraRingActivityTest.cs (.../HydraRingActivityTest.cs) (revision b5c11c4e073b7e10365ddbe62f83418ebaba14c4) +++ Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Activities/HydraRingActivityTest.cs (.../HydraRingActivityTest.cs) (revision 5e6eacaf76f765ba77febee673e9e94895e46feb) @@ -71,7 +71,7 @@ } [Test] - public void Run_CalculationFuncReturnsValue_PerformsValidationAndCalculationAndStateNotFailed() + public void Run_CalculationFuncReturnsValue_PerformsValidationAndCalculationAndStateNotExecuted() { // Setup TestHydraRingActivity activity = new TestHydraRingActivity(true, () => 2.0); @@ -80,7 +80,7 @@ activity.Run(); // Assert - Assert.AreNotEqual(ActivityState.Failed, activity.State); + Assert.AreEqual(ActivityState.Executed, activity.State); } [Test] @@ -89,14 +89,15 @@ // Setup var mocks = new MockRepository(); var observerMock = mocks.StrictMock(); - observerMock.Expect(o => o.UpdateObserver()); + var observableMock = mocks.StrictMock(); + observableMock.Expect(o => o.Attach(observerMock)); + observableMock.Expect(o => o.NotifyObservers()); mocks.ReplayAll(); - Observable observableObject = new TestObservable(); - observableObject.Attach(observerMock); + observableMock.Attach(observerMock); double newValue = 2.0; - TestHydraRingActivity activity = new TestHydraRingActivity(true, () => newValue, observableObject); + TestHydraRingActivity activity = new TestHydraRingActivity(true, () => newValue, observableMock); activity.Run(); @@ -114,12 +115,13 @@ // Setup var mocks = new MockRepository(); var observerMock = mocks.StrictMock(); + var observableMock = mocks.StrictMock(); + observableMock.Expect(o => o.Attach(observerMock)); mocks.ReplayAll(); - Observable observableObject = new TestObservable(); - observableObject.Attach(observerMock); + observableMock.Attach(observerMock); - TestHydraRingActivity activity = new TestHydraRingActivity(true, () => null, observableObject); + TestHydraRingActivity activity = new TestHydraRingActivity(true, () => null, observableMock); activity.Run(); @@ -135,10 +137,10 @@ { private readonly bool valid; private readonly Func calculationFunc; - private readonly Observable observableObject; + private readonly IObservable observableObject; private double value = 3.0; - public TestHydraRingActivity(bool valid, Func calculationFunc, Observable observableObject = null) + public TestHydraRingActivity(bool valid, Func calculationFunc, IObservable observableObject = null) { this.valid = valid; this.calculationFunc = calculationFunc; @@ -160,10 +162,8 @@ protected override void OnFinish() { - PerformFinish(() => value = (double)Output, observableObject); + PerformFinish(() => value = (double) Output, observableObject); } } - - private class TestObservable : Observable {} } } \ No newline at end of file Index: Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Data/Input/Hydraulics/AssessmentLevelCalculationInputTest.cs =================================================================== diff -u -rdec46d5efaad5332ffb2a96e67ec11209ddc5515 -r5e6eacaf76f765ba77febee673e9e94895e46feb --- Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Data/Input/Hydraulics/AssessmentLevelCalculationInputTest.cs (.../AssessmentLevelCalculationInputTest.cs) (revision dec46d5efaad5332ffb2a96e67ec11209ddc5515) +++ Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Data/Input/Hydraulics/AssessmentLevelCalculationInputTest.cs (.../AssessmentLevelCalculationInputTest.cs) (revision 5e6eacaf76f765ba77febee673e9e94895e46feb) @@ -36,7 +36,7 @@ // Call var norm = 10000; var expectedBeta = -Normal.InvCDF(0.0, 1.0, 1.0/norm); - var assessmentLevelCalculationInput = new AssessmentLevelCalculationInput(1, norm); + var assessmentLevelCalculationInput = new AssessmentLevelCalculationInput(1, 1, norm); // Assert Assert.AreEqual(HydraRingFailureMechanismType.AssessmentLevel, assessmentLevelCalculationInput.FailureMechanismType); @@ -70,7 +70,7 @@ public void GetSubMechanismModelId_ReturnsExpectedValues() { // Call - var assessmentLevelCalculationInput = new AssessmentLevelCalculationInput(1, 2.2); + var assessmentLevelCalculationInput = new AssessmentLevelCalculationInput(1, 1, 2.2); // Assert Assert.IsNull(assessmentLevelCalculationInput.GetSubMechanismModelId(1)); Index: Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Integration/HydraRingConfigurationServiceIntegrationTest.cs =================================================================== diff -u -rc3e8e71b2aab5a4168295d6527c5a139cd626bab -r5e6eacaf76f765ba77febee673e9e94895e46feb --- Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Integration/HydraRingConfigurationServiceIntegrationTest.cs (.../HydraRingConfigurationServiceIntegrationTest.cs) (revision c3e8e71b2aab5a4168295d6527c5a139cd626bab) +++ Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Integration/HydraRingConfigurationServiceIntegrationTest.cs (.../HydraRingConfigurationServiceIntegrationTest.cs) (revision 5e6eacaf76f765ba77febee673e9e94895e46feb) @@ -39,27 +39,27 @@ // Setup var hydraRingConfigurationService = new HydraRingConfigurationService("34-1", HydraRingTimeIntegrationSchemeType.FBC, HydraRingUncertaintiesType.All); - hydraRingConfigurationService.AddHydraRingCalculationInput(new AssessmentLevelCalculationInput(700004, 10000)); + hydraRingConfigurationService.AddHydraRingCalculationInput(new AssessmentLevelCalculationInput(1, 700004, 10000)); var expectedCreationScript = "DELETE FROM [HydraulicModels];" + Environment.NewLine + "INSERT INTO [HydraulicModels] VALUES (1, 1, 'WTI 2017');" + Environment.NewLine + Environment.NewLine + "DELETE FROM [Sections];" + Environment.NewLine + - "INSERT INTO [Sections] VALUES (700004, 1, 1, '700004', '700004', 0, 0, 0, 0, 700004, 700004, 100, 0, 0);" + Environment.NewLine + + "INSERT INTO [Sections] VALUES (1, 1, 1, '1', '1', 0, 0, 0, 0, 700004, 700004, 100, 0, 0);" + Environment.NewLine + Environment.NewLine + "DELETE FROM [DesignTables];" + Environment.NewLine + - "INSERT INTO [DesignTables] VALUES (700004, 1, 1, 1, 2, 26, 0, 0, 0, 0, 5, 15, 3.71901648545568);" + Environment.NewLine + + "INSERT INTO [DesignTables] VALUES (1, 1, 1, 1, 2, 26, 0, 0, 0, 0, 5, 15, 3.71901648545568);" + Environment.NewLine + Environment.NewLine + "DELETE FROM [Numerics];" + Environment.NewLine + - "INSERT INTO [Numerics] VALUES (700004, 1, 1, 1, 1, 1, 4, 50, 0.15, 0.01, 0.01, 0.01, 2, 1, 20000, 100000, 0.1, -6, 6, 25);" + Environment.NewLine + + "INSERT INTO [Numerics] VALUES (1, 1, 1, 1, 1, 1, 4, 50, 0.15, 0.01, 0.01, 0.01, 2, 1, 20000, 100000, 0.1, -6, 6, 25);" + Environment.NewLine + Environment.NewLine + "DELETE FROM [VariableDatas];" + Environment.NewLine + - "INSERT INTO [VariableDatas] VALUES (700004, 1, 1, 1, 26, 0, 0, 0, NULL, NULL, NULL, 1, 0, 300);" + Environment.NewLine + + "INSERT INTO [VariableDatas] VALUES (1, 1, 1, 1, 26, 0, 0, 0, NULL, NULL, NULL, 1, 0, 300);" + Environment.NewLine + Environment.NewLine + "DELETE FROM [CalculationProfiles];" + Environment.NewLine + Environment.NewLine + "DELETE FROM [SectionFaultTreeModels];" + Environment.NewLine + - "INSERT INTO [SectionFaultTreeModels] VALUES (700004, 1, 1, 1, 1);" + Environment.NewLine + + "INSERT INTO [SectionFaultTreeModels] VALUES (1, 1, 1, 1, 1);" + Environment.NewLine + Environment.NewLine + "DELETE FROM [SectionSubMechanismModels];" + Environment.NewLine + Environment.NewLine + Index: Ringtoets/Integration/src/Ringtoets.Integration.Plugin/RingtoetsGuiPlugin.cs =================================================================== diff -u -r0a51f20ac93373a43f79bb4c6327bce1d46545c6 -r5e6eacaf76f765ba77febee673e9e94895e46feb --- Ringtoets/Integration/src/Ringtoets.Integration.Plugin/RingtoetsGuiPlugin.cs (.../RingtoetsGuiPlugin.cs) (revision 0a51f20ac93373a43f79bb4c6327bce1d46545c6) +++ Ringtoets/Integration/src/Ringtoets.Integration.Plugin/RingtoetsGuiPlugin.cs (.../RingtoetsGuiPlugin.cs) (revision 5e6eacaf76f765ba77febee673e9e94895e46feb) @@ -893,7 +893,7 @@ var validationProblem = HydraulicDatabaseHelper.ValidatePathForCalculation(hrdFile); if (validationProblem == null) { - var activities = nodeData.WrappedData.HydraulicBoundaryDatabase.Locations.Select(hbl => new DesignWaterLevelCalculationActivity(nodeData.WrappedData, hbl)).ToList(); + var activities = nodeData.WrappedData.HydraulicBoundaryDatabase.Locations.Select(hbl => new DesignWaterLevelCalculationActivity(nodeData.WrappedData, hbl)).ToArray(); ActivityProgressDialogRunner.Run(Gui.MainWindow, activities); Index: Ringtoets/Integration/src/Ringtoets.Integration.Service/DesignWaterLevelCalculationService.cs =================================================================== diff -u -r49d90fb457184cd520ada77ee07774405985abd5 -r5e6eacaf76f765ba77febee673e9e94895e46feb --- Ringtoets/Integration/src/Ringtoets.Integration.Service/DesignWaterLevelCalculationService.cs (.../DesignWaterLevelCalculationService.cs) (revision 49d90fb457184cd520ada77ee07774405985abd5) +++ Ringtoets/Integration/src/Ringtoets.Integration.Service/DesignWaterLevelCalculationService.cs (.../DesignWaterLevelCalculationService.cs) (revision 5e6eacaf76f765ba77febee673e9e94895e46feb) @@ -87,7 +87,7 @@ private static AssessmentLevelCalculationInput CreateInput(IAssessmentSection assessmentSection, HydraulicBoundaryLocation hydraulicBoundaryLocation) { - return new AssessmentLevelCalculationInput((int) hydraulicBoundaryLocation.Id, assessmentSection.FailureMechanismContribution.Norm); + return new AssessmentLevelCalculationInput(1, hydraulicBoundaryLocation.Id, assessmentSection.FailureMechanismContribution.Norm); } } } \ No newline at end of file Index: Ringtoets/Integration/test/Ringtoets.Integration.Service.Test/DesignWaterLevelCalculationActivityTest.cs =================================================================== diff -u -r0a51f20ac93373a43f79bb4c6327bce1d46545c6 -r5e6eacaf76f765ba77febee673e9e94895e46feb --- Ringtoets/Integration/test/Ringtoets.Integration.Service.Test/DesignWaterLevelCalculationActivityTest.cs (.../DesignWaterLevelCalculationActivityTest.cs) (revision 0a51f20ac93373a43f79bb4c6327bce1d46545c6) +++ Ringtoets/Integration/test/Ringtoets.Integration.Service.Test/DesignWaterLevelCalculationActivityTest.cs (.../DesignWaterLevelCalculationActivityTest.cs) (revision 5e6eacaf76f765ba77febee673e9e94895e46feb) @@ -97,14 +97,8 @@ { // Setup var assessmentSection = new AssessmentSection(AssessmentSectionComposition.Dike); + ImportHydraulicBoundaryDatabase(assessmentSection); - string validFilePath = Path.Combine(testDataPath, "HRD dutch coast south.sqlite"); - - using (var importer = new HydraulicBoundaryDatabaseImporter()) - { - importer.Import(assessmentSection, validFilePath); - } - var hydraulicBoundaryLocation = assessmentSection.HydraulicBoundaryDatabase.Locations.First(loc => loc.Id == 1300001); var activity = new DesignWaterLevelCalculationActivity(assessmentSection, hydraulicBoundaryLocation); @@ -130,14 +124,8 @@ { // Setup var assessmentSection = new AssessmentSection(AssessmentSectionComposition.Dike); + ImportHydraulicBoundaryDatabase(assessmentSection); - string validFilePath = Path.Combine(testDataPath, "HRD dutch coast south.sqlite"); - - using (var importer = new HydraulicBoundaryDatabaseImporter()) - { - importer.Import(assessmentSection, validFilePath); - } - var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(1, "test", 1, 1); var activity = new DesignWaterLevelCalculationActivity(assessmentSection, hydraulicBoundaryLocation); @@ -170,14 +158,8 @@ mocks.ReplayAll(); var assessmentSection = new AssessmentSection(AssessmentSectionComposition.Dike); + ImportHydraulicBoundaryDatabase(assessmentSection); - string validFilePath = Path.Combine(testDataPath, "HRD dutch coast south.sqlite"); - - using (var importer = new HydraulicBoundaryDatabaseImporter()) - { - importer.Import(assessmentSection, validFilePath); - } - var hydraulicBoundaryLocation = assessmentSection.HydraulicBoundaryDatabase.Locations.First(loc => loc.Id == 1300001); hydraulicBoundaryLocation.Attach(observerMock); @@ -202,14 +184,8 @@ mocks.ReplayAll(); var assessmentSection = new AssessmentSection(AssessmentSectionComposition.Dike); + ImportHydraulicBoundaryDatabase(assessmentSection); - string validFilePath = Path.Combine(testDataPath, "HRD dutch coast south.sqlite"); - - using (var importer = new HydraulicBoundaryDatabaseImporter()) - { - importer.Import(assessmentSection, validFilePath); - } - var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(1, "test", 1, 1); hydraulicBoundaryLocation.Attach(observerMock); @@ -224,5 +200,15 @@ Assert.IsNaN(hydraulicBoundaryLocation.DesignWaterLevel); mocks.VerifyAll(); } + + private void ImportHydraulicBoundaryDatabase(AssessmentSection assessmentSection) + { + string validFilePath = Path.Combine(testDataPath, "HRD dutch coast south.sqlite"); + + using (var importer = new HydraulicBoundaryDatabaseImporter()) + { + importer.Import(assessmentSection, validFilePath); + } + } } } \ No newline at end of file Index: Ringtoets/Integration/test/Ringtoets.Integration.Service.Test/DesignWaterLevelCalculationServiceTest.cs =================================================================== diff -u -r0a51f20ac93373a43f79bb4c6327bce1d46545c6 -r5e6eacaf76f765ba77febee673e9e94895e46feb --- Ringtoets/Integration/test/Ringtoets.Integration.Service.Test/DesignWaterLevelCalculationServiceTest.cs (.../DesignWaterLevelCalculationServiceTest.cs) (revision 0a51f20ac93373a43f79bb4c6327bce1d46545c6) +++ Ringtoets/Integration/test/Ringtoets.Integration.Service.Test/DesignWaterLevelCalculationServiceTest.cs (.../DesignWaterLevelCalculationServiceTest.cs) (revision 5e6eacaf76f765ba77febee673e9e94895e46feb) @@ -42,14 +42,8 @@ { // Setup var assessmentSection = new AssessmentSection(AssessmentSectionComposition.Dike); + ImportHydraulicBoundaryDatabase(assessmentSection); - string validFilePath = Path.Combine(testDataPath, "HRD dutch coast south.sqlite"); - - using (var importer = new HydraulicBoundaryDatabaseImporter()) - { - importer.Import(assessmentSection, validFilePath); - } - bool valid = false; var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(1, "test", 1, 1); @@ -99,20 +93,17 @@ { // Setup var assessmentSection = new AssessmentSection(AssessmentSectionComposition.Dike); + ImportHydraulicBoundaryDatabase(assessmentSection); - string validFilePath = Path.Combine(testDataPath, "HRD dutch coast south.sqlite"); - - using (var importer = new HydraulicBoundaryDatabaseImporter()) - { - importer.Import(assessmentSection, validFilePath); - } - var hydraulicBoundaryLocation = assessmentSection.HydraulicBoundaryDatabase.Locations.First(hl => hl.Id == 1300001); TargetProbabilityCalculationOutput output = null; // Call - Action call = () => output = DesignWaterLevelCalculationService.Calculate(assessmentSection, assessmentSection.HydraulicBoundaryDatabase, hydraulicBoundaryLocation, assessmentSection.Name); + Action call = () => output = DesignWaterLevelCalculationService.Calculate(assessmentSection, + assessmentSection.HydraulicBoundaryDatabase, + hydraulicBoundaryLocation, + assessmentSection.Name); // Assert TestHelper.AssertLogMessages(call, messages => @@ -130,20 +121,17 @@ { // Setup var assessmentSection = new AssessmentSection(AssessmentSectionComposition.Dike); + ImportHydraulicBoundaryDatabase(assessmentSection); - string validFilePath = Path.Combine(testDataPath, "HRD dutch coast south.sqlite"); - - using (var importer = new HydraulicBoundaryDatabaseImporter()) - { - importer.Import(assessmentSection, validFilePath); - } - var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(1, "test", 1, 1); TargetProbabilityCalculationOutput output = null; // Call - Action call = () => output = DesignWaterLevelCalculationService.Calculate(assessmentSection, assessmentSection.HydraulicBoundaryDatabase, hydraulicBoundaryLocation, assessmentSection.Name); + Action call = () => output = DesignWaterLevelCalculationService.Calculate(assessmentSection, + assessmentSection.HydraulicBoundaryDatabase, + hydraulicBoundaryLocation, + assessmentSection.Name); // Assert TestHelper.AssertLogMessages(call, messages => @@ -156,5 +144,15 @@ }); Assert.IsNull(output); } + + private void ImportHydraulicBoundaryDatabase(AssessmentSection assessmentSection) + { + string validFilePath = Path.Combine(testDataPath, "HRD dutch coast south.sqlite"); + + using (var importer = new HydraulicBoundaryDatabaseImporter()) + { + importer.Import(assessmentSection, validFilePath); + } + } } } \ No newline at end of file Index: Ringtoets/Integration/test/Ringtoets.Integration.Service.Test/Properties/AssemblyInfo.cs =================================================================== diff -u -rd01d386b22e750008cc95bd8a35983a13cdb18b1 -r5e6eacaf76f765ba77febee673e9e94895e46feb --- Ringtoets/Integration/test/Ringtoets.Integration.Service.Test/Properties/AssemblyInfo.cs (.../AssemblyInfo.cs) (revision d01d386b22e750008cc95bd8a35983a13cdb18b1) +++ Ringtoets/Integration/test/Ringtoets.Integration.Service.Test/Properties/AssemblyInfo.cs (.../AssemblyInfo.cs) (revision 5e6eacaf76f765ba77febee673e9e94895e46feb) @@ -28,9 +28,9 @@ [assembly: AssemblyTitle("Ringtoets.Integration.Service.Test")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Microsoft")] +[assembly: AssemblyCompany("Deltares")] [assembly: AssemblyProduct("Ringtoets.Integration.Service.Test")] -[assembly: AssemblyCopyright("Copyright © Microsoft 2016")] +[assembly: AssemblyCopyright("Copyright © Deltares 2016")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] Index: Ringtoets/Piping/src/Ringtoets.Piping.Plugin/PipingGuiPlugin.cs =================================================================== diff -u -re5eb6aafecb6223ded5109bc1f76b4d3b35e21ed -r5e6eacaf76f765ba77febee673e9e94895e46feb --- Ringtoets/Piping/src/Ringtoets.Piping.Plugin/PipingGuiPlugin.cs (.../PipingGuiPlugin.cs) (revision e5eb6aafecb6223ded5109bc1f76b4d3b35e21ed) +++ Ringtoets/Piping/src/Ringtoets.Piping.Plugin/PipingGuiPlugin.cs (.../PipingGuiPlugin.cs) (revision 5e6eacaf76f765ba77febee673e9e94895e46feb) @@ -374,7 +374,7 @@ .AddToggleRelevancyOfFailureMechanismItem(pipingFailureMechanismContext, RemoveAllViewsForItem) .AddSeparator() .AddCustomItem(validateAllItem) - .AddPerformAllCalculationsInFailureMechanismItem(pipingFailureMechanismContext, CalculateAll, EnablePerformAllCalculationsInFailureMechanism) + .AddPerformAllCalculationsInFailureMechanismItem(pipingFailureMechanismContext, CalculateAll, ValidateAllDataAvailableAndGetErrorMessageForCalculationsInFailureMechanism) .AddClearAllCalculationOutputInFailureMechanismItem(pipingFailureMechanismContext.WrappedData) .AddSeparator() .AddImportItem() @@ -387,9 +387,9 @@ .Build(); } - private string EnablePerformAllCalculationsInFailureMechanism(PipingFailureMechanismContext pipingFailureMechanismContext) + private string ValidateAllDataAvailableAndGetErrorMessageForCalculationsInFailureMechanism(PipingFailureMechanismContext pipingFailureMechanismContext) { - return AllDataAvailable(pipingFailureMechanismContext.WrappedData); + return ValidateAllDataAvailableAndGetErrorMessage(pipingFailureMechanismContext.WrappedData); } private void RemoveAllViewsForItem(PipingFailureMechanismContext failureMechanismContext) @@ -504,7 +504,7 @@ (o, args) => { PipingCalculationService.Validate(calculation); }); return builder.AddCustomItem(validateItem) - .AddPerformCalculationItem(calculation, nodeData, PerformCalculation, EnablePerformCalculation) + .AddPerformCalculationItem(calculation, nodeData, PerformCalculation, ValidateAllDataAvailableAndGetErrorMessageForCalculation) .AddClearCalculationOutputItem(calculation) .AddSeparator() .AddRenameItem() @@ -520,12 +520,12 @@ .Build(); } - private string EnablePerformCalculation(PipingCalculationScenarioContext context) + private string ValidateAllDataAvailableAndGetErrorMessageForCalculation(PipingCalculationScenarioContext context) { - return AllDataAvailable(context.FailureMechanism); + return ValidateAllDataAvailableAndGetErrorMessage(context.FailureMechanism); } - private static string AllDataAvailable(PipingFailureMechanism failureMechanism) + private static string ValidateAllDataAvailableAndGetErrorMessage(PipingFailureMechanism failureMechanism) { return !failureMechanism.Sections.Any() ? RingtoetsCommonFormsResources.GuiPlugin_AllDataAvailable_No_failure_mechanism_sections_imported : null; } @@ -636,7 +636,7 @@ .AddCreateCalculationItem(nodeData, AddCalculationScenario) .AddSeparator() .AddCustomItem(validateAllItem) - .AddPerformAllCalculationsInGroupItem(group, nodeData, CalculateAll, EnablePerformAllCalculationsInGroup) + .AddPerformAllCalculationsInGroupItem(group, nodeData, CalculateAll, ValidateAllDataAvailableAndGetErrorMessageForCalculationsInGroup) .AddClearAllCalculationOutputInGroupItem(group) .AddSeparator(); @@ -657,9 +657,9 @@ .Build(); } - private string EnablePerformAllCalculationsInGroup(PipingCalculationGroupContext pipingCalculationGroupContext) + private string ValidateAllDataAvailableAndGetErrorMessageForCalculationsInGroup(PipingCalculationGroupContext pipingCalculationGroupContext) { - return AllDataAvailable(pipingCalculationGroupContext.FailureMechanism); + return ValidateAllDataAvailableAndGetErrorMessage(pipingCalculationGroupContext.FailureMechanism); } private static void AddCalculationScenario(PipingCalculationGroupContext nodeData) Index: Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/TreeNodeInfos/PipingCalculationGroupContextTreeNodeInfoTest.cs =================================================================== diff -u -r80c86231452b9beb7e8b8eba3698ceb9c0551de3 -r5e6eacaf76f765ba77febee673e9e94895e46feb --- Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/TreeNodeInfos/PipingCalculationGroupContextTreeNodeInfoTest.cs (.../PipingCalculationGroupContextTreeNodeInfoTest.cs) (revision 80c86231452b9beb7e8b8eba3698ceb9c0551de3) +++ Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/TreeNodeInfos/PipingCalculationGroupContextTreeNodeInfoTest.cs (.../PipingCalculationGroupContextTreeNodeInfoTest.cs) (revision 5e6eacaf76f765ba77febee673e9e94895e46feb) @@ -378,7 +378,7 @@ { // Setup var gui = mocks.StrictMock(); - var treeViewControl = mocks.StrictMock(); + var treeViewControl = new TreeViewControl(); var group = new CalculationGroup(); var pipingFailureMechanism = new PipingFailureMechanism(); @@ -416,7 +416,7 @@ { // Setup var gui = mocks.StrictMock(); - var treeViewControl = mocks.StrictMock(); + var treeViewControl = new TreeViewControl(); var group = new CalculationGroup(); var pipingFailureMechanism = new PipingFailureMechanism(); @@ -454,7 +454,7 @@ { // Setup var gui = mocks.StrictMock(); - var treeViewControl = mocks.StrictMock(); + var treeViewControl = new TreeViewControl(); var group = new CalculationGroup(); var pipingFailureMechanism = new PipingFailureMechanism(); @@ -494,7 +494,7 @@ { // Setup var gui = mocks.StrictMock(); - var treeViewControl = mocks.StrictMock(); + var treeViewControl = new TreeViewControl(); var menuBuilder = new CustomItemsOnlyContextMenuBuilder(); var group = new CalculationGroup(); @@ -561,7 +561,7 @@ var observer = mocks.StrictMock(); observer.Expect(o => o.UpdateObserver()); - var treeViewControl = mocks.StrictMock(); + var treeViewControl = new TreeViewControl(); gui.Expect(cmp => cmp.Get(nodeData, treeViewControl)).Return(menuBuilder); @@ -620,7 +620,7 @@ var observer = mocks.StrictMock(); observer.Expect(o => o.UpdateObserver()); - var treeViewControl = mocks.StrictMock(); + var treeViewControl = new TreeViewControl(); gui.Expect(cmp => cmp.Get(nodeData, treeViewControl)).Return(menuBuilder); @@ -655,7 +655,7 @@ { // Setup var gui = mocks.StrictMock(); - var treeViewControl = mocks.StrictMock(); + var treeViewControl = new TreeViewControl(); var menuBuilder = new CustomItemsOnlyContextMenuBuilder(); var validCalculation = PipingCalculationFactory.CreateCalculationWithValidInput(); @@ -719,7 +719,7 @@ { // Setup var gui = mocks.StrictMock(); - var treeViewControlMock = mocks.StrictMock(); + var treeViewControl = new TreeViewControl(); var menuBuilder = new CustomItemsOnlyContextMenuBuilder(); var pipingFailureMechanism = new PipingFailureMechanism(); var assessmentSectionMock = mocks.StrictMock(); @@ -743,15 +743,15 @@ Enumerable.Empty(), Enumerable.Empty(), pipingFailureMechanism, - assessmentSectionMock); + assessmentSectionMock); - gui.Expect(g => g.Get(nodeData, treeViewControlMock)).Return(menuBuilder); + gui.Expect(g => g.Get(nodeData, treeViewControl)).Return(menuBuilder); plugin.Gui = gui; mocks.ReplayAll(); // Call - ContextMenuStrip menu = info.ContextMenuStrip(nodeData, parentNodeData, treeViewControlMock); + ContextMenuStrip menu = info.ContextMenuStrip(nodeData, parentNodeData, treeViewControl); // Assert TestHelper.AssertContextMenuStripContainsItem(menu, @@ -768,7 +768,7 @@ { // Setup var gui = mocks.StrictMock(); - var treeViewControlMock = mocks.StrictMock(); + var treeViewControl = new TreeViewControl(); var menuBuilder = new CustomItemsOnlyContextMenuBuilder(); var assessmentSectionMock = mocks.StrictMock(); @@ -797,15 +797,15 @@ Enumerable.Empty(), Enumerable.Empty(), pipingFailureMechanism, - assessmentSectionMock); + assessmentSectionMock); - gui.Expect(g => g.Get(nodeData, treeViewControlMock)).Return(menuBuilder); + gui.Expect(g => g.Get(nodeData, treeViewControl)).Return(menuBuilder); plugin.Gui = gui; mocks.ReplayAll(); // Call - ContextMenuStrip menu = info.ContextMenuStrip(nodeData, parentNodeData, treeViewControlMock); + ContextMenuStrip menu = info.ContextMenuStrip(nodeData, parentNodeData, treeViewControl); // Assert TestHelper.AssertContextMenuStripContainsItem(menu, @@ -822,7 +822,7 @@ // Setup var gui = mocks.StrictMock(); var mainWindow = mocks.Stub(); - var treeViewControl = mocks.StrictMock(); + var treeViewControl = new TreeViewControl(); var menuBuilder = new CustomItemsOnlyContextMenuBuilder(); var validCalculation = PipingCalculationFactory.CreateCalculationWithValidInput(); @@ -891,7 +891,7 @@ { // Setup var gui = mocks.StrictMock(); - var treeViewControl = mocks.StrictMock(); + var treeViewControl = new TreeViewControl(); var menuBuilder = new CustomItemsOnlyContextMenuBuilder(); var calculation1Observer = mocks.StrictMock(); @@ -979,7 +979,7 @@ { // Setup var gui = mocks.StrictMock(); - var treeViewControl = mocks.StrictMock(); + var treeViewControl = new TreeViewControl(); var menuBuilder = new CustomItemsOnlyContextMenuBuilder(); var group = new CalculationGroup(); @@ -1044,7 +1044,7 @@ { // Given var gui = mocks.StrictMock(); - var treeViewControl = mocks.StrictMock(); + var treeViewControl = new TreeViewControl(); var menuBuilder = new CustomItemsOnlyContextMenuBuilder(); var pipingFailureMechanism = new PipingFailureMechanism(); @@ -1154,7 +1154,7 @@ { // Given var gui = mocks.StrictMock(); - var treeViewControl = mocks.StrictMock(); + var treeViewControl = new TreeViewControl(); var menuBuilder = new CustomItemsOnlyContextMenuBuilder(); var group = new CalculationGroup(); Index: Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/TreeNodeInfos/PipingCalculationScenarioContextTreeNodeInfoTest.cs =================================================================== diff -u -r80c86231452b9beb7e8b8eba3698ceb9c0551de3 -r5e6eacaf76f765ba77febee673e9e94895e46feb --- Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/TreeNodeInfos/PipingCalculationScenarioContextTreeNodeInfoTest.cs (.../PipingCalculationScenarioContextTreeNodeInfoTest.cs) (revision 80c86231452b9beb7e8b8eba3698ceb9c0551de3) +++ Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/TreeNodeInfos/PipingCalculationScenarioContextTreeNodeInfoTest.cs (.../PipingCalculationScenarioContextTreeNodeInfoTest.cs) (revision 5e6eacaf76f765ba77febee673e9e94895e46feb) @@ -169,7 +169,7 @@ { // Setup var gui = mocks.StrictMock(); - var treeViewControlMock = mocks.StrictMock(); + var treeViewControl = new TreeViewControl(); var calculation = new PipingCalculationScenario(new GeneralPipingInput()); var pipingFailureMechanism = new PipingFailureMechanism(); pipingFailureMechanism.AddSection(new FailureMechanismSection("A", new[] @@ -183,14 +183,14 @@ pipingFailureMechanism, assessmentSectionMock); - gui.Expect(cmp => cmp.Get(nodeData, treeViewControlMock)).Return(new CustomItemsOnlyContextMenuBuilder()); + gui.Expect(cmp => cmp.Get(nodeData, treeViewControl)).Return(new CustomItemsOnlyContextMenuBuilder()); mocks.ReplayAll(); plugin.Gui = gui; // Call - var contextMenu = info.ContextMenuStrip(nodeData, null, treeViewControlMock); + var contextMenu = info.ContextMenuStrip(nodeData, null, treeViewControl); // Assert mocks.VerifyAll(); // Expect no calls on arguments @@ -205,7 +205,7 @@ { // Setup var gui = mocks.StrictMock(); - var treeViewControlMock = mocks.StrictMock(); + var treeViewControl = new TreeViewControl(); var calculation = new PipingCalculationScenario(new GeneralPipingInput()) { Output = new TestPipingOutput() @@ -222,14 +222,14 @@ pipingFailureMechanism, assessmentSectionMock); - gui.Expect(cmp => cmp.Get(nodeData, treeViewControlMock)).Return(new CustomItemsOnlyContextMenuBuilder()); + gui.Expect(cmp => cmp.Get(nodeData, treeViewControl)).Return(new CustomItemsOnlyContextMenuBuilder()); mocks.ReplayAll(); plugin.Gui = gui; // Call - var contextMenu = info.ContextMenuStrip(nodeData, null, treeViewControlMock); + var contextMenu = info.ContextMenuStrip(nodeData, null, treeViewControl); // Assert mocks.VerifyAll(); // Expect no calls on arguments @@ -244,7 +244,7 @@ { // Setup var gui = mocks.StrictMock(); - var treeViewControlMock = mocks.StrictMock(); + var treeViewControl = new TreeViewControl(); var calculation = new PipingCalculationScenario(new GeneralPipingInput()); var failureMechanism = new PipingFailureMechanism(); @@ -255,14 +255,14 @@ failureMechanism, assessmentSectionMock); - gui.Expect(cmp => cmp.Get(nodeData, treeViewControlMock)).Return(new CustomItemsOnlyContextMenuBuilder()); + gui.Expect(cmp => cmp.Get(nodeData, treeViewControl)).Return(new CustomItemsOnlyContextMenuBuilder()); mocks.ReplayAll(); plugin.Gui = gui; // Call - var contextMenu = info.ContextMenuStrip(nodeData, null, treeViewControlMock); + var contextMenu = info.ContextMenuStrip(nodeData, null, treeViewControl); // Assert mocks.VerifyAll(); // Expect no calls on arguments @@ -280,7 +280,7 @@ { // Setup var gui = mocks.StrictMock(); - var treeViewControlMock = mocks.StrictMock(); + var treeViewControl = new TreeViewControl(); var calculation = new PipingCalculationScenario(new GeneralPipingInput()); var failureMechanism = new PipingFailureMechanism(); failureMechanism.AddSection(new FailureMechanismSection("test", new[] @@ -295,14 +295,14 @@ failureMechanism, assessmentSectionMock); - gui.Expect(cmp => cmp.Get(nodeData, treeViewControlMock)).Return(new CustomItemsOnlyContextMenuBuilder()); + gui.Expect(cmp => cmp.Get(nodeData, treeViewControl)).Return(new CustomItemsOnlyContextMenuBuilder()); mocks.ReplayAll(); plugin.Gui = gui; // Call - var contextMenu = info.ContextMenuStrip(nodeData, null, treeViewControlMock); + var contextMenu = info.ContextMenuStrip(nodeData, null, treeViewControl); // Assert mocks.VerifyAll(); // Expect no calls on arguments @@ -320,7 +320,7 @@ // Setup var gui = mocks.StrictMock(); var menuBuilderMock = mocks.Stub(); - var treeViewControlMock = mocks.StrictMock(); + var treeViewControl = new TreeViewControl(); var pipingFailureMechanism = new PipingFailureMechanism(); var assessmentSectionMock = mocks.StrictMock(); var nodeData = new PipingCalculationScenarioContext(new PipingCalculationScenario(new GeneralPipingInput()), @@ -345,14 +345,14 @@ menuBuilderMock.Expect(mb => mb.AddPropertiesItem()).Return(menuBuilderMock); menuBuilderMock.Expect(mb => mb.Build()).Return(null); - gui.Expect(cmp => cmp.Get(nodeData, treeViewControlMock)).Return(menuBuilderMock); + gui.Expect(cmp => cmp.Get(nodeData, treeViewControl)).Return(menuBuilderMock); mocks.ReplayAll(); plugin.Gui = gui; // Call - info.ContextMenuStrip(nodeData, null, treeViewControlMock); + info.ContextMenuStrip(nodeData, null, treeViewControl); // Assert mocks.VerifyAll(); // Expect no calls on arguments @@ -467,7 +467,7 @@ var gui = mocks.DynamicMock(); var mainWindow = mocks.DynamicMock(); var observer = mocks.StrictMock(); - var treeViewControlMock = mocks.StrictMock(); + var treeViewControl = new TreeViewControl(); var calculation = new PipingCalculationScenario(new GeneralPipingInput()); var pipingFailureMechanism = new PipingFailureMechanism(); pipingFailureMechanism.AddSection(new FailureMechanismSection("A", new[] @@ -484,7 +484,7 @@ observer.Expect(o => o.UpdateObserver()); assessmentSectionMock.Stub(s => s.FailureMechanismContribution).Return(new FailureMechanismContribution(Enumerable.Empty(), 30, 20000)); - gui.Expect(cmp => cmp.Get(pipingCalculationContext, treeViewControlMock)).Return(new CustomItemsOnlyContextMenuBuilder()); + gui.Expect(cmp => cmp.Get(pipingCalculationContext, treeViewControl)).Return(new CustomItemsOnlyContextMenuBuilder()); gui.Expect(g => g.MainWindow).Return(mainWindow); var expectedValidationMessageCount = 2; // No surfaceline or soil profile selected for calculation @@ -496,7 +496,7 @@ calculation.Attach(observer); - var contextMenuAdapter = info.ContextMenuStrip(pipingCalculationContext, null, treeViewControlMock); + var contextMenuAdapter = info.ContextMenuStrip(pipingCalculationContext, null, treeViewControl); DialogBoxHandler = (name, wnd) => { @@ -531,7 +531,7 @@ // Given var gui = mocks.DynamicMock(); var observer = mocks.StrictMock(); - var treeViewControlMock = mocks.StrictMock(); + var treeViewControl = new TreeViewControl(); var calculation = new PipingCalculationScenario(new GeneralPipingInput()); var pipingFailureMechanism = new PipingFailureMechanism(); var assessmentSectionMock = mocks.StrictMock(); @@ -541,7 +541,7 @@ pipingFailureMechanism, assessmentSectionMock); - gui.Expect(cmp => cmp.Get(pipingCalculationContext, treeViewControlMock)).Return(new CustomItemsOnlyContextMenuBuilder()); + gui.Expect(cmp => cmp.Get(pipingCalculationContext, treeViewControl)).Return(new CustomItemsOnlyContextMenuBuilder()); var expectedValidationMessageCount = 2; // No surfaceline or soil profile selected for calculation var expectedStatusMessageCount = 2; @@ -556,7 +556,7 @@ calculation.Attach(observer); - var contextMenuAdapter = info.ContextMenuStrip(pipingCalculationContext, null, treeViewControlMock); + var contextMenuAdapter = info.ContextMenuStrip(pipingCalculationContext, null, treeViewControl); // When Action action = () => contextMenuAdapter.Items[validateContextMenuItemIndex].PerformClick(); @@ -574,7 +574,7 @@ var gui = mocks.DynamicMock(); var mainWindow = mocks.DynamicMock(); var observer = mocks.StrictMock(); - var treeViewControlMock = mocks.StrictMock(); + var treeViewControl = new TreeViewControl(); var calculateContextMenuItemIndex = 1; var calculation = PipingCalculationFactory.CreateCalculationWithValidInput(); var pipingFailureMechanism = new PipingFailureMechanism(); @@ -590,7 +590,7 @@ assessmentSectionMock); assessmentSectionMock.Stub(s => s.FailureMechanismContribution).Return(new FailureMechanismContribution(Enumerable.Empty(), 30, 20000)); - gui.Expect(g => g.Get(pipingCalculationContext, treeViewControlMock)).Return(new CustomItemsOnlyContextMenuBuilder()); + gui.Expect(g => g.Get(pipingCalculationContext, treeViewControl)).Return(new CustomItemsOnlyContextMenuBuilder()); gui.Expect(g => g.MainWindow).Return(mainWindow); observer.Expect(o => o.UpdateObserver()); @@ -601,7 +601,7 @@ calculation.Attach(observer); - var contextMenuAdapter = info.ContextMenuStrip(pipingCalculationContext, null, treeViewControlMock); + var contextMenuAdapter = info.ContextMenuStrip(pipingCalculationContext, null, treeViewControl); DialogBoxHandler = (name, wnd) => { @@ -638,7 +638,7 @@ // Given var gui = mocks.DynamicMock(); var observer = mocks.StrictMock(); - var treeViewControlMock = mocks.StrictMock(); + var treeViewControl = new TreeViewControl(); var calculation = new PipingCalculationScenario(new GeneralPipingInput()); var pipingFailureMechanism = new PipingFailureMechanism(); var assessmentSectionMock = mocks.StrictMock(); @@ -648,7 +648,7 @@ pipingFailureMechanism, assessmentSectionMock); - gui.Expect(cmp => cmp.Get(pipingCalculationContext, treeViewControlMock)).Return(new CustomItemsOnlyContextMenuBuilder()); + gui.Expect(cmp => cmp.Get(pipingCalculationContext, treeViewControl)).Return(new CustomItemsOnlyContextMenuBuilder()); int clearOutputItemPosition = 2; if (confirm) @@ -663,7 +663,7 @@ calculation.Output = new TestPipingOutput(); calculation.Attach(observer); - var contextMenuAdapter = info.ContextMenuStrip(pipingCalculationContext, null, treeViewControlMock); + var contextMenuAdapter = info.ContextMenuStrip(pipingCalculationContext, null, treeViewControl); string messageBoxText = null, messageBoxTitle = null; DialogBoxHandler = (name, wnd) => Index: Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/TreeNodeInfos/PipingFailureMechanismContextTreeNodeInfoTest.cs =================================================================== diff -u -rf5ed0a2ad860787e42f81146b5b5d768d99adace -r5e6eacaf76f765ba77febee673e9e94895e46feb --- Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/TreeNodeInfos/PipingFailureMechanismContextTreeNodeInfoTest.cs (.../PipingFailureMechanismContextTreeNodeInfoTest.cs) (revision f5ed0a2ad860787e42f81146b5b5d768d99adace) +++ Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/TreeNodeInfos/PipingFailureMechanismContextTreeNodeInfoTest.cs (.../PipingFailureMechanismContextTreeNodeInfoTest.cs) (revision 5e6eacaf76f765ba77febee673e9e94895e46feb) @@ -206,7 +206,7 @@ { // Given var gui = mocks.StrictMock(); - var treeViewControl = mocks.StrictMock(); + var treeViewControl = new TreeViewControl(); var menuBuilder = new CustomItemsOnlyContextMenuBuilder(); var generalInputParameters = new GeneralPipingInput(); var pipingCalculation1 = new PipingCalculationScenario(generalInputParameters) @@ -348,7 +348,7 @@ public void ContextMenuStrip_PipingFailureMechanismNoOutput_ClearAllOutputDisabled() { // Setup - var treeViewControl = mocks.StrictMock(); + var treeViewControl = new TreeViewControl(); var menuBuilder = new CustomItemsOnlyContextMenuBuilder(); var dataMock = mocks.StrictMock(); @@ -379,7 +379,7 @@ public void ContextMenuStrip_PipingFailureMechanismWithOutput_ClearAllOutputEnabled() { // Setup - var treeViewControl = mocks.StrictMock(); + var treeViewControl = new TreeViewControl(); var menuBuilder = new CustomItemsOnlyContextMenuBuilder(); var pipingCalculation = new PipingCalculationScenario(new GeneralPipingInput()) { @@ -416,7 +416,7 @@ public void ContextMenuStrip_PipingFailureMechanismWithNoCalculations_ValidateAndCalculateAllDisabled() { // Setup - var treeViewControl = mocks.StrictMock(); + var treeViewControl = new TreeViewControl(); var menuBuilder = new CustomItemsOnlyContextMenuBuilder(); var dataMock = new PipingFailureMechanism(); @@ -451,7 +451,7 @@ public void ContextMenuStrip_NoFailureMechanismSections_ContextMenuItemCalculateAllDisabledAndTooltipSet() { // Setup - var treeViewControl = mocks.StrictMock(); + var treeViewControl = new TreeViewControl(); var menuBuilder = new CustomItemsOnlyContextMenuBuilder(); var pipingCalculation = new PipingCalculationScenario(new GeneralPipingInput()) { @@ -490,8 +490,8 @@ [Test] public void ContextMenuStrip_FailureMechanismSectionsSet_ContextMenuItemCalculateAllEnabled() { - // // Setup - var treeViewControl = mocks.StrictMock(); + // Setup + var treeViewControl = new TreeViewControl(); var menuBuilder = new CustomItemsOnlyContextMenuBuilder(); var pipingCalculation = new PipingCalculationScenario(new GeneralPipingInput()) { @@ -539,7 +539,7 @@ var pipingFailureMechanismContext = new PipingFailureMechanismContext(pipingFailureMechanism, assessmentSection); var gui = mocks.StrictMock(); - var treeViewControl = mocks.StrictMock(); + var treeViewControl = new TreeViewControl(); var menuBuilder = mocks.StrictMock(); menuBuilder.Expect(mb => mb.AddOpenItem()).Return(menuBuilder); @@ -584,7 +584,7 @@ var pipingFailureMechanismContext = new PipingFailureMechanismContext(pipingFailureMechanism, assessmentSection); var gui = mocks.StrictMock(); - var treeViewControl = mocks.StrictMock(); + var treeViewControl = new TreeViewControl(); var menuBuilder = mocks.StrictMock(); menuBuilder.Expect(mb => mb.AddCustomItem(null)).IgnoreArguments().Return(menuBuilder); @@ -611,7 +611,7 @@ { // Setup var gui = mocks.StrictMock(); - var treeViewControl = mocks.StrictMock(); + var treeViewControl = new TreeViewControl(); var menuBuilder = new CustomItemsOnlyContextMenuBuilder(); var failureMechanism = new PipingFailureMechanism(); @@ -660,7 +660,7 @@ // Setup var gui = mocks.StrictMock(); var mainWindow = mocks.Stub(); - var treeViewControl = mocks.StrictMock(); + var treeViewControl = new TreeViewControl(); var menuBuilder = new CustomItemsOnlyContextMenuBuilder(); var failureMechanism = new PipingFailureMechanism(); @@ -722,7 +722,7 @@ var viewCommands = mocks.StrictMock(); viewCommands.Expect(vs => vs.RemoveAllViewsForItem(failureMechanismContext)); - var treeViewControl = mocks.StrictMock(); + var treeViewControl = new TreeViewControl(); var menuBuilder = new CustomItemsOnlyContextMenuBuilder(); var gui = mocks.StrictMock(); @@ -759,7 +759,7 @@ var assessmentSection = mocks.Stub(); var failureMechanismContext = new PipingFailureMechanismContext(failureMechanism, assessmentSection); - var treeViewControl = mocks.StrictMock(); + var treeViewControl = new TreeViewControl(); var menuBuilder = new CustomItemsOnlyContextMenuBuilder(); var gui = mocks.StrictMock();