Index: Ringtoets/Piping/src/Ringtoets.Piping.Data/PipingCalculationScenario.cs =================================================================== diff -u --- Ringtoets/Piping/src/Ringtoets.Piping.Data/PipingCalculationScenario.cs (revision 0) +++ Ringtoets/Piping/src/Ringtoets.Piping.Data/PipingCalculationScenario.cs (revision b2a56be4d42df059d8aaaef53cbdce67b48fd9c3) @@ -0,0 +1,56 @@ +// 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; + +namespace Ringtoets.Piping.Data +{ + /// + /// This class holds the information for a calculation scenario. + /// + public class PipingCalculationScenario : PipingCalculation + { + /// + /// Creates a new instance of with default values set for some of the parameters. + /// + /// General piping calculation parameters that + /// are the same across all piping calculations. + /// General semi-probabilistic parameters that + /// are used in a semi-probabilistic piping assessment. + /// When or + /// is null. + public PipingCalculationScenario(GeneralPipingInput generalInputParameters, SemiProbabilisticPipingInput semiProbabilisticInputParameters) + : base(generalInputParameters, semiProbabilisticInputParameters) + { + IsRelevant = true; + } + + /// + /// Gets or sets whether this scenario is relevant or not. + /// + public bool IsRelevant { get; set; } + + /// + /// Gets the contribution of the scenario. + /// + public double Contribution { get; set; } + } +} \ No newline at end of file Index: Ringtoets/Piping/src/Ringtoets.Piping.Data/Ringtoets.Piping.Data.csproj =================================================================== diff -u -rc4d2af65ad23757fb3bd11f93458839bc1787ded -rb2a56be4d42df059d8aaaef53cbdce67b48fd9c3 --- Ringtoets/Piping/src/Ringtoets.Piping.Data/Ringtoets.Piping.Data.csproj (.../Ringtoets.Piping.Data.csproj) (revision c4d2af65ad23757fb3bd11f93458839bc1787ded) +++ Ringtoets/Piping/src/Ringtoets.Piping.Data/Ringtoets.Piping.Data.csproj (.../Ringtoets.Piping.Data.csproj) (revision b2a56be4d42df059d8aaaef53cbdce67b48fd9c3) @@ -59,6 +59,7 @@ + Index: Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/PipingCalculationScenarioTest.cs =================================================================== diff -u --- Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/PipingCalculationScenarioTest.cs (revision 0) +++ Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/PipingCalculationScenarioTest.cs (revision b2a56be4d42df059d8aaaef53cbdce67b48fd9c3) @@ -0,0 +1,82 @@ +// 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; + +namespace Ringtoets.Piping.Data.Test +{ + [TestFixture] + public class PipingCalculationScenarioTest + { + [Test] + public void Constructor_ExpectedValues() + { + // Setup + var generalInputParameters = new GeneralPipingInput(); + var semiProbabilisticInputParameters = new SemiProbabilisticPipingInput(); + + // Call + var scenario = new PipingCalculationScenario(generalInputParameters, semiProbabilisticInputParameters); + + // Assert + Assert.IsInstanceOf(scenario); + Assert.AreSame(semiProbabilisticInputParameters, scenario.SemiProbabilisticParameters); + Assert.IsTrue(scenario.IsRelevant); + Assert.AreEqual(0, scenario.Contribution); + } + + [Test] + [TestCase(true)] + [TestCase(false)] + public void IsRelevant_Always_ReturnsSetValue(bool isRelevant) + { + // Setup + var generalInputParameters = new GeneralPipingInput(); + var semiProbabilisticInputParameters = new SemiProbabilisticPipingInput(); + + var scenario = new PipingCalculationScenario(generalInputParameters, semiProbabilisticInputParameters); + + // Call + scenario.IsRelevant = isRelevant; + + // Assert + Assert.AreEqual(isRelevant, scenario.IsRelevant); + } + + [Test] + [TestCase(1)] + [TestCase(15.0)] + public void Contribution_Always_ReturnsSetValue(double newValue) + { + // Setup + var generalInputParameters = new GeneralPipingInput(); + var semiProbabilisticInputParameters = new SemiProbabilisticPipingInput(); + + var scenario = new PipingCalculationScenario(generalInputParameters, semiProbabilisticInputParameters); + + // Call + scenario.Contribution = newValue; + + // Assert + Assert.AreEqual(newValue, scenario.Contribution); + } + } +} Index: Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/Ringtoets.Piping.Data.Test.csproj =================================================================== diff -u -r756f077b356b86d6524dac7234ed6003b51a6d68 -rb2a56be4d42df059d8aaaef53cbdce67b48fd9c3 --- Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/Ringtoets.Piping.Data.Test.csproj (.../Ringtoets.Piping.Data.Test.csproj) (revision 756f077b356b86d6524dac7234ed6003b51a6d68) +++ Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/Ringtoets.Piping.Data.Test.csproj (.../Ringtoets.Piping.Data.Test.csproj) (revision b2a56be4d42df059d8aaaef53cbdce67b48fd9c3) @@ -59,6 +59,7 @@ +