Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/WtiMacroStabilityInwards/WtiMacroStabilityInwardsKernelWrapper.cs =================================================================== diff -u -r1955 -r1962 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/WtiMacroStabilityInwards/WtiMacroStabilityInwardsKernelWrapper.cs (.../WtiMacroStabilityInwardsKernelWrapper.cs) (revision 1955) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/WtiMacroStabilityInwards/WtiMacroStabilityInwardsKernelWrapper.cs (.../WtiMacroStabilityInwardsKernelWrapper.cs) (revision 1962) @@ -121,15 +121,27 @@ public int Validate(IKernelDataInput kernelDataInput, IKernelDataOutput kernelDataOutput, out List messages) { ThrowWhenWtiMacroStabilityCalculatorNull(wtiMacroStabilityCalculator); - string kernelMessage = wtiMacroStabilityCalculator.Validate(); - ParseValidationResult(kernelMessage, out messages); - WtiMacroStabilityOutput macroStabilityOutput = (WtiMacroStabilityOutput)kernelDataOutput; - var numberOfErrors = messages.Count(mt => mt.MessageType == LogMessageType.Error); - if (numberOfErrors > 0) + if (tmpPresumeInputValid) { - macroStabilityOutput.CalculationResult = CalculationResult.InvalidInputData; + messages = new List(); + return 0; } - return numberOfErrors; + else + { + messages = new List(); + messages.Add(new LogMessage(LogMessageType.Error, null, "Not implemented yet")); + // Todo MWDAM-1356 : make valid XML, only then following lines can be enabled + // string kernelMessage = wtiMacroStabilityCalculator.Validate(); + // ParseValidationResult(kernelMessage, out messages); + WtiMacroStabilityOutput macroStabilityOutput = (WtiMacroStabilityOutput)kernelDataOutput; + var numberOfErrors = messages.Count(mt => mt.MessageType == LogMessageType.Error); + if (numberOfErrors > 0) + { + macroStabilityOutput.CalculationResult = CalculationResult.InvalidInputData; + } + return numberOfErrors; + + } } internal void ParseValidationResult(string xmlValidationResult, out List messages) @@ -175,7 +187,7 @@ } - private void PerformWtiStabilityCalculation(out List messages, WtiMacroStabilityOutput macroStabilityOutput, + private void PerformWtiStabilityCalculation(out List messages, WtiMacroStabilityOutput macroStabilityOutput, WtiMacroStabilityInput macroStabilityInput) { ThrowWhenWtiMacroStabilityCalculatorNull(wtiMacroStabilityCalculator); @@ -263,7 +275,7 @@ } } - private DesignResult NewDesignResult(DamKernelInput damKernelInput, DesignScenario designScenario, + private DesignResult NewDesignResult(DamKernelInput damKernelInput, DesignScenario designScenario, WtiMacroStabilityOutputItem macroStabilityOutputItem) { string soilProfile2DName = damKernelInput.SubSoilScenario.ToString(); Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/WtiMacroStabilityInwards/WtiMacroStabilityInwardsKernelWrapperTests.cs =================================================================== diff -u -r1955 -r1962 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/WtiMacroStabilityInwards/WtiMacroStabilityInwardsKernelWrapperTests.cs (.../WtiMacroStabilityInwardsKernelWrapperTests.cs) (revision 1955) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/WtiMacroStabilityInwards/WtiMacroStabilityInwardsKernelWrapperTests.cs (.../WtiMacroStabilityInwardsKernelWrapperTests.cs) (revision 1962) @@ -188,12 +188,14 @@ IKernelDataInput kernelDataInput; IKernelDataOutput kernelDataOutput; var kernelInput = CreateDamKernelInputForTest(); - kernelWrapper.Prepare(kernelInput, 0, out kernelDataInput, out kernelDataOutput); + PrepareResult prepareResult; + prepareResult = kernelWrapper.Prepare(kernelInput, 0, out kernelDataInput, out kernelDataOutput); // ToDo MWDAM-1356: xml input not written yet. Skip for now. //Assert.AreEqual(PrepareResult.Successful, prepareResult1); // Validate the input List messages; + kernelWrapper.tmpPresumeInputValid = true; //ToDo replace by input that makes Validate succeed var errorCount = kernelWrapper.Validate(kernelDataInput, kernelDataOutput, out messages); // ToDo MWDAM-1367: Not clear yet what input must be provided to make Validate succeed. Skip for now. //Assert.IsTrue(errorCount == 0);