Index: Ringtoets/Common/src/Ringtoets.Common.IO/HydraRing/ReadPreprocessorSetting.cs
===================================================================
diff -u
--- Ringtoets/Common/src/Ringtoets.Common.IO/HydraRing/ReadPreprocessorSetting.cs (revision 0)
+++ Ringtoets/Common/src/Ringtoets.Common.IO/HydraRing/ReadPreprocessorSetting.cs (revision e2b91ee0187b6b6ea0f5941bcbfa986eff613612)
@@ -0,0 +1,50 @@
+// Copyright (C) Stichting Deltares 2017. 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.Common.IO.HydraRing
+{
+ ///
+ /// Container for read preprocessor settings.
+ ///
+ public class ReadPreprocessorSetting
+ {
+ ///
+ /// Creates a new instance of .
+ ///
+ /// The minimum value to use while running the preprocessor.
+ /// The maximum value to use while running the preprocessor.
+ public ReadPreprocessorSetting(double valueMin, double valueMax)
+ {
+ ValueMin = valueMin;
+ ValueMax = valueMax;
+ }
+
+ ///
+ /// Gets the minimum value to use while running the preprocessor.
+ ///
+ public double ValueMin { get; }
+
+ ///
+ /// Gets the maximum value to use while running the preprocessor.
+ ///
+ public double ValueMax { get; }
+ }
+}
\ No newline at end of file
Index: Ringtoets/Common/src/Ringtoets.Common.IO/Ringtoets.Common.IO.csproj
===================================================================
diff -u -rf8c28b3b04cdabb62ea37772efcb1f4ebbbf2b9e -re2b91ee0187b6b6ea0f5941bcbfa986eff613612
--- Ringtoets/Common/src/Ringtoets.Common.IO/Ringtoets.Common.IO.csproj (.../Ringtoets.Common.IO.csproj) (revision f8c28b3b04cdabb62ea37772efcb1f4ebbbf2b9e)
+++ Ringtoets/Common/src/Ringtoets.Common.IO/Ringtoets.Common.IO.csproj (.../Ringtoets.Common.IO.csproj) (revision e2b91ee0187b6b6ea0f5941bcbfa986eff613612)
@@ -90,6 +90,7 @@
+
Index: Ringtoets/Common/test/Ringtoets.Common.IO.Test/HydraRing/PreprocessorSettingsProviderTest.cs
===================================================================
diff -u -rf8c28b3b04cdabb62ea37772efcb1f4ebbbf2b9e -re2b91ee0187b6b6ea0f5941bcbfa986eff613612
--- Ringtoets/Common/test/Ringtoets.Common.IO.Test/HydraRing/PreprocessorSettingsProviderTest.cs (.../PreprocessorSettingsProviderTest.cs) (revision f8c28b3b04cdabb62ea37772efcb1f4ebbbf2b9e)
+++ Ringtoets/Common/test/Ringtoets.Common.IO.Test/HydraRing/PreprocessorSettingsProviderTest.cs (.../PreprocessorSettingsProviderTest.cs) (revision e2b91ee0187b6b6ea0f5941bcbfa986eff613612)
@@ -56,8 +56,7 @@
PreprocessorSetting setting = provider.GetPreprocessorSetting(700131, false);
// Assert
- Assert.IsNaN(setting.ValueMin);
- Assert.IsNaN(setting.ValueMax);
+ Assert.IsFalse(setting.RunPreprocessor);
}
}
@@ -71,8 +70,7 @@
PreprocessorSetting setting = provider.GetPreprocessorSetting(700136, true);
// Assert
- Assert.IsNaN(setting.ValueMin);
- Assert.IsNaN(setting.ValueMax);
+ Assert.IsFalse(setting.RunPreprocessor);
}
}
@@ -86,6 +84,7 @@
PreprocessorSetting setting = provider.GetPreprocessorSetting(700131, true);
// Assert
+ Assert.IsTrue(setting.RunPreprocessor);
Assert.AreEqual(2, setting.ValueMin);
Assert.AreEqual(8, setting.ValueMax);
NumericsSetting numericsSetting = setting.NumericsSetting;
@@ -116,6 +115,7 @@
PreprocessorSetting setting = provider.GetPreprocessorSetting(700139, true);
// Assert
+ Assert.IsTrue(setting.RunPreprocessor);
Assert.AreEqual(1, setting.ValueMin);
Assert.AreEqual(6, setting.ValueMax);
NumericsSetting numericsSetting = setting.NumericsSetting;
Index: Ringtoets/Common/test/Ringtoets.Common.IO.Test/HydraRing/ReadPreprocessorSettingTest.cs
===================================================================
diff -u
--- Ringtoets/Common/test/Ringtoets.Common.IO.Test/HydraRing/ReadPreprocessorSettingTest.cs (revision 0)
+++ Ringtoets/Common/test/Ringtoets.Common.IO.Test/HydraRing/ReadPreprocessorSettingTest.cs (revision e2b91ee0187b6b6ea0f5941bcbfa986eff613612)
@@ -0,0 +1,47 @@
+// Copyright (C) Stichting Deltares 2017. 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 NUnit.Framework;
+using Ringtoets.Common.IO.HydraRing;
+
+namespace Ringtoets.Common.IO.Test.HydraRing
+{
+ [TestFixture]
+ public class ReadPreprocessorSettingTest
+ {
+ [Test]
+ public void Constructor_ExpectedValues()
+ {
+ // Setup
+ var random = new Random(11);
+ double valueMin = random.NextDouble();
+ double valueMax = random.NextDouble();
+
+ // Call
+ var readPreprocessorSetting = new ReadPreprocessorSetting(valueMin, valueMax);
+
+ // Assert
+ Assert.AreEqual(valueMin, readPreprocessorSetting.ValueMin);
+ Assert.AreEqual(valueMax, readPreprocessorSetting.ValueMax);
+ }
+ }
+}
\ No newline at end of file
Index: Ringtoets/Common/test/Ringtoets.Common.IO.Test/Ringtoets.Common.IO.Test.csproj
===================================================================
diff -u -rf8c28b3b04cdabb62ea37772efcb1f4ebbbf2b9e -re2b91ee0187b6b6ea0f5941bcbfa986eff613612
--- Ringtoets/Common/test/Ringtoets.Common.IO.Test/Ringtoets.Common.IO.Test.csproj (.../Ringtoets.Common.IO.Test.csproj) (revision f8c28b3b04cdabb62ea37772efcb1f4ebbbf2b9e)
+++ Ringtoets/Common/test/Ringtoets.Common.IO.Test/Ringtoets.Common.IO.Test.csproj (.../Ringtoets.Common.IO.Test.csproj) (revision e2b91ee0187b6b6ea0f5941bcbfa986eff613612)
@@ -92,6 +92,7 @@
+
Index: Ringtoets/Common/test/Ringtoets.Common.Service.Test/HydraRingSettingsDatabaseHelperTest.cs
===================================================================
diff -u -rf8c28b3b04cdabb62ea37772efcb1f4ebbbf2b9e -re2b91ee0187b6b6ea0f5941bcbfa986eff613612
--- Ringtoets/Common/test/Ringtoets.Common.Service.Test/HydraRingSettingsDatabaseHelperTest.cs (.../HydraRingSettingsDatabaseHelperTest.cs) (revision f8c28b3b04cdabb62ea37772efcb1f4ebbbf2b9e)
+++ Ringtoets/Common/test/Ringtoets.Common.Service.Test/HydraRingSettingsDatabaseHelperTest.cs (.../HydraRingSettingsDatabaseHelperTest.cs) (revision e2b91ee0187b6b6ea0f5941bcbfa986eff613612)
@@ -55,25 +55,9 @@
}
[Test]
- public void AssignSettingsFromDatabase_FileWithEmptySettingsDatabase_DefaultsSettingsAdded()
- {
- // Setup
- var input = new TestHydraRingCalculationInput();
-
- // Call
- HydraRingSettingsDatabaseHelper.AssignSettingsFromDatabase(input, Path.Combine(testDataPath, "hrd.sqlite"), false);
-
- // Assert
- Assert.NotNull(input.PreprocessorSetting);
- Assert.NotNull(input.DesignTablesSetting);
- Assert.NotNull(input.NumericsSettings);
- Assert.NotNull(input.TimeIntegrationSetting);
- }
-
- [Test]
[TestCase(true)]
[TestCase(false)]
- public void AssignSettingsFromDatabase_UsePreprocessor_SettingsAdded(bool usePreprocessor)
+ public void AssignSettingsFromDatabase_FileWithEmptySettingsDatabase_DefaultsSettingsAdded(bool usePreprocessor)
{
// Setup
var input = new TestHydraRingCalculationInput();
@@ -82,6 +66,9 @@
HydraRingSettingsDatabaseHelper.AssignSettingsFromDatabase(input, Path.Combine(testDataPath, "hrd.sqlite"), usePreprocessor);
// Assert
+ Assert.NotNull(input.DesignTablesSetting);
+ Assert.NotNull(input.NumericsSettings);
+ Assert.NotNull(input.TimeIntegrationSetting);
Assert.NotNull(input.PreprocessorSetting);
Assert.AreEqual(usePreprocessor, input.PreprocessorSetting.RunPreprocessor);
}
Fisheye: Tag e2b91ee0187b6b6ea0f5941bcbfa986eff613612 refers to a dead (removed) revision in file `Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Readers/ReadPreprocessorSetting.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Index: Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Ringtoets.HydraRing.Calculation.csproj
===================================================================
diff -u -rf8c28b3b04cdabb62ea37772efcb1f4ebbbf2b9e -re2b91ee0187b6b6ea0f5941bcbfa986eff613612
--- Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Ringtoets.HydraRing.Calculation.csproj (.../Ringtoets.HydraRing.Calculation.csproj) (revision f8c28b3b04cdabb62ea37772efcb1f4ebbbf2b9e)
+++ Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Ringtoets.HydraRing.Calculation.csproj (.../Ringtoets.HydraRing.Calculation.csproj) (revision e2b91ee0187b6b6ea0f5941bcbfa986eff613612)
@@ -142,7 +142,6 @@
-
Fisheye: Tag e2b91ee0187b6b6ea0f5941bcbfa986eff613612 refers to a dead (removed) revision in file `Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Readers/ReadPreprocessorSettingTest.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Index: Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Ringtoets.HydraRing.Calculation.Test.csproj
===================================================================
diff -u -rf8c28b3b04cdabb62ea37772efcb1f4ebbbf2b9e -re2b91ee0187b6b6ea0f5941bcbfa986eff613612
--- Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Ringtoets.HydraRing.Calculation.Test.csproj (.../Ringtoets.HydraRing.Calculation.Test.csproj) (revision f8c28b3b04cdabb62ea37772efcb1f4ebbbf2b9e)
+++ Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Ringtoets.HydraRing.Calculation.Test.csproj (.../Ringtoets.HydraRing.Calculation.Test.csproj) (revision e2b91ee0187b6b6ea0f5941bcbfa986eff613612)
@@ -127,7 +127,6 @@
-