Index: Application/Ringtoets/src/Application.Ringtoets.Storage/Read/Piping/PipingCalculationOutputEntityReadExtensions.cs =================================================================== diff -u -r0dfaf04c32ddd8f2ccfe1e244bdc6efcbb3b6857 -r76095f14a847cd54fd958c5b326f7eb903dfd456 --- Application/Ringtoets/src/Application.Ringtoets.Storage/Read/Piping/PipingCalculationOutputEntityReadExtensions.cs (.../PipingCalculationOutputEntityReadExtensions.cs) (revision 0dfaf04c32ddd8f2ccfe1e244bdc6efcbb3b6857) +++ Application/Ringtoets/src/Application.Ringtoets.Storage/Read/Piping/PipingCalculationOutputEntityReadExtensions.cs (.../PipingCalculationOutputEntityReadExtensions.cs) (revision 76095f14a847cd54fd958c5b326f7eb903dfd456) @@ -41,7 +41,8 @@ { return new PipingOutput(entity.UpliftZValue.ToNullAsNaN(), entity.UpliftFactorOfSafety.ToNullAsNaN(), entity.HeaveZValue.ToNullAsNaN(), entity.HeaveFactorOfSafety.ToNullAsNaN(), - entity.SellmeijerZValue.ToNullAsNaN(), entity.SellmeijerFactorOfSafety.ToNullAsNaN(), double.NaN, double.NaN, double.NaN, double.NaN); + entity.SellmeijerZValue.ToNullAsNaN(), entity.SellmeijerFactorOfSafety.ToNullAsNaN(), + double.NaN, double.NaN, double.NaN, double.NaN); } } } \ No newline at end of file Index: Ringtoets/Piping/src/Ringtoets.Piping.Data/PipingOutput.cs =================================================================== diff -u -r0dfaf04c32ddd8f2ccfe1e244bdc6efcbb3b6857 -r76095f14a847cd54fd958c5b326f7eb903dfd456 --- Ringtoets/Piping/src/Ringtoets.Piping.Data/PipingOutput.cs (.../PipingOutput.cs) (revision 0dfaf04c32ddd8f2ccfe1e244bdc6efcbb3b6857) +++ Ringtoets/Piping/src/Ringtoets.Piping.Data/PipingOutput.cs (.../PipingOutput.cs) (revision 76095f14a847cd54fd958c5b326f7eb903dfd456) @@ -20,6 +20,7 @@ // All rights reserved. using Core.Common.Base; +using Core.Common.Base.Data; using Ringtoets.Common.Data.Calculation; namespace Ringtoets.Piping.Data @@ -59,10 +60,10 @@ UpliftZValue = upliftZValue; SellmeijerFactorOfSafety = sellmeijerFactorOfSafety; SellmeijerZValue = sellmeijerZValue; - HeaveGradient = heaveGradient; - SellmeijerCreepCoefficient = sellmeijerCreepCoefficient; - SellmeijerCriticalFall = sellmeijerCriticalFall; - SellmeijerReducedFall = sellmeijerReducedFall; + HeaveGradient = new RoundedDouble(2, heaveGradient); + SellmeijerCreepCoefficient = new RoundedDouble(1, sellmeijerCreepCoefficient); + SellmeijerCriticalFall = new RoundedDouble(2, sellmeijerCriticalFall); + SellmeijerReducedFall = new RoundedDouble(2, sellmeijerReducedFall); } /// @@ -98,21 +99,21 @@ /// /// The gradient that was calculated for the heave sub calculation. /// - public double HeaveGradient { get; private set; } + public RoundedDouble HeaveGradient { get; private set; } /// /// The creep coefficient that was calculated for the Sellmeijer sub calculation. /// - public double SellmeijerCreepCoefficient { get; private set; } + public RoundedDouble SellmeijerCreepCoefficient { get; private set; } /// /// The critical fall that was calculated for the Sellmeijer sub calculation. /// - public double SellmeijerCriticalFall { get; private set; } + public RoundedDouble SellmeijerCriticalFall { get; private set; } /// /// The reduced fall that was calculated for the Sellmeijer sub calculation. /// - public double SellmeijerReducedFall { get; private set; } + public RoundedDouble SellmeijerReducedFall { get; private set; } } } \ No newline at end of file Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/PresentationObjects/PipingOutputContext.cs =================================================================== diff -u --- Ringtoets/Piping/src/Ringtoets.Piping.Forms/PresentationObjects/PipingOutputContext.cs (revision 0) +++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/PresentationObjects/PipingOutputContext.cs (revision 76095f14a847cd54fd958c5b326f7eb903dfd456) @@ -0,0 +1,49 @@ +// Copyright (C) Stichting Deltares 2016. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Core.Common.Controls.PresentationObjects; +using Ringtoets.Piping.Data; + +namespace Ringtoets.Piping.Forms.PresentationObjects +{ + /// + /// A presentation layer object which wraps a and a . + /// + public class PipingOutputContext: WrappedObjectContextBase + { + /// + /// Creates a new instance of . + /// + /// + /// + public PipingOutputContext(PipingOutput wrappedData, PipingSemiProbabilisticOutput semiProbabilisticOutput) : base(wrappedData) + { + if (semiProbabilisticOutput == null) + { + throw new ArgumentNullException("semiProbabilisticOutput"); + } + SemiProbabilisticOutput = semiProbabilisticOutput; + } + + public PipingSemiProbabilisticOutput SemiProbabilisticOutput { get; private set; } + } +} \ No newline at end of file Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/Properties/Resources.Designer.cs =================================================================== diff -u -rad8a40bb3533cc041b82e9803fa1eaaf7410e5e0 -r76095f14a847cd54fd958c5b326f7eb903dfd456 --- Ringtoets/Piping/src/Ringtoets.Piping.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision ad8a40bb3533cc041b82e9803fa1eaaf7410e5e0) +++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 76095f14a847cd54fd958c5b326f7eb903dfd456) @@ -22,7 +22,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.17929 +// Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -762,312 +762,384 @@ } /// - /// Looks up a localized string similar to Kans op heave [1/jaar]. + /// Looks up a localized string similar to Piping. /// - public static string PipingScenarioView_PipingScenarioRow_FailureProbabilityHeave { + public static string PipingOutputContext_Categories_Piping { get { - return ResourceManager.GetString("PipingScenarioView_PipingScenarioRow_FailureProbabilityHeave", resourceCulture); + return ResourceManager.GetString("PipingOutputContext_Categories_Piping", resourceCulture); } } /// - /// Looks up a localized string similar to Faalkans [1/jaar]. + /// Looks up a localized string similar to Opbarsten. /// - public static string PipingScenarioView_PipingScenarioRow_FailureProbabilityPiping { + public static string PipingOutputContext_Categories_Uplift { get { - return ResourceManager.GetString("PipingScenarioView_PipingScenarioRow_FailureProbabilityPiping", resourceCulture); + return ResourceManager.GetString("PipingOutputContext_Categories_Uplift", resourceCulture); } } /// - /// Looks up a localized string similar to Kans op terugschrijdende erosie [1/jaar]. + /// Looks up a localized string similar to De veiligheidsfactor voor het submechanisme heave voor deze berekening.. /// - public static string PipingScenarioView_PipingScenarioRow_FailureProbabilitySellmeijer { + public static string PipingOutputContext_HeaveFactorOfSafety_Description { get { - return ResourceManager.GetString("PipingScenarioView_PipingScenarioRow_FailureProbabilitySellmeijer", resourceCulture); + return ResourceManager.GetString("PipingOutputContext_HeaveFactorOfSafety_Description", resourceCulture); } } /// - /// Looks up a localized string similar to Kans op opbarsten [1/jaar]. + /// Looks up a localized string similar to Veiligheidsfactor [-]. /// - public static string PipingScenarioView_PipingScenarioRow_FailureProbabilityUplift { + public static string PipingOutputContext_HeaveFactorOfSafety_DisplayName { get { - return ResourceManager.GetString("PipingScenarioView_PipingScenarioRow_FailureProbabilityUplift", resourceCulture); + return ResourceManager.GetString("PipingOutputContext_HeaveFactorOfSafety_DisplayName", resourceCulture); } } /// - /// Looks up a localized string similar to Piping. + /// Looks up a localized string similar to Het optredende verticale gradiënt in het opbarstkanaal.. /// - public static string PipingSemiProbabilisticOutput_Categories_Piping { + public static string PipingOutputContext_HeaveGradient_Description { get { - return ResourceManager.GetString("PipingSemiProbabilisticOutput_Categories_Piping", resourceCulture); + return ResourceManager.GetString("PipingOutputContext_HeaveGradient_Description", resourceCulture); } } /// - /// Looks up a localized string similar to Opbarsten. + /// Looks up a localized string similar to Heave gradiënt [-]. /// - public static string PipingSemiProbabilisticOutput_Categories_Uplift { + public static string PipingOutputContext_HeaveGradient_DisplayName { get { - return ResourceManager.GetString("PipingSemiProbabilisticOutput_Categories_Uplift", resourceCulture); + return ResourceManager.GetString("PipingOutputContext_HeaveGradient_DisplayName", resourceCulture); } } /// - /// Looks up a localized string similar to De veiligheidsfactor voor het submechanisme heave voor deze berekening.. - /// - public static string PipingSemiProbabilisticOutput_HeaveFactorOfSafety_Description { - get { - return ResourceManager.GetString("PipingSemiProbabilisticOutput_HeaveFactorOfSafety_Description", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Veiligheidsfactor [-]. - /// - public static string PipingSemiProbabilisticOutput_HeaveFactorOfSafety_DisplayName { - get { - return ResourceManager.GetString("PipingSemiProbabilisticOutput_HeaveFactorOfSafety_DisplayName", resourceCulture); - } - } - - /// /// Looks up a localized string similar to De kans dat het submechanisme heave optreedt voor deze berekening.. /// - public static string PipingSemiProbabilisticOutput_HeaveProbability_Description { + public static string PipingOutputContext_HeaveProbability_Description { get { - return ResourceManager.GetString("PipingSemiProbabilisticOutput_HeaveProbability_Description", resourceCulture); + return ResourceManager.GetString("PipingOutputContext_HeaveProbability_Description", resourceCulture); } } /// /// Looks up a localized string similar to Kans van voorkomen [1/jaar]. /// - public static string PipingSemiProbabilisticOutput_HeaveProbability_DisplayName { + public static string PipingOutputContext_HeaveProbability_DisplayName { get { - return ResourceManager.GetString("PipingSemiProbabilisticOutput_HeaveProbability_DisplayName", resourceCulture); + return ResourceManager.GetString("PipingOutputContext_HeaveProbability_DisplayName", resourceCulture); } } /// /// Looks up a localized string similar to De betrouwbaarheidsindex voor het submechanisme heave voor deze berekening.. /// - public static string PipingSemiProbabilisticOutput_HeaveReliability_Description { + public static string PipingOutputContext_HeaveReliability_Description { get { - return ResourceManager.GetString("PipingSemiProbabilisticOutput_HeaveReliability_Description", resourceCulture); + return ResourceManager.GetString("PipingOutputContext_HeaveReliability_Description", resourceCulture); } } /// /// Looks up a localized string similar to Betrouwbaarheidsindex [-]. /// - public static string PipingSemiProbabilisticOutput_HeaveReliability_DisplayName { + public static string PipingOutputContext_HeaveReliability_DisplayName { get { - return ResourceManager.GetString("PipingSemiProbabilisticOutput_HeaveReliability_DisplayName", resourceCulture); + return ResourceManager.GetString("PipingOutputContext_HeaveReliability_DisplayName", resourceCulture); } } /// /// Looks up a localized string similar to De veiligheidsfactor voor deze berekening.. /// - public static string PipingSemiProbabilisticOutput_PipingFactorOfSafety_Description { + public static string PipingOutputContext_PipingFactorOfSafety_Description { get { - return ResourceManager.GetString("PipingSemiProbabilisticOutput_PipingFactorOfSafety_Description", resourceCulture); + return ResourceManager.GetString("PipingOutputContext_PipingFactorOfSafety_Description", resourceCulture); } } /// /// Looks up a localized string similar to Veiligheidsfactor [-]. /// - public static string PipingSemiProbabilisticOutput_PipingFactorOfSafety_DisplayName { + public static string PipingOutputContext_PipingFactorOfSafety_DisplayName { get { - return ResourceManager.GetString("PipingSemiProbabilisticOutput_PipingFactorOfSafety_DisplayName", resourceCulture); + return ResourceManager.GetString("PipingOutputContext_PipingFactorOfSafety_DisplayName", resourceCulture); } } /// /// Looks up a localized string similar to De benaderde kans dat het toetsspoor piping optreedt voor deze berekening.. /// - public static string PipingSemiProbabilisticOutput_PipingProbability_Description { + public static string PipingOutputContext_PipingProbability_Description { get { - return ResourceManager.GetString("PipingSemiProbabilisticOutput_PipingProbability_Description", resourceCulture); + return ResourceManager.GetString("PipingOutputContext_PipingProbability_Description", resourceCulture); } } /// /// Looks up a localized string similar to Benaderde faalkans [1/jaar]. /// - public static string PipingSemiProbabilisticOutput_PipingProbability_DisplayName { + public static string PipingOutputContext_PipingProbability_DisplayName { get { - return ResourceManager.GetString("PipingSemiProbabilisticOutput_PipingProbability_DisplayName", resourceCulture); + return ResourceManager.GetString("PipingOutputContext_PipingProbability_DisplayName", resourceCulture); } } /// /// Looks up a localized string similar to De betrouwbaarheidsindex van de faalkans voor deze berekening.. /// - public static string PipingSemiProbabilisticOutput_PipingReliability_Description { + public static string PipingOutputContext_PipingReliability_Description { get { - return ResourceManager.GetString("PipingSemiProbabilisticOutput_PipingReliability_Description", resourceCulture); + return ResourceManager.GetString("PipingOutputContext_PipingReliability_Description", resourceCulture); } } /// /// Looks up a localized string similar to Betrouwbaarheidsindex faalkans [-]. /// - public static string PipingSemiProbabilisticOutput_PipingReliability_DisplayName { + public static string PipingOutputContext_PipingReliability_DisplayName { get { - return ResourceManager.GetString("PipingSemiProbabilisticOutput_PipingReliability_DisplayName", resourceCulture); + return ResourceManager.GetString("PipingOutputContext_PipingReliability_DisplayName", resourceCulture); } } /// /// Looks up a localized string similar to De maximaal toegestane kans dat het toetsspoor piping optreedt.. /// - public static string PipingSemiProbabilisticOutput_RequiredProbability_Description { + public static string PipingOutputContext_RequiredProbability_Description { get { - return ResourceManager.GetString("PipingSemiProbabilisticOutput_RequiredProbability_Description", resourceCulture); + return ResourceManager.GetString("PipingOutputContext_RequiredProbability_Description", resourceCulture); } } /// /// Looks up a localized string similar to Faalkanseis [1/jaar]. /// - public static string PipingSemiProbabilisticOutput_RequiredProbability_DisplayName { + public static string PipingOutputContext_RequiredProbability_DisplayName { get { - return ResourceManager.GetString("PipingSemiProbabilisticOutput_RequiredProbability_DisplayName", resourceCulture); + return ResourceManager.GetString("PipingOutputContext_RequiredProbability_DisplayName", resourceCulture); } } /// /// Looks up a localized string similar to De betrouwbaarheidsindex van de faalkanseis voor het toetsspoor piping.. /// - public static string PipingSemiProbabilisticOutput_RequiredReliability_Description { + public static string PipingOutputContext_RequiredReliability_Description { get { - return ResourceManager.GetString("PipingSemiProbabilisticOutput_RequiredReliability_Description", resourceCulture); + return ResourceManager.GetString("PipingOutputContext_RequiredReliability_Description", resourceCulture); } } /// /// Looks up a localized string similar to Betrouwbaarheidsindex faalkanseis [-]. /// - public static string PipingSemiProbabilisticOutput_RequiredReliability_DisplayName { + public static string PipingOutputContext_RequiredReliability_DisplayName { get { - return ResourceManager.GetString("PipingSemiProbabilisticOutput_RequiredReliability_DisplayName", resourceCulture); + return ResourceManager.GetString("PipingOutputContext_RequiredReliability_DisplayName", resourceCulture); } } /// + /// Looks up a localized string similar to De verhouding tussen de kwelweglengte en het berekende kritieke verval op basis van de regel van Sellmeijer (analoog aan de vuistregel van Bligh).. + /// + public static string PipingOutputContext_SellmeijerCreepCoefficient_Description { + get { + return ResourceManager.GetString("PipingOutputContext_SellmeijerCreepCoefficient_Description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Creep coëfficiënt [-]. + /// + public static string PipingOutputContext_SellmeijerCreepCoefficient_DisplayName { + get { + return ResourceManager.GetString("PipingOutputContext_SellmeijerCreepCoefficient_DisplayName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Het kritieke verval over de waterkering.. + /// + public static string PipingOutputContext_SellmeijerCriticalFall_Description { + get { + return ResourceManager.GetString("PipingOutputContext_SellmeijerCriticalFall_Description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Kritiek verval [m]. + /// + public static string PipingOutputContext_SellmeijerCriticalFall_DisplayName { + get { + return ResourceManager.GetString("PipingOutputContext_SellmeijerCriticalFall_DisplayName", resourceCulture); + } + } + + /// /// Looks up a localized string similar to De veiligheidsfactor voor het submechanisme terugschrijdende erosie (Sellmeijer) voor deze berekening.. /// - public static string PipingSemiProbabilisticOutput_SellmeijerFactorOfSafety_Description { + public static string PipingOutputContext_SellmeijerFactorOfSafety_Description { get { - return ResourceManager.GetString("PipingSemiProbabilisticOutput_SellmeijerFactorOfSafety_Description", resourceCulture); + return ResourceManager.GetString("PipingOutputContext_SellmeijerFactorOfSafety_Description", resourceCulture); } } /// /// Looks up a localized string similar to Veiligheidsfactor [-]. /// - public static string PipingSemiProbabilisticOutput_SellmeijerFactorOfSafety_DisplayName { + public static string PipingOutputContext_SellmeijerFactorOfSafety_DisplayName { get { - return ResourceManager.GetString("PipingSemiProbabilisticOutput_SellmeijerFactorOfSafety_DisplayName", resourceCulture); + return ResourceManager.GetString("PipingOutputContext_SellmeijerFactorOfSafety_DisplayName", resourceCulture); } } /// /// Looks up a localized string similar to De kans dat het submechanisme terugschrijdende erosie (Sellmeijer) optreedt voor deze berekening.. /// - public static string PipingSemiProbabilisticOutput_SellmeijerProbability_Description { + public static string PipingOutputContext_SellmeijerProbability_Description { get { - return ResourceManager.GetString("PipingSemiProbabilisticOutput_SellmeijerProbability_Description", resourceCulture); + return ResourceManager.GetString("PipingOutputContext_SellmeijerProbability_Description", resourceCulture); } } /// /// Looks up a localized string similar to Kans van voorkomen [1/jaar]. /// - public static string PipingSemiProbabilisticOutput_SellmeijerProbability_DisplayName { + public static string PipingOutputContext_SellmeijerProbability_DisplayName { get { - return ResourceManager.GetString("PipingSemiProbabilisticOutput_SellmeijerProbability_DisplayName", resourceCulture); + return ResourceManager.GetString("PipingOutputContext_SellmeijerProbability_DisplayName", resourceCulture); } } /// + /// Looks up a localized string similar to Het verschil tussen de buitenwaterstand en de binnenwaterstand, gecorrigeerd voor de drukval in het opbarstkanaal.. + /// + public static string PipingOutputContext_SellmeijerReducedFall_Description { + get { + return ResourceManager.GetString("PipingOutputContext_SellmeijerReducedFall_Description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Gereduceerd verval [m]. + /// + public static string PipingOutputContext_SellmeijerReducedFall_DisplayName { + get { + return ResourceManager.GetString("PipingOutputContext_SellmeijerReducedFall_DisplayName", resourceCulture); + } + } + + /// /// Looks up a localized string similar to De betrouwbaarheidsindex voor het submechanisme terugschrijdende erosie (Sellmeijer) voor deze berekening.. /// - public static string PipingSemiProbabilisticOutput_SellmeijerReliability_Description { + public static string PipingOutputContext_SellmeijerReliability_Description { get { - return ResourceManager.GetString("PipingSemiProbabilisticOutput_SellmeijerReliability_Description", resourceCulture); + return ResourceManager.GetString("PipingOutputContext_SellmeijerReliability_Description", resourceCulture); } } /// /// Looks up a localized string similar to Betrouwbaarheidsindex [-]. /// - public static string PipingSemiProbabilisticOutput_SellmeijerReliability_DisplayName { + public static string PipingOutputContext_SellmeijerReliability_DisplayName { get { - return ResourceManager.GetString("PipingSemiProbabilisticOutput_SellmeijerReliability_DisplayName", resourceCulture); + return ResourceManager.GetString("PipingOutputContext_SellmeijerReliability_DisplayName", resourceCulture); } } /// /// Looks up a localized string similar to De veiligheidsfactor voor het submechanisme opbarsten voor deze berekening.. /// - public static string PipingSemiProbabilisticOutput_UpliftFactorOfSafety_Description { + public static string PipingOutputContext_UpliftFactorOfSafety_Description { get { - return ResourceManager.GetString("PipingSemiProbabilisticOutput_UpliftFactorOfSafety_Description", resourceCulture); + return ResourceManager.GetString("PipingOutputContext_UpliftFactorOfSafety_Description", resourceCulture); } } /// /// Looks up a localized string similar to Veiligheidsfactor [-]. /// - public static string PipingSemiProbabilisticOutput_UpliftFactorOfSafety_DisplayName { + public static string PipingOutputContext_UpliftFactorOfSafety_DisplayName { get { - return ResourceManager.GetString("PipingSemiProbabilisticOutput_UpliftFactorOfSafety_DisplayName", resourceCulture); + return ResourceManager.GetString("PipingOutputContext_UpliftFactorOfSafety_DisplayName", resourceCulture); } } /// /// Looks up a localized string similar to De kans dat het submechanisme opbarsten optreedt voor deze berekening.. /// - public static string PipingSemiProbabilisticOutput_UpliftProbability_Description { + public static string PipingOutputContext_UpliftProbability_Description { get { - return ResourceManager.GetString("PipingSemiProbabilisticOutput_UpliftProbability_Description", resourceCulture); + return ResourceManager.GetString("PipingOutputContext_UpliftProbability_Description", resourceCulture); } } /// /// Looks up a localized string similar to Kans van voorkomen [1/jaar]. /// - public static string PipingSemiProbabilisticOutput_UpliftProbability_DisplayName { + public static string PipingOutputContext_UpliftProbability_DisplayName { get { - return ResourceManager.GetString("PipingSemiProbabilisticOutput_UpliftProbability_DisplayName", resourceCulture); + return ResourceManager.GetString("PipingOutputContext_UpliftProbability_DisplayName", resourceCulture); } } /// /// Looks up a localized string similar to De betrouwbaarheidsindex voor het submechanisme opbarsten voor deze berekening.. /// - public static string PipingSemiProbabilisticOutput_UpliftReliability_Description { + public static string PipingOutputContext_UpliftReliability_Description { get { - return ResourceManager.GetString("PipingSemiProbabilisticOutput_UpliftReliability_Description", resourceCulture); + return ResourceManager.GetString("PipingOutputContext_UpliftReliability_Description", resourceCulture); } } /// /// Looks up a localized string similar to Betrouwbaarheidsindex [-]. /// - public static string PipingSemiProbabilisticOutput_UpliftReliability_DisplayName { + public static string PipingOutputContext_UpliftReliability_DisplayName { get { - return ResourceManager.GetString("PipingSemiProbabilisticOutput_UpliftReliability_DisplayName", resourceCulture); + return ResourceManager.GetString("PipingOutputContext_UpliftReliability_DisplayName", resourceCulture); } } /// + /// Looks up a localized string similar to Kans op heave [1/jaar]. + /// + public static string PipingScenarioView_PipingScenarioRow_FailureProbabilityHeave { + get { + return ResourceManager.GetString("PipingScenarioView_PipingScenarioRow_FailureProbabilityHeave", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Faalkans [1/jaar]. + /// + public static string PipingScenarioView_PipingScenarioRow_FailureProbabilityPiping { + get { + return ResourceManager.GetString("PipingScenarioView_PipingScenarioRow_FailureProbabilityPiping", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Kans op terugschrijdende erosie [1/jaar]. + /// + public static string PipingScenarioView_PipingScenarioRow_FailureProbabilitySellmeijer { + get { + return ResourceManager.GetString("PipingScenarioView_PipingScenarioRow_FailureProbabilitySellmeijer", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Kans op opbarsten [1/jaar]. + /// + public static string PipingScenarioView_PipingScenarioRow_FailureProbabilityUplift { + get { + return ResourceManager.GetString("PipingScenarioView_PipingScenarioRow_FailureProbabilityUplift", resourceCulture); + } + } + + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// public static System.Drawing.Bitmap PipingSoilProfileIcon { Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/Properties/Resources.resx =================================================================== diff -u -rad8a40bb3533cc041b82e9803fa1eaaf7410e5e0 -r76095f14a847cd54fd958c5b326f7eb903dfd456 --- Ringtoets/Piping/src/Ringtoets.Piping.Forms/Properties/Resources.resx (.../Resources.resx) (revision ad8a40bb3533cc041b82e9803fa1eaaf7410e5e0) +++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/Properties/Resources.resx (.../Resources.resx) (revision 76095f14a847cd54fd958c5b326f7eb903dfd456) @@ -225,22 +225,22 @@ Coëfficiënt van White [-] - + De veiligheidsfactor voor het submechanisme heave voor deze berekening. - + Veiligheidsfactor [-] - + De veiligheidsfactor voor het submechanisme terugschrijdende erosie (Sellmeijer) voor deze berekening. - + Veiligheidsfactor [-] - + De veiligheidsfactor voor het submechanisme opbarsten voor deze berekening. - + Veiligheidsfactor [-] @@ -412,76 +412,76 @@ b [m] - + De veiligheidsfactor voor deze berekening. - + Veiligheidsfactor [-] - + De kans dat het submechanisme heave optreedt voor deze berekening. - + Kans van voorkomen [1/jaar] - + Piping - + Opbarsten - + De betrouwbaarheidsindex voor het submechanisme heave voor deze berekening. - + Betrouwbaarheidsindex [-] - + De benaderde kans dat het toetsspoor piping optreedt voor deze berekening. - + Benaderde faalkans [1/jaar] - + De betrouwbaarheidsindex van de faalkans voor deze berekening. - + Betrouwbaarheidsindex faalkans [-] - + De maximaal toegestane kans dat het toetsspoor piping optreedt. - + Faalkanseis [1/jaar] - + De betrouwbaarheidsindex van de faalkanseis voor het toetsspoor piping. - + Betrouwbaarheidsindex faalkanseis [-] - + De kans dat het submechanisme terugschrijdende erosie (Sellmeijer) optreedt voor deze berekening. - + Kans van voorkomen [1/jaar] - + De betrouwbaarheidsindex voor het submechanisme terugschrijdende erosie (Sellmeijer) voor deze berekening. - + Betrouwbaarheidsindex [-] - + De kans dat het submechanisme opbarsten optreedt voor deze berekening. - + Kans van voorkomen [1/jaar] - + De betrouwbaarheidsindex voor het submechanisme opbarsten voor deze berekening. - + Betrouwbaarheidsindex [-] @@ -577,4 +577,28 @@ Selecteer profielschematisaties + + Het optredende verticale gradiënt in het opbarstkanaal. + + + Heave gradiënt [-] + + + De verhouding tussen de kwelweglengte en het berekende kritieke verval op basis van de regel van Sellmeijer (analoog aan de vuistregel van Bligh). + + + Creep coëfficiënt [-] + + + Het kritieke verval over de waterkering. + + + Kritiek verval [m] + + + Het verschil tussen de buitenwaterstand en de binnenwaterstand, gecorrigeerd voor de drukval in het opbarstkanaal. + + + Gereduceerd verval [m] + \ No newline at end of file Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/PropertyClasses/PipingOutputContextProperties.cs =================================================================== diff -u --- Ringtoets/Piping/src/Ringtoets.Piping.Forms/PropertyClasses/PipingOutputContextProperties.cs (revision 0) +++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/PropertyClasses/PipingOutputContextProperties.cs (revision 76095f14a847cd54fd958c5b326f7eb903dfd456) @@ -0,0 +1,251 @@ +// Copyright (C) Stichting Deltares 2016. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using Core.Common.Base.Data; +using Core.Common.Gui.Attributes; +using Core.Common.Gui.PropertyBag; +using Core.Common.Utils.Attributes; +using Ringtoets.Common.Forms.Helpers; +using Ringtoets.Piping.Forms.PresentationObjects; +using Ringtoets.Piping.Forms.Properties; +using CoreCommonResources = Core.Common.Base.Properties.Resources; + +namespace Ringtoets.Piping.Forms.PropertyClasses +{ + public class PipingOutputContextProperties : ObjectProperties + { + [ResourcesCategory(typeof(Resources), "PipingOutputContext_Categories_Uplift", 1, 4)] + [ResourcesDisplayName(typeof(Resources), "PipingOutputContext_UpliftFactorOfSafety_DisplayName")] + [ResourcesDescription(typeof(Resources), "PipingOutputContext_UpliftFactorOfSafety_Description")] + [PropertyOrder(1)] + public RoundedDouble UpliftFactorOfSafety + { + get + { + return data.SemiProbabilisticOutput.UpliftFactorOfSafety; + } + } + + [ResourcesCategory(typeof(Resources), "PipingOutputContext_Categories_Uplift", 1, 4)] + [ResourcesDisplayName(typeof(Resources), "PipingOutputContext_UpliftReliability_DisplayName")] + [ResourcesDescription(typeof(Resources), "PipingOutputContext_UpliftReliability_Description")] + [PropertyOrder(2)] + public RoundedDouble UpliftReliability + { + get + { + return data.SemiProbabilisticOutput.UpliftReliability; + } + } + + [ResourcesCategory(typeof(Resources), "PipingOutputContext_Categories_Uplift", 1, 4)] + [ResourcesDisplayName(typeof(Resources), "PipingOutputContext_UpliftProbability_DisplayName")] + [ResourcesDescription(typeof(Resources), "PipingOutputContext_UpliftProbability_Description")] + [PropertyOrder(3)] + public string UpliftProbability + { + get + { + return ProbabilityFormattingHelper.Format(data.SemiProbabilisticOutput.UpliftProbability); + } + } + + [ResourcesCategory(typeof(Resources), "Categories_Heave", 2, 4)] + [ResourcesDisplayName(typeof(Resources), "PipingOutputContext_HeaveGradient_DisplayName")] + [ResourcesDescription(typeof(Resources), "PipingOutputContext_HeaveGradient_Description")] + [PropertyOrder(12)] + public RoundedDouble HeaveGradient + { + get + { + return data.WrappedData.HeaveGradient; + } + } + + [ResourcesCategory(typeof(Resources), "Categories_Heave", 2, 4)] + [ResourcesDisplayName(typeof(Resources), "PipingOutputContext_HeaveFactorOfSafety_DisplayName")] + [ResourcesDescription(typeof(Resources), "PipingOutputContext_HeaveFactorOfSafety_Description")] + [PropertyOrder(12)] + public RoundedDouble HeaveFactorOfSafety + { + get + { + return data.SemiProbabilisticOutput.HeaveFactorOfSafety; + } + } + + [ResourcesCategory(typeof(Resources), "Categories_Heave", 2, 4)] + [ResourcesDisplayName(typeof(Resources), "PipingOutputContext_HeaveReliability_DisplayName")] + [ResourcesDescription(typeof(Resources), "PipingOutputContext_HeaveReliability_Description")] + [PropertyOrder(13)] + public RoundedDouble HeaveReliability + { + get + { + return data.SemiProbabilisticOutput.HeaveReliability; + } + } + + [ResourcesCategory(typeof(Resources), "Categories_Heave", 2, 4)] + [ResourcesDisplayName(typeof(Resources), "PipingOutputContext_HeaveProbability_DisplayName")] + [ResourcesDescription(typeof(Resources), "PipingOutputContext_HeaveProbability_Description")] + [PropertyOrder(14)] + public string HeaveProbability + { + get + { + return ProbabilityFormattingHelper.Format(data.SemiProbabilisticOutput.HeaveProbability); + } + } + + [ResourcesCategory(typeof(Resources), "Categories_Sellmeijer", 3, 4)] + [ResourcesDisplayName(typeof(Resources), "PipingOutputContext_SellmeijerCreepCoefficient_DisplayName")] + [ResourcesDescription(typeof(Resources), "PipingOutputContext_SellmeijerCreepCoefficient_Description")] + [PropertyOrder(24)] + public RoundedDouble SellmeijerCreepCoefficient + { + get + { + return data.WrappedData.SellmeijerCreepCoefficient; + } + } + + [ResourcesCategory(typeof(Resources), "Categories_Sellmeijer", 3, 4)] + [ResourcesDisplayName(typeof(Resources), "PipingOutputContext_SellmeijerCriticalFall_DisplayName")] + [ResourcesDescription(typeof(Resources), "PipingOutputContext_SellmeijerCriticalFall_Description")] + [PropertyOrder(24)] + public RoundedDouble SellmeijerCriticalFall + { + get + { + return data.WrappedData.SellmeijerCriticalFall; + } + } + + [ResourcesCategory(typeof(Resources), "Categories_Sellmeijer", 3, 4)] + [ResourcesDisplayName(typeof(Resources), "PipingOutputContext_SellmeijerReducedFall_DisplayName")] + [ResourcesDescription(typeof(Resources), "PipingOutputContext_SellmeijerReducedFall_Description")] + [PropertyOrder(24)] + public RoundedDouble SellmeijerReducedFall + { + get + { + return data.WrappedData.SellmeijerReducedFall; + } + } + + [ResourcesCategory(typeof(Resources), "Categories_Sellmeijer", 3, 4)] + [ResourcesDisplayName(typeof(Resources), "PipingOutputContext_SellmeijerFactorOfSafety_DisplayName")] + [ResourcesDescription(typeof(Resources), "PipingOutputContext_SellmeijerFactorOfSafety_Description")] + [PropertyOrder(24)] + public RoundedDouble SellmeijerFactorOfSafety + { + get + { + return data.SemiProbabilisticOutput.SellmeijerFactorOfSafety; + } + } + + [ResourcesCategory(typeof(Resources), "Categories_Sellmeijer", 3, 4)] + [ResourcesDisplayName(typeof(Resources), "PipingOutputContext_SellmeijerReliability_DisplayName")] + [ResourcesDescription(typeof(Resources), "PipingOutputContext_SellmeijerReliability_Description")] + [PropertyOrder(25)] + public RoundedDouble SellmeijerReliability + { + get + { + return data.SemiProbabilisticOutput.SellmeijerReliability; + } + } + + [ResourcesCategory(typeof(Resources), "Categories_Sellmeijer", 3, 4)] + [ResourcesDisplayName(typeof(Resources), "PipingOutputContext_SellmeijerProbability_DisplayName")] + [ResourcesDescription(typeof(Resources), "PipingOutputContext_SellmeijerProbability_Description")] + [PropertyOrder(26)] + public string SellmeijerProbability + { + get + { + return ProbabilityFormattingHelper.Format(data.SemiProbabilisticOutput.SellmeijerProbability); + } + } + + [ResourcesCategory(typeof(Resources), "PipingOutputContext_Categories_Piping", 4, 4)] + [ResourcesDisplayName(typeof(Resources), "PipingOutputContext_RequiredProbability_DisplayName")] + [ResourcesDescription(typeof(Resources), "PipingOutputContext_RequiredProbability_Description")] + [PropertyOrder(31)] + public string RequiredProbability + { + get + { + return ProbabilityFormattingHelper.Format(data.SemiProbabilisticOutput.RequiredProbability); + } + } + + [ResourcesCategory(typeof(Resources), "PipingOutputContext_Categories_Piping", 4, 4)] + [ResourcesDisplayName(typeof(Resources), "PipingOutputContext_RequiredReliability_DisplayName")] + [ResourcesDescription(typeof(Resources), "PipingOutputContext_RequiredReliability_Description")] + [PropertyOrder(32)] + public RoundedDouble RequiredReliability + { + get + { + return data.SemiProbabilisticOutput.RequiredReliability; + } + } + + [ResourcesCategory(typeof(Resources), "PipingOutputContext_Categories_Piping", 4, 4)] + [ResourcesDisplayName(typeof(Resources), "PipingOutputContext_PipingProbability_DisplayName")] + [ResourcesDescription(typeof(Resources), "PipingOutputContext_PipingProbability_Description")] + [PropertyOrder(33)] + public string PipingProbability + { + get + { + return ProbabilityFormattingHelper.Format(data.SemiProbabilisticOutput.PipingProbability); + } + } + + [ResourcesCategory(typeof(Resources), "PipingOutputContext_Categories_Piping", 4, 4)] + [ResourcesDisplayName(typeof(Resources), "PipingOutputContext_PipingReliability_DisplayName")] + [ResourcesDescription(typeof(Resources), "PipingOutputContext_PipingReliability_Description")] + [PropertyOrder(34)] + public RoundedDouble PipingReliability + { + get + { + return data.SemiProbabilisticOutput.PipingReliability; + } + } + + [ResourcesCategory(typeof(Resources), "PipingOutputContext_Categories_Piping", 4, 4)] + [ResourcesDisplayName(typeof(Resources), "PipingOutputContext_PipingFactorOfSafety_DisplayName")] + [ResourcesDescription(typeof(Resources), "PipingOutputContext_PipingFactorOfSafety_Description")] + [PropertyOrder(35)] + public RoundedDouble PipingFactorOfSafety + { + get + { + return data.SemiProbabilisticOutput.PipingFactorOfSafety; + } + } + } +} \ No newline at end of file Fisheye: Tag 76095f14a847cd54fd958c5b326f7eb903dfd456 refers to a dead (removed) revision in file `Ringtoets/Piping/src/Ringtoets.Piping.Forms/PropertyClasses/PipingSemiProbabilisticOutputProperties.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/Ringtoets.Piping.Forms.csproj =================================================================== diff -u -rcb4c5e6cd9a0478a8afe7d653bb7467b3c1a2b4e -r76095f14a847cd54fd958c5b326f7eb903dfd456 --- Ringtoets/Piping/src/Ringtoets.Piping.Forms/Ringtoets.Piping.Forms.csproj (.../Ringtoets.Piping.Forms.csproj) (revision cb4c5e6cd9a0478a8afe7d653bb7467b3c1a2b4e) +++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/Ringtoets.Piping.Forms.csproj (.../Ringtoets.Piping.Forms.csproj) (revision 76095f14a847cd54fd958c5b326f7eb903dfd456) @@ -56,6 +56,7 @@ Form + @@ -72,7 +73,7 @@ - + Index: Ringtoets/Piping/src/Ringtoets.Piping.Plugin/PipingPlugin.cs =================================================================== diff -u -r122edb15a01ee908bf7774f862258b6606522c68 -r76095f14a847cd54fd958c5b326f7eb903dfd456 --- Ringtoets/Piping/src/Ringtoets.Piping.Plugin/PipingPlugin.cs (.../PipingPlugin.cs) (revision 122edb15a01ee908bf7774f862258b6606522c68) +++ Ringtoets/Piping/src/Ringtoets.Piping.Plugin/PipingPlugin.cs (.../PipingPlugin.cs) (revision 76095f14a847cd54fd958c5b326f7eb903dfd456) @@ -69,7 +69,7 @@ { yield return new PropertyInfo(); yield return new PropertyInfo(); - yield return new PropertyInfo(); + yield return new PropertyInfo(); yield return new PropertyInfo(); yield return new PropertyInfo(); yield return new PropertyInfo(); @@ -268,7 +268,7 @@ .Build() }; - yield return new TreeNodeInfo + yield return new TreeNodeInfo { Text = pipingOutput => RingtoetsCommonFormsResources.CalculationOutput_DisplayName, Image = pipingOutput => RingtoetsCommonFormsResources.GeneralOutputIcon, @@ -646,7 +646,9 @@ if (pipingCalculationScenarioContext.WrappedData.HasOutput) { - childNodes.Add(pipingCalculationScenarioContext.WrappedData.SemiProbabilisticOutput); + childNodes.Add(new PipingOutputContext( + pipingCalculationScenarioContext.WrappedData.Output, + pipingCalculationScenarioContext.WrappedData.SemiProbabilisticOutput)); } else { Index: Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/PipingOutputTest.cs =================================================================== diff -u -r0dfaf04c32ddd8f2ccfe1e244bdc6efcbb3b6857 -r76095f14a847cd54fd958c5b326f7eb903dfd456 --- Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/PipingOutputTest.cs (.../PipingOutputTest.cs) (revision 0dfaf04c32ddd8f2ccfe1e244bdc6efcbb3b6857) +++ Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/PipingOutputTest.cs (.../PipingOutputTest.cs) (revision 76095f14a847cd54fd958c5b326f7eb903dfd456) @@ -23,6 +23,7 @@ using Core.Common.Base; using NUnit.Framework; using Ringtoets.Common.Data.Calculation; +using Ringtoets.Common.Data.TestUtil; namespace Ringtoets.Piping.Data.Test { @@ -64,10 +65,15 @@ Assert.AreEqual(foShValue, output.HeaveFactorOfSafety); Assert.AreEqual(zsValue, output.SellmeijerZValue); Assert.AreEqual(foSsValue, output.SellmeijerFactorOfSafety); - Assert.AreEqual(heaveGradient, output.HeaveGradient); - Assert.AreEqual(sellmeijerCreepCoefficient, output.SellmeijerCreepCoefficient); - Assert.AreEqual(sellmeijerCriticalFall, output.SellmeijerCriticalFall); - Assert.AreEqual(sellmeijerReducedFall, output.SellmeijerReducedFall); + + Assert.AreEqual(2, output.HeaveGradient.NumberOfDecimalPlaces); + Assert.AreEqual(heaveGradient, output.HeaveGradient, output.HeaveGradient.GetAccuracy()); + Assert.AreEqual(1, output.SellmeijerCreepCoefficient.NumberOfDecimalPlaces); + Assert.AreEqual(sellmeijerCreepCoefficient, output.SellmeijerCreepCoefficient, output.SellmeijerCreepCoefficient.GetAccuracy()); + Assert.AreEqual(2, output.SellmeijerCriticalFall.NumberOfDecimalPlaces); + Assert.AreEqual(sellmeijerCriticalFall, output.SellmeijerCriticalFall, output.SellmeijerCriticalFall.GetAccuracy()); + Assert.AreEqual(2, output.SellmeijerReducedFall.NumberOfDecimalPlaces); + Assert.AreEqual(sellmeijerReducedFall, output.SellmeijerReducedFall, output.SellmeijerReducedFall.GetAccuracy()); } } } \ No newline at end of file Index: Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PresentationObjects/PipingOutputContextTest.cs =================================================================== diff -u --- Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PresentationObjects/PipingOutputContextTest.cs (revision 0) +++ Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PresentationObjects/PipingOutputContextTest.cs (revision 76095f14a847cd54fd958c5b326f7eb903dfd456) @@ -0,0 +1,73 @@ +// Copyright (C) Stichting Deltares 2016. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Core.Common.Controls.PresentationObjects; +using NUnit.Framework; +using Ringtoets.Piping.Data; +using Ringtoets.Piping.Data.TestUtil; +using Ringtoets.Piping.Forms.PresentationObjects; +using Ringtoets.Piping.KernelWrapper.TestUtil; + +namespace Ringtoets.Piping.Forms.Test.PresentationObjects +{ + [TestFixture] + public class PipingOutputContextTest + { + [Test] + public void Constructor_WithoutOutput_ThrowsArgumentNullException() + { + // Call + TestDelegate test = () => new PipingOutputContext(null, new TestPipingSemiProbabilisticOutput()); + + // Assert + var paramName = Assert.Throws(test).ParamName; + Assert.AreEqual("wrappedData", paramName); + } + + [Test] + public void Constructor_WithoutSemiProbabilisticOutput_ThrowsArgumentNullException() + { + // Call + TestDelegate test = () => new PipingOutputContext(new TestPipingOutput(),null); + + // Assert + var paramName = Assert.Throws(test).ParamName; + Assert.AreEqual("semiProbabilisticOutput", paramName); + } + + [Test] + public void Constructor_WithOutputParameters_PropertiesSet() + { + // Setup + var pipingOutput = new TestPipingOutput(); + var semiProbabilisticOutput = new TestPipingSemiProbabilisticOutput(); + + // Call + var context = new PipingOutputContext(pipingOutput, semiProbabilisticOutput); + + // Assert + Assert.IsInstanceOf>(context); + Assert.AreSame(pipingOutput, context.WrappedData); + Assert.AreSame(semiProbabilisticOutput, context.SemiProbabilisticOutput); + } + } +} \ No newline at end of file Index: Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PropertyClasses/PipingOutputContextPropertiesTest.cs =================================================================== diff -u --- Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PropertyClasses/PipingOutputContextPropertiesTest.cs (revision 0) +++ Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PropertyClasses/PipingOutputContextPropertiesTest.cs (revision 76095f14a847cd54fd958c5b326f7eb903dfd456) @@ -0,0 +1,355 @@ +// Copyright (C) Stichting Deltares 2016. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using System.ComponentModel; +using Core.Common.Gui.PropertyBag; +using NUnit.Framework; +using Ringtoets.Common.Data.TestUtil; +using Ringtoets.Piping.Data; +using Ringtoets.Piping.Forms.PresentationObjects; +using Ringtoets.Piping.Forms.PropertyClasses; +using Ringtoets.Piping.KernelWrapper.TestUtil; + +namespace Ringtoets.Piping.Forms.Test.PropertyClasses +{ + [TestFixture] + public class PipingOutputContextPropertiesTest + { + [Test] + public void DefaultConstructor_ExpectedValues() + { + // Call + var properties = new PipingOutputContextProperties(); + + // Assert + Assert.IsInstanceOf>(properties); + Assert.IsNull(properties.Data); + } + + [Test] + public void GetProperties_WithData_ReturnExpectedValues() + { + // Setup + var random = new Random(22); + double upliftFactorOfSafety = random.NextDouble(); + double upliftReliability = random.NextDouble(); + double upliftProbability = random.NextDouble(); + double heaveFactorOfSafety = random.NextDouble(); + double heaveReliability = random.NextDouble(); + double heaveProbability = random.NextDouble(); + double sellmeijerFactorOfSafety = random.NextDouble(); + double sellmeijerReliability = random.NextDouble(); + double sellmeijerProbability = random.NextDouble(); + double requiredProbability = random.NextDouble(); + double requiredReliability = random.NextDouble(); + double pipingProbability = random.NextDouble(); + double pipingReliability = random.NextDouble(); + double pipingFactorOfSafety = random.NextDouble(); + + double heaveGradient = random.NextDouble(); + double sellmeijerCreepCoefficient = random.NextDouble(); + double sellmeijerCriticalFall = random.NextDouble(); + double sellmeijerReducedFall = random.NextDouble(); + + var semiProbabilisticOutput = new PipingSemiProbabilisticOutput( + upliftFactorOfSafety, + upliftReliability, + upliftProbability, + heaveFactorOfSafety, + heaveReliability, + heaveProbability, + sellmeijerFactorOfSafety, + sellmeijerReliability, + sellmeijerProbability, + requiredProbability, + requiredReliability, + pipingProbability, + pipingReliability, + pipingFactorOfSafety); + + var output = new PipingOutput(0, 0, 0, 0, 0, 0, heaveGradient, sellmeijerCreepCoefficient, sellmeijerCriticalFall, sellmeijerReducedFall); + + // Call + var properties = new PipingOutputContextProperties + { + Data = new PipingOutputContext(output, semiProbabilisticOutput) + }; + + // Call & Assert + var probabilityFormat = "1/{0:n0}"; + Assert.AreEqual(upliftFactorOfSafety, properties.UpliftFactorOfSafety, properties.UpliftFactorOfSafety.GetAccuracy()); + Assert.AreEqual(upliftReliability, properties.UpliftReliability, properties.UpliftReliability.GetAccuracy()); + Assert.AreEqual(string.Format(probabilityFormat, 1.0/upliftProbability), properties.UpliftProbability); + Assert.AreEqual(heaveFactorOfSafety, properties.HeaveFactorOfSafety, properties.HeaveFactorOfSafety.GetAccuracy()); + Assert.AreEqual(heaveReliability, properties.HeaveReliability, properties.HeaveReliability.GetAccuracy()); + Assert.AreEqual(string.Format(probabilityFormat, 1.0/heaveProbability), properties.HeaveProbability); + Assert.AreEqual(sellmeijerFactorOfSafety, properties.SellmeijerFactorOfSafety, properties.SellmeijerFactorOfSafety.GetAccuracy()); + Assert.AreEqual(sellmeijerReliability, properties.SellmeijerReliability, properties.SellmeijerReliability.GetAccuracy()); + Assert.AreEqual(string.Format(probabilityFormat, 1.0/sellmeijerProbability), properties.SellmeijerProbability); + Assert.AreEqual(string.Format(probabilityFormat, 1.0/requiredProbability), properties.RequiredProbability); + Assert.AreEqual(requiredReliability, properties.RequiredReliability, properties.RequiredReliability.GetAccuracy()); + Assert.AreEqual(string.Format(probabilityFormat, 1.0/pipingProbability), properties.PipingProbability); + Assert.AreEqual(pipingReliability, properties.PipingReliability, properties.PipingReliability.GetAccuracy()); + Assert.AreEqual(pipingFactorOfSafety, properties.PipingFactorOfSafety, properties.PipingFactorOfSafety.GetAccuracy()); + + Assert.AreEqual(heaveGradient, properties.HeaveGradient, properties.HeaveGradient.GetAccuracy()); + Assert.AreEqual(sellmeijerCreepCoefficient, properties.SellmeijerCreepCoefficient, properties.SellmeijerCreepCoefficient.GetAccuracy()); + Assert.AreEqual(sellmeijerCriticalFall, properties.SellmeijerCriticalFall, properties.SellmeijerCriticalFall.GetAccuracy()); + Assert.AreEqual(sellmeijerReducedFall, properties.SellmeijerReducedFall, properties.SellmeijerReducedFall.GetAccuracy()); + } + + [Test] + public void GetProperties_WithZeroValues_ReturnTranslatedFormat() + { + // Setup + var random = new Random(22); + double upliftFactorOfSafety = random.NextDouble(); + double upliftReliability = random.NextDouble(); + double heaveFactorOfSafety = random.NextDouble(); + double heaveReliability = random.NextDouble(); + double sellmeijerFactorOfSafety = random.NextDouble(); + double sellmeijerReliability = random.NextDouble(); + double requiredReliability = random.NextDouble(); + double pipingReliability = random.NextDouble(); + double pipingFactorOfSafety = random.NextDouble(); + + double upliftProbability = 0; + double heaveProbability = 0; + double sellmeijerProbability = 0; + double requiredProbability = 0; + double pipingProbability = 0; + + // Call + var semiProbabilisticOutput = new PipingSemiProbabilisticOutput( + upliftFactorOfSafety, + upliftReliability, + upliftProbability, + heaveFactorOfSafety, + heaveReliability, + heaveProbability, + sellmeijerFactorOfSafety, + sellmeijerReliability, + sellmeijerProbability, + requiredProbability, + requiredReliability, + pipingProbability, + pipingReliability, + pipingFactorOfSafety); + + var properties = new PipingOutputContextProperties + { + Data = new PipingOutputContext(new TestPipingOutput(), semiProbabilisticOutput) + }; + + // Call & Assert + var probability = "1/Oneindig"; + Assert.AreEqual(probability, properties.UpliftProbability); + Assert.AreEqual(probability, properties.HeaveProbability); + Assert.AreEqual(probability, properties.SellmeijerProbability); + Assert.AreEqual(probability, properties.RequiredProbability); + Assert.AreEqual(probability, properties.PipingProbability); + } + + [Test] + public void Constructor_Always_PropertiesHaveExpectedAttributesValues() + { + // Setup + var random = new Random(22); + double upliftFactorOfSafety = random.NextDouble(); + double upliftReliability = random.NextDouble(); + double upliftProbability = random.NextDouble(); + double heaveFactorOfSafety = random.NextDouble(); + double heaveReliability = random.NextDouble(); + double heaveProbability = random.NextDouble(); + double sellmeijerFactorOfSafety = random.NextDouble(); + double sellmeijerReliability = random.NextDouble(); + double sellmeijerProbability = random.NextDouble(); + double requiredProbability = random.NextDouble(); + double requiredReliability = random.NextDouble(); + double pipingProbability = random.NextDouble(); + double pipingReliability = random.NextDouble(); + double pipingFactorOfSafety = random.NextDouble(); + + var semiProbabilisticOutput = new PipingSemiProbabilisticOutput( + upliftFactorOfSafety, + upliftReliability, + upliftProbability, + heaveFactorOfSafety, + heaveReliability, + heaveProbability, + sellmeijerFactorOfSafety, + sellmeijerReliability, + sellmeijerProbability, + requiredProbability, + requiredReliability, + pipingProbability, + pipingReliability, + pipingFactorOfSafety); + + // Call + var properties = new PipingOutputContextProperties + { + Data = new PipingOutputContext(new TestPipingOutput(), semiProbabilisticOutput) + }; + + // Assert + var dynamicPropertyBag = new DynamicPropertyBag(properties); + PropertyDescriptorCollection dynamicProperties = dynamicPropertyBag.GetProperties(new Attribute[] + { + BrowsableAttribute.Yes + }); + Assert.AreEqual(18, dynamicProperties.Count); + + var heaveCategory = "\t\tHeave"; + var upliftCategory = "\t\t\tOpbarsten"; + var sellmeijerCategory = "\tTerugschrijdende erosie (Sellmeijer)"; + var pipingCategory = "Piping"; + + PropertyDescriptor upliftFactorOfSafetyProperty = dynamicProperties[0]; + Assert.IsNotNull(upliftFactorOfSafetyProperty); + Assert.IsTrue(upliftFactorOfSafetyProperty.IsReadOnly); + Assert.AreEqual(upliftCategory, upliftFactorOfSafetyProperty.Category); + Assert.AreEqual("Veiligheidsfactor [-]", upliftFactorOfSafetyProperty.DisplayName); + Assert.AreEqual("De veiligheidsfactor voor het submechanisme opbarsten voor deze berekening.", upliftFactorOfSafetyProperty.Description); + + PropertyDescriptor upliftReliabilityProperty = dynamicProperties[1]; + Assert.IsNotNull(upliftReliabilityProperty); + Assert.IsTrue(upliftReliabilityProperty.IsReadOnly); + Assert.AreEqual(upliftCategory, upliftReliabilityProperty.Category); + Assert.AreEqual("Betrouwbaarheidsindex [-]", upliftReliabilityProperty.DisplayName); + Assert.AreEqual("De betrouwbaarheidsindex voor het submechanisme opbarsten voor deze berekening.", upliftReliabilityProperty.Description); + + PropertyDescriptor upliftProbabilityProperty = dynamicProperties[2]; + Assert.IsNotNull(upliftProbabilityProperty); + Assert.IsTrue(upliftProbabilityProperty.IsReadOnly); + Assert.AreEqual(upliftCategory, upliftProbabilityProperty.Category); + Assert.AreEqual("Kans van voorkomen [1/jaar]", upliftProbabilityProperty.DisplayName); + Assert.AreEqual("De kans dat het submechanisme opbarsten optreedt voor deze berekening.", upliftProbabilityProperty.Description); + + PropertyDescriptor heaveGradientProperty = dynamicProperties[3]; + Assert.IsNotNull(heaveGradientProperty); + Assert.IsTrue(heaveGradientProperty.IsReadOnly); + Assert.AreEqual(heaveCategory, heaveGradientProperty.Category); + Assert.AreEqual("Heave gradiënt [-]", heaveGradientProperty.DisplayName); + Assert.AreEqual("Het optredende verticale gradiënt in het opbarstkanaal.", heaveGradientProperty.Description); + + PropertyDescriptor heaveFactorOfSafetyProperty = dynamicProperties[4]; + Assert.IsNotNull(heaveFactorOfSafetyProperty); + Assert.IsTrue(heaveFactorOfSafetyProperty.IsReadOnly); + Assert.AreEqual(heaveCategory, heaveFactorOfSafetyProperty.Category); + Assert.AreEqual("Veiligheidsfactor [-]", heaveFactorOfSafetyProperty.DisplayName); + Assert.AreEqual("De veiligheidsfactor voor het submechanisme heave voor deze berekening.", heaveFactorOfSafetyProperty.Description); + + PropertyDescriptor heaveReliabilityProperty = dynamicProperties[5]; + Assert.IsNotNull(heaveReliabilityProperty); + Assert.IsTrue(heaveReliabilityProperty.IsReadOnly); + Assert.AreEqual(heaveCategory, heaveReliabilityProperty.Category); + Assert.AreEqual("Betrouwbaarheidsindex [-]", heaveReliabilityProperty.DisplayName); + Assert.AreEqual("De betrouwbaarheidsindex voor het submechanisme heave voor deze berekening.", heaveReliabilityProperty.Description); + + PropertyDescriptor heaveProbabilityProperty = dynamicProperties[6]; + Assert.IsNotNull(heaveProbabilityProperty); + Assert.IsTrue(heaveProbabilityProperty.IsReadOnly); + Assert.AreEqual(heaveCategory, heaveProbabilityProperty.Category); + Assert.AreEqual("Kans van voorkomen [1/jaar]", heaveProbabilityProperty.DisplayName); + Assert.AreEqual("De kans dat het submechanisme heave optreedt voor deze berekening.", heaveProbabilityProperty.Description); + + PropertyDescriptor sellmeijerCreepCoefficientProperty = dynamicProperties[7]; + Assert.IsNotNull(sellmeijerCreepCoefficientProperty); + Assert.IsTrue(sellmeijerCreepCoefficientProperty.IsReadOnly); + Assert.AreEqual(sellmeijerCategory, sellmeijerCreepCoefficientProperty.Category); + Assert.AreEqual("Creep coëfficiënt [-]", sellmeijerCreepCoefficientProperty.DisplayName); + Assert.AreEqual("De verhouding tussen de kwelweglengte en het berekende kritieke verval op basis van de regel van Sellmeijer (analoog aan de vuistregel van Bligh).", + sellmeijerCreepCoefficientProperty.Description); + + PropertyDescriptor sellmeijerCriticalFallProperty = dynamicProperties[8]; + Assert.IsNotNull(sellmeijerCriticalFallProperty); + Assert.IsTrue(sellmeijerCriticalFallProperty.IsReadOnly); + Assert.AreEqual(sellmeijerCategory, sellmeijerCriticalFallProperty.Category); + Assert.AreEqual("Kritiek verval [m]", sellmeijerCriticalFallProperty.DisplayName); + Assert.AreEqual("Het kritieke verval over de waterkering.", sellmeijerCriticalFallProperty.Description); + + PropertyDescriptor sellmeijerReducedFallProperty = dynamicProperties[9]; + Assert.IsNotNull(sellmeijerReducedFallProperty); + Assert.IsTrue(sellmeijerReducedFallProperty.IsReadOnly); + Assert.AreEqual(sellmeijerCategory, sellmeijerReducedFallProperty.Category); + Assert.AreEqual("Gereduceerd verval [m]", sellmeijerReducedFallProperty.DisplayName); + Assert.AreEqual("Het verschil tussen de buitenwaterstand en de binnenwaterstand, gecorrigeerd voor de drukval in het opbarstkanaal.", sellmeijerReducedFallProperty.Description); + + PropertyDescriptor sellmeijerFactorOfSafetyProperty = dynamicProperties[10]; + Assert.IsNotNull(sellmeijerFactorOfSafetyProperty); + Assert.IsTrue(sellmeijerFactorOfSafetyProperty.IsReadOnly); + Assert.AreEqual(sellmeijerCategory, sellmeijerFactorOfSafetyProperty.Category); + Assert.AreEqual("Veiligheidsfactor [-]", sellmeijerFactorOfSafetyProperty.DisplayName); + Assert.AreEqual("De veiligheidsfactor voor het submechanisme terugschrijdende erosie (Sellmeijer) voor deze berekening.", sellmeijerFactorOfSafetyProperty.Description); + + PropertyDescriptor sellmeijerReliabilityProperty = dynamicProperties[11]; + Assert.IsNotNull(sellmeijerReliabilityProperty); + Assert.IsTrue(sellmeijerReliabilityProperty.IsReadOnly); + Assert.AreEqual(sellmeijerCategory, sellmeijerReliabilityProperty.Category); + Assert.AreEqual("Betrouwbaarheidsindex [-]", sellmeijerReliabilityProperty.DisplayName); + Assert.AreEqual("De betrouwbaarheidsindex voor het submechanisme terugschrijdende erosie (Sellmeijer) voor deze berekening.", sellmeijerReliabilityProperty.Description); + + PropertyDescriptor sellmeijerProbabilityProperty = dynamicProperties[12]; + Assert.IsNotNull(sellmeijerProbabilityProperty); + Assert.IsTrue(sellmeijerProbabilityProperty.IsReadOnly); + Assert.AreEqual(sellmeijerCategory, sellmeijerProbabilityProperty.Category); + Assert.AreEqual("Kans van voorkomen [1/jaar]", sellmeijerProbabilityProperty.DisplayName); + Assert.AreEqual("De kans dat het submechanisme terugschrijdende erosie (Sellmeijer) optreedt voor deze berekening.", sellmeijerProbabilityProperty.Description); + + PropertyDescriptor requiredProbabilityProperty = dynamicProperties[13]; + Assert.IsNotNull(requiredProbabilityProperty); + Assert.IsTrue(requiredProbabilityProperty.IsReadOnly); + Assert.AreEqual(pipingCategory, requiredProbabilityProperty.Category); + Assert.AreEqual("Faalkanseis [1/jaar]", requiredProbabilityProperty.DisplayName); + Assert.AreEqual("De maximaal toegestane kans dat het toetsspoor piping optreedt.", requiredProbabilityProperty.Description); + + PropertyDescriptor requiredReliabilityProperty = dynamicProperties[14]; + Assert.IsNotNull(requiredReliabilityProperty); + Assert.IsTrue(requiredReliabilityProperty.IsReadOnly); + Assert.AreEqual(pipingCategory, requiredReliabilityProperty.Category); + Assert.AreEqual("Betrouwbaarheidsindex faalkanseis [-]", requiredReliabilityProperty.DisplayName); + Assert.AreEqual("De betrouwbaarheidsindex van de faalkanseis voor het toetsspoor piping.", requiredReliabilityProperty.Description); + + PropertyDescriptor pipingProbabilityProperty = dynamicProperties[15]; + Assert.IsNotNull(pipingProbabilityProperty); + Assert.IsTrue(pipingProbabilityProperty.IsReadOnly); + Assert.AreEqual(pipingCategory, pipingProbabilityProperty.Category); + Assert.AreEqual("Benaderde faalkans [1/jaar]", pipingProbabilityProperty.DisplayName); + Assert.AreEqual("De benaderde kans dat het toetsspoor piping optreedt voor deze berekening.", pipingProbabilityProperty.Description); + + PropertyDescriptor pipingReliabilityProperty = dynamicProperties[16]; + Assert.IsNotNull(pipingReliabilityProperty); + Assert.IsTrue(pipingReliabilityProperty.IsReadOnly); + Assert.AreEqual(pipingCategory, pipingReliabilityProperty.Category); + Assert.AreEqual("Betrouwbaarheidsindex faalkans [-]", pipingReliabilityProperty.DisplayName); + Assert.AreEqual("De betrouwbaarheidsindex van de faalkans voor deze berekening.", pipingReliabilityProperty.Description); + + PropertyDescriptor pipingFactorOfSafetyProperty = dynamicProperties[17]; + Assert.IsNotNull(pipingFactorOfSafetyProperty); + Assert.IsTrue(pipingFactorOfSafetyProperty.IsReadOnly); + Assert.AreEqual(pipingCategory, pipingFactorOfSafetyProperty.Category); + Assert.AreEqual("Veiligheidsfactor [-]", pipingFactorOfSafetyProperty.DisplayName); + Assert.AreEqual("De veiligheidsfactor voor deze berekening.", pipingFactorOfSafetyProperty.Description); + } + } +} \ No newline at end of file Fisheye: Tag 76095f14a847cd54fd958c5b326f7eb903dfd456 refers to a dead (removed) revision in file `Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PropertyClasses/PipingSemiProbabilisticOutputPropertiesTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/Ringtoets.Piping.Forms.Test.csproj =================================================================== diff -u -re866d883e0603dc8613eebc581953a9b2a8f5986 -r76095f14a847cd54fd958c5b326f7eb903dfd456 --- Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/Ringtoets.Piping.Forms.Test.csproj (.../Ringtoets.Piping.Forms.Test.csproj) (revision e866d883e0603dc8613eebc581953a9b2a8f5986) +++ Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/Ringtoets.Piping.Forms.Test.csproj (.../Ringtoets.Piping.Forms.Test.csproj) (revision 76095f14a847cd54fd958c5b326f7eb903dfd456) @@ -64,11 +64,12 @@ + - + @@ -81,7 +82,7 @@ - + Index: Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/TreeNodeInfos/PipingCalculationScenarioContextTreeNodeInfoTest.cs =================================================================== diff -u -r753480c9461b7b5bb10eb7abe78224f24160a536 -r76095f14a847cd54fd958c5b326f7eb903dfd456 --- Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/TreeNodeInfos/PipingCalculationScenarioContextTreeNodeInfoTest.cs (.../PipingCalculationScenarioContextTreeNodeInfoTest.cs) (revision 753480c9461b7b5bb10eb7abe78224f24160a536) +++ Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/TreeNodeInfos/PipingCalculationScenarioContextTreeNodeInfoTest.cs (.../PipingCalculationScenarioContextTreeNodeInfoTest.cs) (revision 76095f14a847cd54fd958c5b326f7eb903dfd456) @@ -133,7 +133,10 @@ Assert.AreSame(pipingCalculationContext.WrappedData.InputParameters, pipingInputContext.WrappedData); CollectionAssert.AreEqual(pipingCalculationContext.AvailablePipingSurfaceLines, pipingInputContext.AvailablePipingSurfaceLines); CollectionAssert.AreEqual(pipingCalculationContext.AvailableStochasticSoilModels, pipingInputContext.AvailableStochasticSoilModels); - Assert.AreSame(pipingCalculationContext.WrappedData.SemiProbabilisticOutput, children[2]); + + var pipingOutputContext = (PipingOutputContext)children[2]; + Assert.AreSame(pipingCalculationContext.WrappedData.SemiProbabilisticOutput, pipingOutputContext.SemiProbabilisticOutput); + Assert.AreSame(pipingCalculationContext.WrappedData.Output, pipingOutputContext.WrappedData); } [Test] Index: Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/TreeNodeInfos/PipingOutputContextTreeNodeInfoTest.cs =================================================================== diff -u --- Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/TreeNodeInfos/PipingOutputContextTreeNodeInfoTest.cs (revision 0) +++ Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/TreeNodeInfos/PipingOutputContextTreeNodeInfoTest.cs (revision 76095f14a847cd54fd958c5b326f7eb903dfd456) @@ -0,0 +1,125 @@ +// Copyright (C) Stichting Deltares 2016. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System.Linq; +using Core.Common.Controls.TreeView; +using Core.Common.Gui; +using Core.Common.Gui.ContextMenu; +using Core.Common.TestUtil; +using NUnit.Framework; +using Rhino.Mocks; +using Ringtoets.Piping.Data; +using Ringtoets.Piping.Forms.PresentationObjects; +using Ringtoets.Piping.Plugin; +using RingtoetsCommonFormsResources = Ringtoets.Common.Forms.Properties.Resources; + +namespace Ringtoets.Piping.Forms.Test.TreeNodeInfos +{ + [TestFixture] + public class PipingOutputContextTreeNodeInfoTest + { + private MockRepository mocks; + private PipingPlugin plugin; + private TreeNodeInfo info; + + [SetUp] + public void SetUp() + { + mocks = new MockRepository(); + plugin = new PipingPlugin(); + info = plugin.GetTreeNodeInfos().First(tni => tni.TagType == typeof(PipingOutputContext)); + } + + [TearDown] + public void TearDown() + { + plugin.Dispose(); + mocks.VerifyAll(); + } + + [Test] + public void Initialized_Always_ExpectedPropertiesSet() + { + // Setup + mocks.ReplayAll(); + + // Assert + Assert.AreEqual(typeof(PipingOutputContext), info.TagType); + Assert.IsNull(info.ForeColor); + Assert.IsNull(info.EnsureVisibleOnCreate); + Assert.IsNull(info.ChildNodeObjects); + Assert.IsNull(info.CanRename); + Assert.IsNull(info.OnNodeRenamed); + Assert.IsNull(info.CanRemove); + Assert.IsNull(info.OnNodeRemoved); + Assert.IsNull(info.CanCheck); + Assert.IsNull(info.IsChecked); + Assert.IsNull(info.OnNodeChecked); + Assert.IsNull(info.CanDrag); + Assert.IsNull(info.CanDrop); + Assert.IsNull(info.CanInsert); + Assert.IsNull(info.OnDrop); + } + + [Test] + public void Text_Always_ReturnsTextFromResource() + { + // Call + var text = info.Text(null); + + // Assert + Assert.AreEqual(RingtoetsCommonFormsResources.CalculationOutput_DisplayName, text); + } + + [Test] + public void Image_Always_ReturnsSetImage() + { + // Call + var image = info.Image(null); + + // Assert + TestHelper.AssertImagesAreEqual(RingtoetsCommonFormsResources.GeneralOutputIcon, image); + } + + [Test] + public void ContextMenuStrip_Always_CallsBuilder() + { + // Setup + var menuBuilderMock = mocks.StrictMock(); + menuBuilderMock.Expect(mb => mb.AddPropertiesItem()).Return(menuBuilderMock); + menuBuilderMock.Expect(mb => mb.Build()).Return(null); + + using (var treeViewControl = new TreeViewControl()) + { + var gui = mocks.Stub(); + gui.Stub(g => g.Get(null, treeViewControl)).Return(menuBuilderMock); + mocks.ReplayAll(); + + plugin.Gui = gui; + + // Call + info.ContextMenuStrip(null, null, treeViewControl); + } + // Assert + // Assert expectancies are called in TearDown() + } + } +} \ No newline at end of file Fisheye: Tag 76095f14a847cd54fd958c5b326f7eb903dfd456 refers to a dead (removed) revision in file `Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/TreeNodeInfos/PipingSemiProbabilisticOutputTreeNodeInfoTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/Piping/test/Ringtoets.Piping.KernelWrapper.Test/Ringtoets.Piping.KernelWrapper.Test.csproj =================================================================== diff -u -rb1b25abeb595bff11389bbf0e695851995ef5221 -r76095f14a847cd54fd958c5b326f7eb903dfd456 --- Ringtoets/Piping/test/Ringtoets.Piping.KernelWrapper.Test/Ringtoets.Piping.KernelWrapper.Test.csproj (.../Ringtoets.Piping.KernelWrapper.Test.csproj) (revision b1b25abeb595bff11389bbf0e695851995ef5221) +++ Ringtoets/Piping/test/Ringtoets.Piping.KernelWrapper.Test/Ringtoets.Piping.KernelWrapper.Test.csproj (.../Ringtoets.Piping.KernelWrapper.Test.csproj) (revision 76095f14a847cd54fd958c5b326f7eb903dfd456) @@ -62,6 +62,7 @@ + Index: Ringtoets/Piping/test/Ringtoets.Piping.KernelWrapper.Test/SubCalculator/PipingProfilePropertyCalculatorTest.cs =================================================================== diff -u --- Ringtoets/Piping/test/Ringtoets.Piping.KernelWrapper.Test/SubCalculator/PipingProfilePropertyCalculatorTest.cs (revision 0) +++ Ringtoets/Piping/test/Ringtoets.Piping.KernelWrapper.Test/SubCalculator/PipingProfilePropertyCalculatorTest.cs (revision 76095f14a847cd54fd958c5b326f7eb903dfd456) @@ -0,0 +1,41 @@ +// Copyright (C) Stichting Deltares 2016. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using NUnit.Framework; +using Ringtoets.Piping.KernelWrapper.SubCalculator; + +namespace Ringtoets.Piping.KernelWrapper.Test.SubCalculator +{ + [TestFixture] + public class PipingProfilePropertyCalculatorTest + { + [Test] + public void Constructor_DefaultValues() + { + // Call + var calculator = new PipingProfilePropertyCalculator(); + + // Assert + Assert.IsInstanceOf(calculator); + Assert.IsNaN(calculator.BottomAquitardLayerAboveExitPointZ); + } + } +} \ No newline at end of file Index: Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/PipingPluginTest.cs =================================================================== diff -u -rca77db5948e6c622ea1fb3092917341ba1234711 -r76095f14a847cd54fd958c5b326f7eb903dfd456 --- Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/PipingPluginTest.cs (.../PipingPluginTest.cs) (revision ca77db5948e6c622ea1fb3092917341ba1234711) +++ Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/PipingPluginTest.cs (.../PipingPluginTest.cs) (revision 76095f14a847cd54fd958c5b326f7eb903dfd456) @@ -88,8 +88,8 @@ PropertyInfo pipingOutputProperties = PluginTestHelper.AssertPropertyInfoDefined( propertyInfos, - typeof(PipingSemiProbabilisticOutput), - typeof(PipingSemiProbabilisticOutputProperties)); + typeof(PipingOutputContext), + typeof(PipingOutputContextProperties)); Assert.IsNull(pipingOutputProperties.AdditionalDataCheck); Assert.IsNull(pipingOutputProperties.GetObjectPropertiesData); Assert.IsNull(pipingOutputProperties.AfterCreate); @@ -151,7 +151,7 @@ Assert.IsTrue(treeNodeInfos.Any(tni => tni.TagType == typeof(PipingInputContext))); Assert.IsTrue(treeNodeInfos.Any(tni => tni.TagType == typeof(PipingFailureMechanismContext))); Assert.IsTrue(treeNodeInfos.Any(tni => tni.TagType == typeof(FailureMechanismSectionResultContext))); - Assert.IsTrue(treeNodeInfos.Any(tni => tni.TagType == typeof(PipingSemiProbabilisticOutput))); + Assert.IsTrue(treeNodeInfos.Any(tni => tni.TagType == typeof(PipingOutputContext))); Assert.IsTrue(treeNodeInfos.Any(tni => tni.TagType == typeof(PipingScenariosContext))); Assert.IsTrue(treeNodeInfos.Any(tni => tni.TagType == typeof(EmptyPipingOutput))); }