Index: Core/Common/test/Core.Common.TestUtil.Test/FileDisposeHelperTest.cs
===================================================================
diff -u -rc2694ebe86aef7b8ed7c9dd05a55eec101958a96 -r0467e8cd28578cf205b473d3830dbd02adb29feb
--- Core/Common/test/Core.Common.TestUtil.Test/FileDisposeHelperTest.cs (.../FileDisposeHelperTest.cs) (revision c2694ebe86aef7b8ed7c9dd05a55eec101958a96)
+++ Core/Common/test/Core.Common.TestUtil.Test/FileDisposeHelperTest.cs (.../FileDisposeHelperTest.cs) (revision 0467e8cd28578cf205b473d3830dbd02adb29feb)
@@ -12,44 +12,43 @@
{
// Setup
string filePath = "doesNotExist.tmp";
- Assert.IsFalse(File.Exists(filePath));
+ Assert.IsFalse(File.Exists(filePath), String.Format("Precondition failed: File '{0}' should not exist", filePath));
+ FileDisposeHelper disposeHelper = null;
- try
- {
- // Call
- TestDelegate test = () => new FileDisposeHelper(filePath);
+ // Call
+ TestDelegate test = () => disposeHelper = new FileDisposeHelper(filePath);
- // Assert
- Assert.DoesNotThrow(test);
- Assert.IsFalse(File.Exists(filePath));
- }
- finally
- {
- File.Delete(filePath);
- }
+ // Assert
+ Assert.DoesNotThrow(test);
+ disposeHelper.Dispose();
+ Assert.IsFalse(File.Exists(filePath));
}
[Test]
public void Constructor_ExistingFile_DoesNotThrowException()
{
// Setup
string filePath = "doesNotExist.tmp";
+ FileDisposeHelper disposeHelper = null;
try
{
using (File.Create(filePath)) {}
- Assert.IsTrue(File.Exists(filePath));
+ Assert.IsTrue(File.Exists(filePath), String.Format("Precondition failed: File '{0}' should exist", filePath));
// Call
- TestDelegate test = () => new FileDisposeHelper(filePath);
+ TestDelegate test = () => disposeHelper = new FileDisposeHelper(filePath);
// Assert
Assert.DoesNotThrow(test);
+ disposeHelper.Dispose();
}
- finally
+ catch (Exception exception)
{
File.Delete(filePath);
+ Assert.Fail(exception.Message);
}
+ Assert.IsFalse(File.Exists(filePath));
}
[Test]
@@ -61,19 +60,21 @@
try
{
Assert.IsFalse(File.Exists(filePath));
-
using (var fileDisposeHelper = new FileDisposeHelper(filePath))
{
// Call
fileDisposeHelper.Create();
+
// Assert
- Assert.IsTrue(File.Exists(filePath));
+ Assert.IsTrue(File.Exists(filePath));
}
}
- finally
+ catch (Exception exception)
{
File.Delete(filePath);
+ Assert.Fail(exception.Message);
}
+ Assert.IsFalse(File.Exists(filePath));
}
[Test]
@@ -102,14 +103,15 @@
// Call
using (new FileDisposeHelper(filePath)) {}
-
- // Assert
- Assert.IsFalse(File.Exists(filePath));
}
- finally
+ catch (Exception exception)
{
File.Delete(filePath);
+ Assert.Fail(exception.Message);
}
+
+ // Assert
+ Assert.IsFalse(File.Exists(filePath));
}
[Test]
@@ -126,27 +128,27 @@
{
foreach (var filePath in filePaths)
{
- using (File.Create(filePath)) { }
+ using (File.Create(filePath)) {}
Assert.IsTrue(File.Exists(filePath));
}
-
- // Call
- using (new FileDisposeHelper(filePaths)) { }
- // Assert
- foreach (var filePath in filePaths)
- {
- Assert.IsFalse(File.Exists(filePath));
- }
+ // Call
+ using (new FileDisposeHelper(filePaths)) {}
}
- finally
+ catch (Exception exception)
{
foreach (var filePath in filePaths)
{
File.Delete(filePath);
}
-
+ Assert.Fail(exception.Message);
}
+
+ // Assert
+ foreach (var filePath in filePaths)
+ {
+ Assert.IsFalse(File.Exists(filePath));
+ }
}
}
}
\ No newline at end of file
Index: Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Data/Output/ExceedanceProbabilityCalculationAlphaOutput.cs
===================================================================
diff -u -r9d378b8fa49ea011d8f4d229b5970f11c76f8305 -r0467e8cd28578cf205b473d3830dbd02adb29feb
--- Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Data/Output/ExceedanceProbabilityCalculationAlphaOutput.cs (.../ExceedanceProbabilityCalculationAlphaOutput.cs) (revision 9d378b8fa49ea011d8f4d229b5970f11c76f8305)
+++ Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Data/Output/ExceedanceProbabilityCalculationAlphaOutput.cs (.../ExceedanceProbabilityCalculationAlphaOutput.cs) (revision 0467e8cd28578cf205b473d3830dbd02adb29feb)
@@ -25,7 +25,7 @@
/// Container of all relevant output generated by a type I calculation via Hydra-Ring:
/// Given a set of random variables, compute the probability of failure.
///
- public class ExceedanceProbabilityCalculationAlphaOutput
+ public class ExceedanceProbabilityCalculationAlphaOutput : ExceedanceProbabilityCalculationOutputBase
{
///
/// Creates a new instance of .
@@ -38,65 +38,32 @@
/// The section id used.
/// The layer id used.
/// The alternative id used.
+ /// The variable id used.
+ /// The load variable id used.
/// The alpha value.
public ExceedanceProbabilityCalculationAlphaOutput(int ringCombinMethod, int presentationSectionId,
int mainMechanismId, int mainMechanismCombinMethod, int mechanismId,
- int sectionId, int layerId, int alternativeId, double alpha)
+ int sectionId, int layerId, int alternativeId, int variableId, int loadVariableId, double alpha)
+ : base(ringCombinMethod, presentationSectionId, mainMechanismId, mainMechanismCombinMethod, mechanismId, sectionId, layerId, alternativeId)
{
- RingCombinMethod = ringCombinMethod;
- PresentationSectionId = presentationSectionId;
- MainMechanismId = mainMechanismId;
- MainMechanismCombinMethod = mainMechanismCombinMethod;
- MechanismId = mechanismId;
- SectionId = sectionId;
- LayerId = layerId;
- AlternativeId = alternativeId;
+ VariableId = variableId;
+ LoadVariableId = loadVariableId;
Alpha = alpha;
}
///
- /// Gets the Ring Combine Method.
+ /// Gets the variable id.
///
- public int RingCombinMethod { get; private set; }
+ public int VariableId { get; private set; }
///
- /// Gets the Presentation Section Id.
+ /// Gets the load variable id.
///
- public int PresentationSectionId { get; private set; }
+ public int LoadVariableId { get; private set; }
///
- /// Gets the Main Mechanism Id.
+ /// Gets the alpha result.
///
- public int MainMechanismId { get; private set; }
-
- ///
- /// Gets the Main Mechanism Combine Method.
- ///
- public int MainMechanismCombinMethod { get; private set; }
-
- ///
- /// Gets the Mechanism Id.
- ///
- public int MechanismId { get; private set; }
-
- ///
- /// Gets the Section Id.
- ///
- public int SectionId { get; private set; }
-
- ///
- /// Gets the Layer Id.
- ///
- public int LayerId { get; private set; }
-
- ///
- /// Gets the Alternative Id.
- ///
- public int AlternativeId { get; private set; }
-
- ///
- /// Gets the Alpha result.
- ///
public double Alpha { get; private set; }
}
}
\ No newline at end of file
Index: Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Data/Output/ExceedanceProbabilityCalculationOutput.cs
===================================================================
diff -u -r9d378b8fa49ea011d8f4d229b5970f11c76f8305 -r0467e8cd28578cf205b473d3830dbd02adb29feb
--- Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Data/Output/ExceedanceProbabilityCalculationOutput.cs (.../ExceedanceProbabilityCalculationOutput.cs) (revision 9d378b8fa49ea011d8f4d229b5970f11c76f8305)
+++ Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Data/Output/ExceedanceProbabilityCalculationOutput.cs (.../ExceedanceProbabilityCalculationOutput.cs) (revision 0467e8cd28578cf205b473d3830dbd02adb29feb)
@@ -27,14 +27,14 @@
/// Container of all relevant output generated by a type I calculation via Hydra-Ring:
/// Given a set of random variables, compute the probability of failure.
///
- public class ExceedanceProbabilityCalculationOutput
+ public class ExceedanceProbabilityCalculationOutput : ExceedanceProbabilityCalculationOutputBase
{
///
/// Creates a new instance of .
///
/// The ring combine method used.
/// The presentation section id used.
- /// The main mechanism id.
+ /// The main mechanism id used.
/// The main mechanism combine method used.
/// The mechanism id used.
/// The section id used.
@@ -44,66 +44,19 @@
public ExceedanceProbabilityCalculationOutput(int ringCombinMethod, int presentationSectionId,
int mainMechanismId, int mainMechanismCombinMethod, int mechanismId,
int sectionId, int layerId, int alternativeId, double beta)
+ : base(ringCombinMethod, presentationSectionId, mainMechanismId, mainMechanismCombinMethod, mechanismId, sectionId, layerId, alternativeId)
{
- RingCombinMethod = ringCombinMethod;
- PresentationSectionId = presentationSectionId;
- MainMechanismId = mainMechanismId;
- MainMechanismCombinMethod = mainMechanismCombinMethod;
- MechanismId = mechanismId;
- SectionId = sectionId;
- LayerId = layerId;
- AlternativeId = alternativeId;
Beta = beta;
Alphas = new List();
}
///
- /// Gets the Ring Combine Method.
+ /// Gets the beta result.
///
- public int RingCombinMethod { get; private set; }
-
- ///
- /// Gets the Presentation Section Id.
- ///
- public int PresentationSectionId { get; private set; }
-
- ///
- /// Gets the Main Mechanism Id.
- ///
- public int MainMechanismId { get; private set; }
-
- ///
- /// Gets the Main Mechanism Combine Method.
- ///
- public int MainMechanismCombinMethod { get; private set; }
-
- ///
- /// Gets the Mechanism Id.
- ///
- public int MechanismId { get; private set; }
-
- ///
- /// Gets the Section Id.
- ///
- public int SectionId { get; private set; }
-
- ///
- /// Gets the Layer Id.
- ///
- public int LayerId { get; private set; }
-
- ///
- /// Gets the Alternative Id.
- ///
- public int AlternativeId { get; private set; }
-
- ///
- /// Gets the Beta result.
- ///
public double Beta { get; private set; }
///
- /// Gets the Alpha result values.
+ /// Gets the alpha result values.
///
public IList Alphas { get; private set; }
}
Index: Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Data/Output/ExceedanceProbabilityCalculationOutputBase.cs
===================================================================
diff -u
--- Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Data/Output/ExceedanceProbabilityCalculationOutputBase.cs (revision 0)
+++ Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Data/Output/ExceedanceProbabilityCalculationOutputBase.cs (revision 0467e8cd28578cf205b473d3830dbd02adb29feb)
@@ -0,0 +1,94 @@
+// 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.
+
+namespace Ringtoets.HydraRing.Calculation.Data.Output
+{
+ ///
+ /// Base class for ExceedanceProbabilityCalculationOutputs.
+ ///
+ public abstract class ExceedanceProbabilityCalculationOutputBase
+ {
+ ///
+ /// Creates a new instance of .
+ ///
+ /// The ring combine method used.
+ /// The presentation section id used.
+ /// The main mechanism id used.
+ /// The main mechanism combine method used.
+ /// The mechanism id used.
+ /// The section id used.
+ /// The layer id used.
+ /// The alternative id used.
+ public ExceedanceProbabilityCalculationOutputBase(int ringCombinMethod, int presentationSectionId,
+ int mainMechanismId, int mainMechanismCombinMethod, int mechanismId,
+ int sectionId, int layerId, int alternativeId)
+ {
+ RingCombinMethod = ringCombinMethod;
+ PresentationSectionId = presentationSectionId;
+ MainMechanismId = mainMechanismId;
+ MainMechanismCombinMethod = mainMechanismCombinMethod;
+ MechanismId = mechanismId;
+ SectionId = sectionId;
+ LayerId = layerId;
+ AlternativeId = alternativeId;
+ }
+
+ ///
+ /// Gets the ring combine method.
+ ///
+ public int RingCombinMethod { get; private set; }
+
+ ///
+ /// Gets the presentation section id.
+ ///
+ public int PresentationSectionId { get; private set; }
+
+ ///
+ /// Gets the main mechanism id.
+ ///
+ public int MainMechanismId { get; private set; }
+
+ ///
+ /// Gets the main mechanism combine method.
+ ///
+ public int MainMechanismCombinMethod { get; private set; }
+
+ ///
+ /// Gets the mechanism id.
+ ///
+ public int MechanismId { get; private set; }
+
+ ///
+ /// Gets the section id.
+ ///
+ public int SectionId { get; private set; }
+
+ ///
+ /// Gets the layer id.
+ ///
+ public int LayerId { get; private set; }
+
+ ///
+ /// Gets the alternative id.
+ ///
+ public int AlternativeId { get; private set; }
+ }
+}
\ No newline at end of file
Index: Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Parsers/ExceedanceProbabilityCalculationParser.cs
===================================================================
diff -u -r9d378b8fa49ea011d8f4d229b5970f11c76f8305 -r0467e8cd28578cf205b473d3830dbd02adb29feb
--- Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Parsers/ExceedanceProbabilityCalculationParser.cs (.../ExceedanceProbabilityCalculationParser.cs) (revision 9d378b8fa49ea011d8f4d229b5970f11c76f8305)
+++ Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Parsers/ExceedanceProbabilityCalculationParser.cs (.../ExceedanceProbabilityCalculationParser.cs) (revision 0467e8cd28578cf205b473d3830dbd02adb29feb)
@@ -38,7 +38,7 @@
"WHERE SectionId = @SectionId " +
"ORDER BY BetaId DESC LIMIT 0,1;";
- private const string alphaResultsQuery = "SELECT RingCombinMethod, PresentationSectionId, MainMechanismId, MainMechanismCombinMethod, MechanismId, LayerId, AlternativeId, Alpha " +
+ private const string alphaResultsQuery = "SELECT RingCombinMethod, PresentationSectionId, MainMechanismId, MainMechanismCombinMethod, MechanismId, LayerId, AlternativeId, VariableId, LoadVariableId, Alpha " +
"FROM AlphaResults " +
"WHERE BetaId = @BetaId " +
"ORDER BY BetaId, VariableId, LoadVariableId;";
@@ -63,7 +63,7 @@
private static ExceedanceProbabilityCalculationOutput DoParse(string outputFilePath, int sectionId)
{
- using (var sqLiteConnection = OpenConnection(outputFilePath))
+ using (var sqLiteConnection = CreateConnection(outputFilePath))
{
sqLiteConnection.Open();
@@ -92,7 +92,7 @@
}
}
- private static SQLiteConnection OpenConnection(string databaseFile)
+ private static SQLiteConnection CreateConnection(string databaseFile)
{
var connectionStringBuilder = new SQLiteConnectionStringBuilder
{
@@ -145,10 +145,12 @@
var mechanismId = Convert.ToInt32(sqLiteDataReader["MechanismId"]);
var layerId = Convert.ToInt32(sqLiteDataReader["LayerId"]);
var alternativeId = Convert.ToInt32(sqLiteDataReader["AlternativeId"]);
+ var variableId = Convert.ToInt32(sqLiteDataReader["VariableId"]);
+ var loadVariableId = Convert.ToInt32(sqLiteDataReader["LoadVariableId"]);
var alpha = Convert.ToDouble(sqLiteDataReader["Alpha"]);
return new ExceedanceProbabilityCalculationAlphaOutput(
ringCombinMethod, presentationSectionId, mainMechanismId, mainMechanismCombinMethod,
- mechanismId, sectionId, layerId, alternativeId, alpha);
+ mechanismId, sectionId, layerId, alternativeId, variableId, loadVariableId, alpha);
}
#endregion
Index: Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Ringtoets.HydraRing.Calculation.csproj
===================================================================
diff -u -rb9f6d46631bdb16c2f1e65e791dd31e9380ccd6e -r0467e8cd28578cf205b473d3830dbd02adb29feb
--- Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Ringtoets.HydraRing.Calculation.csproj (.../Ringtoets.HydraRing.Calculation.csproj) (revision b9f6d46631bdb16c2f1e65e791dd31e9380ccd6e)
+++ Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Ringtoets.HydraRing.Calculation.csproj (.../Ringtoets.HydraRing.Calculation.csproj) (revision 0467e8cd28578cf205b473d3830dbd02adb29feb)
@@ -57,6 +57,7 @@
+
Index: Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Services/HydraRingCalculationService.cs
===================================================================
diff -u -rb9f6d46631bdb16c2f1e65e791dd31e9380ccd6e -r0467e8cd28578cf205b473d3830dbd02adb29feb
--- Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Services/HydraRingCalculationService.cs (.../HydraRingCalculationService.cs) (revision b9f6d46631bdb16c2f1e65e791dd31e9380ccd6e)
+++ Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Services/HydraRingCalculationService.cs (.../HydraRingCalculationService.cs) (revision 0467e8cd28578cf205b473d3830dbd02adb29feb)
@@ -45,7 +45,7 @@
/// The to use while executing the calculation.
/// The to use while executing the calculation.
/// The input of the calculation to perform.
- /// A or null when something went wrong.
+ /// A on a succesfull calculation, null otherwise.
public virtual TargetProbabilityCalculationOutput PerformCalculation(string hlcdDirectory, string ringId, HydraRingTimeIntegrationSchemeType timeIntegrationSchemeType, HydraRingUncertaintiesType uncertaintiesType, TargetProbabilityCalculationInput targetProbabilityCalculationInput)
{
return PerformCalculation(hlcdDirectory, ringId, timeIntegrationSchemeType, uncertaintiesType,
Index: Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Data/Output/ExceedanceProbabilityCalculationAlphaOutputTest.cs
===================================================================
diff -u -r9d378b8fa49ea011d8f4d229b5970f11c76f8305 -r0467e8cd28578cf205b473d3830dbd02adb29feb
--- Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Data/Output/ExceedanceProbabilityCalculationAlphaOutputTest.cs (.../ExceedanceProbabilityCalculationAlphaOutputTest.cs) (revision 9d378b8fa49ea011d8f4d229b5970f11c76f8305)
+++ Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Data/Output/ExceedanceProbabilityCalculationAlphaOutputTest.cs (.../ExceedanceProbabilityCalculationAlphaOutputTest.cs) (revision 0467e8cd28578cf205b473d3830dbd02adb29feb)
@@ -39,13 +39,15 @@
int sectionId = 6;
int layerId = 7;
int alternativeId = 8;
- double alpha = 9.9;
+ int variableId = 9;
+ int loadVariableId = 10;
+ double alpha = 11.11;
// Call
ExceedanceProbabilityCalculationAlphaOutput exceedanceProbabilityCalculationOutput =
new ExceedanceProbabilityCalculationAlphaOutput(ringCombinMethod, presentationSectionId,
mainMechanismId, mainMechanismCombinMethod, mechanismId,
- sectionId, layerId, alternativeId, alpha);
+ sectionId, layerId, alternativeId, variableId, loadVariableId, alpha);
// Assert
Assert.IsNotNull(exceedanceProbabilityCalculationOutput);
@@ -57,6 +59,8 @@
Assert.AreEqual(sectionId, exceedanceProbabilityCalculationOutput.SectionId);
Assert.AreEqual(layerId, exceedanceProbabilityCalculationOutput.LayerId);
Assert.AreEqual(alternativeId, exceedanceProbabilityCalculationOutput.AlternativeId);
+ Assert.AreEqual(variableId, exceedanceProbabilityCalculationOutput.VariableId);
+ Assert.AreEqual(loadVariableId, exceedanceProbabilityCalculationOutput.LoadVariableId);
Assert.AreEqual(alpha, exceedanceProbabilityCalculationOutput.Alpha);
}
}
Index: Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Data/Output/ExceedanceProbabilityCalculationOutputBaseTest.cs
===================================================================
diff -u
--- Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Data/Output/ExceedanceProbabilityCalculationOutputBaseTest.cs (revision 0)
+++ Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Data/Output/ExceedanceProbabilityCalculationOutputBaseTest.cs (revision 0467e8cd28578cf205b473d3830dbd02adb29feb)
@@ -0,0 +1,67 @@
+// 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.HydraRing.Calculation.Data.Output;
+
+namespace Ringtoets.HydraRing.Calculation.Test.Data.Output
+{
+ [TestFixture]
+ public class ExceedanceProbabilityCalculationOutputBaseTest
+ {
+ [Test]
+ public void Constructor_Always_ExpectedValues()
+ {
+ // Setup
+ int ringCombinMethod = 1;
+ int presentationSectionId = 2;
+ int mainMechanismId = 3;
+ int mainMechanismCombinMethod = 4;
+ int mechanismId = 5;
+ int sectionId = 6;
+ int layerId = 7;
+ int alternativeId = 8;
+
+ // Call
+ ExceedanceProbabilityCalculationOutputBaseImplementation exceedanceProbabilityCalculationOutput =
+ new ExceedanceProbabilityCalculationOutputBaseImplementation(ringCombinMethod, presentationSectionId,
+ mainMechanismId, mainMechanismCombinMethod, mechanismId,
+ sectionId, layerId, alternativeId);
+
+ // Assert
+ Assert.IsNotNull(exceedanceProbabilityCalculationOutput);
+ Assert.AreEqual(ringCombinMethod, exceedanceProbabilityCalculationOutput.RingCombinMethod);
+ Assert.AreEqual(presentationSectionId, exceedanceProbabilityCalculationOutput.PresentationSectionId);
+ Assert.AreEqual(mainMechanismId, exceedanceProbabilityCalculationOutput.MainMechanismId);
+ Assert.AreEqual(mainMechanismCombinMethod, exceedanceProbabilityCalculationOutput.MainMechanismCombinMethod);
+ Assert.AreEqual(mechanismId, exceedanceProbabilityCalculationOutput.MechanismId);
+ Assert.AreEqual(sectionId, exceedanceProbabilityCalculationOutput.SectionId);
+ Assert.AreEqual(layerId, exceedanceProbabilityCalculationOutput.LayerId);
+ Assert.AreEqual(alternativeId, exceedanceProbabilityCalculationOutput.AlternativeId);
+ }
+ }
+
+ internal class ExceedanceProbabilityCalculationOutputBaseImplementation : ExceedanceProbabilityCalculationOutputBase
+ {
+ public ExceedanceProbabilityCalculationOutputBaseImplementation(int ringCombinMethod, int presentationSectionId, int mainMechanismId, int mainMechanismCombinMethod, int mechanismId, int sectionId, int layerId, int alternativeId)
+ : base(ringCombinMethod, presentationSectionId, mainMechanismId, mainMechanismCombinMethod, mechanismId, sectionId, layerId, alternativeId) {}
+ }
+}
\ No newline at end of file
Index: Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Data/Output/ExceedanceProbabilityCalculationOutputTest.cs
===================================================================
diff -u -r9d378b8fa49ea011d8f4d229b5970f11c76f8305 -r0467e8cd28578cf205b473d3830dbd02adb29feb
--- Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Data/Output/ExceedanceProbabilityCalculationOutputTest.cs (.../ExceedanceProbabilityCalculationOutputTest.cs) (revision 9d378b8fa49ea011d8f4d229b5970f11c76f8305)
+++ Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Data/Output/ExceedanceProbabilityCalculationOutputTest.cs (.../ExceedanceProbabilityCalculationOutputTest.cs) (revision 0467e8cd28578cf205b473d3830dbd02adb29feb)
@@ -60,22 +60,5 @@
Assert.AreEqual(beta, exceedanceProbabilityCalculationOutput.Beta);
CollectionAssert.IsEmpty(exceedanceProbabilityCalculationOutput.Alphas);
}
-
- [Test]
- public void Alphas_VariousValues_ReturnsExpectedValues()
- {
- // Setup
- var exceedanceProbabilityCalculationAlphaOutput = new ExceedanceProbabilityCalculationAlphaOutput(11, 22, 33, 44, 55, 66, 77, 88, 99.99);
-
- ExceedanceProbabilityCalculationOutput exceedanceProbabilityCalculationOutput =
- new ExceedanceProbabilityCalculationOutput(1, 2, 3, 4, 5, 6, 7, 8, 9.9);
-
- // Call
- exceedanceProbabilityCalculationOutput.Alphas.Add(exceedanceProbabilityCalculationAlphaOutput);
-
- // Assert
- CollectionAssert.IsNotEmpty(exceedanceProbabilityCalculationOutput.Alphas);
- Assert.AreEqual(exceedanceProbabilityCalculationAlphaOutput, exceedanceProbabilityCalculationOutput.Alphas[0]);
- }
}
}
\ No newline at end of file
Index: Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Parsers/ExceedanceProbabilityCalculationParserTest.cs
===================================================================
diff -u -ra1d0c950e24eeef7e35cf3b79e7fcd9fd7af041c -r0467e8cd28578cf205b473d3830dbd02adb29feb
--- Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Parsers/ExceedanceProbabilityCalculationParserTest.cs (.../ExceedanceProbabilityCalculationParserTest.cs) (revision a1d0c950e24eeef7e35cf3b79e7fcd9fd7af041c)
+++ Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Parsers/ExceedanceProbabilityCalculationParserTest.cs (.../ExceedanceProbabilityCalculationParserTest.cs) (revision 0467e8cd28578cf205b473d3830dbd02adb29feb)
@@ -46,7 +46,7 @@
// Assert
Assert.DoesNotThrow(test);
Assert.IsNull(exceedanceProbabilityCalculationOutput);
- Assert.IsTrue(TestHelper.CanOpenFileForWrite(filePath));
+ Assert.IsFalse(File.Exists(testDataPath));
}
[Test]
@@ -81,13 +81,13 @@
var beta = 2.74030893482198;
var alphaValues = new List
{
- new ExceedanceProbabilityCalculationAlphaOutput(0, 1, 101, 0, 101, 35, 1, 1, -0.414848705277957),
- new ExceedanceProbabilityCalculationAlphaOutput(0, 1, 101, 0, 101, 35, 1, 1, -0.499651535355214),
- new ExceedanceProbabilityCalculationAlphaOutput(0, 1, 101, 0, 101, 35, 1, 1, -0.580660162401853),
- new ExceedanceProbabilityCalculationAlphaOutput(0, 1, 101, 0, 101, 35, 1, 1, 0.463049288940854),
- new ExceedanceProbabilityCalculationAlphaOutput(0, 1, 101, 0, 101, 35, 1, 1, 0.0434055709671213),
- new ExceedanceProbabilityCalculationAlphaOutput(0, 1, 101, 0, 101, 35, 1, 1, 0.150241106274945),
- new ExceedanceProbabilityCalculationAlphaOutput(0, 1, 101, 0, 101, 35, 1, 1, 0.0470275786268176)
+ new ExceedanceProbabilityCalculationAlphaOutput(0, 1, 101, 0, 101, 35, 1, 1, 0, 1, -0.414848705277957),
+ new ExceedanceProbabilityCalculationAlphaOutput(0, 1, 101, 0, 101, 35, 1, 1, 0, 23, -0.499651535355214),
+ new ExceedanceProbabilityCalculationAlphaOutput(0, 1, 101, 0, 101, 35, 1, 1, 0, 51, -0.580660162401853),
+ new ExceedanceProbabilityCalculationAlphaOutput(0, 1, 101, 0, 101, 35, 1, 1, 1, 0, 0.463049288940854),
+ new ExceedanceProbabilityCalculationAlphaOutput(0, 1, 101, 0, 101, 35, 1, 1, 10, 0, 0.0434055709671213),
+ new ExceedanceProbabilityCalculationAlphaOutput(0, 1, 101, 0, 101, 35, 1, 1, 11, 0, 0.150241106274945),
+ new ExceedanceProbabilityCalculationAlphaOutput(0, 1, 101, 0, 101, 35, 1, 1, 17, 0, 0.0470275786268176)
};
// Call
@@ -117,6 +117,8 @@
Assert.AreEqual(expectedAlpha.MechanismId, actualAlpha.MechanismId);
Assert.AreEqual(expectedAlpha.LayerId, actualAlpha.LayerId);
Assert.AreEqual(expectedAlpha.AlternativeId, actualAlpha.AlternativeId);
+ Assert.AreEqual(expectedAlpha.VariableId, actualAlpha.VariableId);
+ Assert.AreEqual(expectedAlpha.LoadVariableId, actualAlpha.LoadVariableId);
Assert.AreEqual(expectedAlpha.Alpha, actualAlpha.Alpha);
}
Index: Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Ringtoets.HydraRing.Calculation.Test.csproj
===================================================================
diff -u -rb9f6d46631bdb16c2f1e65e791dd31e9380ccd6e -r0467e8cd28578cf205b473d3830dbd02adb29feb
--- Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Ringtoets.HydraRing.Calculation.Test.csproj (.../Ringtoets.HydraRing.Calculation.Test.csproj) (revision b9f6d46631bdb16c2f1e65e791dd31e9380ccd6e)
+++ Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Ringtoets.HydraRing.Calculation.Test.csproj (.../Ringtoets.HydraRing.Calculation.Test.csproj) (revision 0467e8cd28578cf205b473d3830dbd02adb29feb)
@@ -68,6 +68,7 @@
+
Index: Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Services/HydraRingCalculationServiceTest.cs
===================================================================
diff -u -rb9f6d46631bdb16c2f1e65e791dd31e9380ccd6e -r0467e8cd28578cf205b473d3830dbd02adb29feb
--- Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Services/HydraRingCalculationServiceTest.cs (.../HydraRingCalculationServiceTest.cs) (revision b9f6d46631bdb16c2f1e65e791dd31e9380ccd6e)
+++ Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Services/HydraRingCalculationServiceTest.cs (.../HydraRingCalculationServiceTest.cs) (revision 0467e8cd28578cf205b473d3830dbd02adb29feb)
@@ -76,11 +76,11 @@
var hydraRingCalculationService = new HydraRingCalculationService();
var incorrectStationId = 999;
var hydraRingSection = new HydraRingSection(incorrectStationId, "999", 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
- var targetProbabilityCalculationInput = new OvertoppingCalculationInput(incorrectStationId, hydraRingSection,
- 1, 2, 3,
- new List(),
- new List(),
- new List());
+ var overtoppingCalculationInput = new OvertoppingCalculationInput(incorrectStationId, hydraRingSection,
+ 1, 2, 3,
+ new List(),
+ new List(),
+ new List());
var outputFolder = Path.Combine(Path.GetTempPath(), "" + incorrectStationId);
var outputFiles = new[]
{
@@ -93,12 +93,12 @@
using (new FileDisposeHelper(outputFiles))
{
// Call
- var targetProbabilityCalculationOutput = hydraRingCalculationService.PerformCalculation(
+ var overtoppingCalculationOutput = hydraRingCalculationService.PerformCalculation(
hlcdDirectory, "dummyRingId", HydraRingTimeIntegrationSchemeType.FBC,
- HydraRingUncertaintiesType.All, targetProbabilityCalculationInput);
+ HydraRingUncertaintiesType.All, overtoppingCalculationInput);
// Assert
- Assert.IsNull(targetProbabilityCalculationOutput);
+ Assert.IsNull(overtoppingCalculationOutput);
Assert.IsTrue(Directory.Exists(outputFolder));
foreach (var outputFile in outputFiles)
{
Fisheye: Tag 0467e8cd28578cf205b473d3830dbd02adb29feb refers to a dead (removed) revision in file `Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/test-data/Parsers/ExceedanceProbabilityCalculationParser/notExisting.sqlite'.
Fisheye: No comparison available. Pass `N' to diff?