Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/Piping/PipingFailureMechanismCreateExtensionsTest.cs
===================================================================
diff -u -r6173a5eb258ea7b50a5f4aac71d2448db9e211c3 -r779548d2d9deb4e87dbdc03739b94a2e332c7d47
--- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/Piping/PipingFailureMechanismCreateExtensionsTest.cs (.../PipingFailureMechanismCreateExtensionsTest.cs) (revision 6173a5eb258ea7b50a5f4aac71d2448db9e211c3)
+++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/Piping/PipingFailureMechanismCreateExtensionsTest.cs (.../PipingFailureMechanismCreateExtensionsTest.cs) (revision 779548d2d9deb4e87dbdc03739b94a2e332c7d47)
@@ -18,7 +18,6 @@
// 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.Linq;
using Application.Ringtoets.Storage.Create;
@@ -29,7 +28,6 @@
using Core.Common.Base.Geometry;
using NUnit.Framework;
using Ringtoets.Common.Data.Calculation;
-using Ringtoets.Common.Data.TestUtil;
using Ringtoets.Piping.Data;
using Ringtoets.Piping.Primitives;
Index: Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/PipingInputTest.cs
===================================================================
diff -u -r6173a5eb258ea7b50a5f4aac71d2448db9e211c3 -r779548d2d9deb4e87dbdc03739b94a2e332c7d47
--- Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/PipingInputTest.cs (.../PipingInputTest.cs) (revision 6173a5eb258ea7b50a5f4aac71d2448db9e211c3)
+++ Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/PipingInputTest.cs (.../PipingInputTest.cs) (revision 779548d2d9deb4e87dbdc03739b94a2e332c7d47)
@@ -28,7 +28,7 @@
using Ringtoets.Common.Data.Calculation;
using Ringtoets.Common.Data.Probabilistics;
using Ringtoets.Common.Data.TestUtil;
-using Ringtoets.HydraRing.Data;
+using Ringtoets.HydraRing.Data.TestUtil;
using Ringtoets.Piping.Data.Properties;
using Ringtoets.Piping.Data.TestUtil;
using Ringtoets.Piping.KernelWrapper.SubCalculator;
@@ -383,7 +383,7 @@
{
// Setup
var input = new PipingInput(new GeneralPipingInput());
- input.HydraulicBoundaryLocation = new HydraulicBoundaryLocation(0, string.Empty, 0.0, 0.0);
+ input.HydraulicBoundaryLocation = new TestHydraulicBoundaryLocation();
// Call
var calculatedAssessmentLevel = input.AssessmentLevel;
@@ -399,10 +399,7 @@
PipingInput input = new PipingInput(new GeneralPipingInput());
RoundedDouble testLevel = (RoundedDouble) new Random(21).NextDouble();
- input.HydraulicBoundaryLocation = new HydraulicBoundaryLocation(0, string.Empty, 0.0, 0.0)
- {
- DesignWaterLevel = testLevel
- };
+ input.HydraulicBoundaryLocation = new TestHydraulicBoundaryLocation(testLevel);
// Call
RoundedDouble calculatedAssessmentLevel = input.AssessmentLevel;
@@ -435,10 +432,7 @@
var random = new Random(21);
RoundedDouble testLevel = (RoundedDouble) random.NextDouble();
- input.HydraulicBoundaryLocation = new HydraulicBoundaryLocation(0, string.Empty, 0.0, 0.0)
- {
- DesignWaterLevel = testLevel
- };
+ input.HydraulicBoundaryLocation = new TestHydraulicBoundaryLocation(testLevel);
var newLevel = (RoundedDouble) random.NextDouble();
@@ -462,10 +456,7 @@
input.AssessmentLevel = testLevel;
var newLevel = (RoundedDouble) random.NextDouble();
- var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(0, string.Empty, 0.0, 0.0)
- {
- DesignWaterLevel = newLevel
- };
+ var hydraulicBoundaryLocation = new TestHydraulicBoundaryLocation(newLevel);
// When
input.HydraulicBoundaryLocation = hydraulicBoundaryLocation;
Index: Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/Ringtoets.Piping.Data.Test.csproj
===================================================================
diff -u -ref2c6cb7afd29e17ada49f5a18b9e21968122232 -r779548d2d9deb4e87dbdc03739b94a2e332c7d47
--- Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/Ringtoets.Piping.Data.Test.csproj (.../Ringtoets.Piping.Data.Test.csproj) (revision ef2c6cb7afd29e17ada49f5a18b9e21968122232)
+++ Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/Ringtoets.Piping.Data.Test.csproj (.../Ringtoets.Piping.Data.Test.csproj) (revision 779548d2d9deb4e87dbdc03739b94a2e332c7d47)
@@ -99,6 +99,10 @@
{70f8cc9c-5bc8-4fb2-b201-eae7fa8088c2}
Ringtoets.HydraRing.Data
+
+ {c033c69a-a1e3-4438-9c2c-eecca27bcba3}
+ Ringtoets.HydraRing.Data.TestUtil
+
{D64E4F0E-E341-496F-82B2-941AD202B4E3}
Ringtoets.Piping.KernelWrapper
Index: Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PropertyClasses/PipingInputContextPropertiesTest.cs
===================================================================
diff -u -r4c1b7cae9e302e07399e1045dac0fe81f1dbe3b5 -r779548d2d9deb4e87dbdc03739b94a2e332c7d47
--- Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PropertyClasses/PipingInputContextPropertiesTest.cs (.../PipingInputContextPropertiesTest.cs) (revision 4c1b7cae9e302e07399e1045dac0fe81f1dbe3b5)
+++ Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PropertyClasses/PipingInputContextPropertiesTest.cs (.../PipingInputContextPropertiesTest.cs) (revision 779548d2d9deb4e87dbdc03739b94a2e332c7d47)
@@ -66,7 +66,7 @@
{
// Setup
var mocks = new MockRepository();
- var assessmentSectionMock = mocks.StrictMock();
+ var assessmentSection = mocks.Stub();
mocks.ReplayAll();
PipingCalculationScenario calculationItem = new PipingCalculationScenario(new GeneralPipingInput());
PipingFailureMechanism failureMechanism = new PipingFailureMechanism();
@@ -81,7 +81,7 @@
Enumerable.Empty(),
Enumerable.Empty(),
failureMechanism,
- assessmentSectionMock)
+ assessmentSection)
};
// Assert
@@ -223,7 +223,7 @@
{
// Setup
var mocks = new MockRepository();
- var assessmentSectionMock = mocks.StrictMock();
+ var assessmentSection = mocks.Stub();
mocks.ReplayAll();
var random = new Random(22);
@@ -262,7 +262,7 @@
Enumerable.Empty(),
Enumerable.Empty(),
failureMechanism,
- assessmentSectionMock)
+ assessmentSection)
};
// Call & Assert
@@ -307,7 +307,7 @@
{
// Setup
var mocks = new MockRepository();
- var assessmentSectionMock = mocks.StrictMock();
+ var assessmentSection = mocks.Stub();
var projectObserver = mocks.StrictMock();
projectObserver.Expect(o => o.UpdateObserver());
mocks.ReplayAll();
@@ -325,7 +325,7 @@
Enumerable.Empty(),
Enumerable.Empty(),
failureMechanism,
- assessmentSectionMock)
+ assessmentSection)
};
const double entryPointL = 0.12;
@@ -343,7 +343,7 @@
{
// Setup
var mocks = new MockRepository();
- var assessmentSectionMock = mocks.StrictMock();
+ var assessmentSection = mocks.Stub();
var projectObserver = mocks.StrictMock();
int numberOfChangedProperties = 6;
projectObserver.Expect(o => o.UpdateObserver()).Repeat.Times(numberOfChangedProperties);
@@ -387,7 +387,7 @@
stochasticSoilModel2
},
failureMechanism,
- assessmentSectionMock),
+ assessmentSection),
DampingFactorExit = new LogNormalDistributionDesignVariable(dampingFactorExit),
PhreaticLevelExit = new NormalDistributionDesignVariable(phreaticLevelExit),
SurfaceLine = surfaceLine,
@@ -427,7 +427,7 @@
{
// Setup
var mocks = new MockRepository();
- var assessmentSectionMock = mocks.StrictMock();
+ var assessmentSection = mocks.Stub();
var inputObserver = mocks.StrictMock();
int numberOfChangedProperties = 2;
inputObserver.Expect(o => o.UpdateObserver()).Repeat.Times(numberOfChangedProperties);
@@ -450,7 +450,7 @@
Enumerable.Empty(),
Enumerable.Empty(),
failureMechanism,
- assessmentSectionMock),
+ assessmentSection),
ExitPointL = (RoundedDouble) exitPoint,
EntryPointL = (RoundedDouble) entryPoint
};
@@ -468,7 +468,7 @@
{
// Setup
var mocks = new MockRepository();
- var assessmentSectionMock = mocks.StrictMock();
+ var assessmentSection = mocks.Stub();
var inputObserver = mocks.StrictMock();
int numberOfChangedProperties = 2;
inputObserver.Expect(o => o.UpdateObserver()).Repeat.Times(numberOfChangedProperties);
@@ -491,7 +491,7 @@
Enumerable.Empty(),
Enumerable.Empty(),
failureMechanism,
- assessmentSectionMock),
+ assessmentSection),
EntryPointL = (RoundedDouble) 0.5,
ExitPointL = (RoundedDouble) 2
};
@@ -511,7 +511,7 @@
{
// Setup
var mocks = new MockRepository();
- var assessmentSectionMock = mocks.StrictMock();
+ var assessmentSection = mocks.Stub();
var inputObserver = mocks.StrictMock();
mocks.ReplayAll();
@@ -531,7 +531,7 @@
Enumerable.Empty(),
Enumerable.Empty(),
failureMechanism,
- assessmentSectionMock),
+ assessmentSection),
EntryPointL = (RoundedDouble) 2.0
};
@@ -553,7 +553,7 @@
{
// Setup
var mocks = new MockRepository();
- var assessmentSectionMock = mocks.StrictMock();
+ var assessmentSection = mocks.Stub();
var inputObserver = mocks.StrictMock();
mocks.ReplayAll();
@@ -573,7 +573,7 @@
Enumerable.Empty(),
Enumerable.Empty(),
failureMechanism,
- assessmentSectionMock),
+ assessmentSection),
ExitPointL = (RoundedDouble) 2.0
};
@@ -593,7 +593,7 @@
{
// Setup
var mocks = new MockRepository();
- var assessmentSectionMock = mocks.StrictMock();
+ var assessmentSection = mocks.Stub();
var inputObserver = mocks.StrictMock();
mocks.ReplayAll();
@@ -613,7 +613,7 @@
Enumerable.Empty(),
Enumerable.Empty(),
failureMechanism,
- assessmentSectionMock),
+ assessmentSection),
ExitPointL = (RoundedDouble) 2.0
};
@@ -633,7 +633,7 @@
{
// Setup
var mocks = new MockRepository();
- var assessmentSectionMock = mocks.StrictMock();
+ var assessmentSection = mocks.Stub();
var inputObserver = mocks.StrictMock();
mocks.ReplayAll();
@@ -653,7 +653,7 @@
Enumerable.Empty(),
Enumerable.Empty(),
failureMechanism,
- assessmentSectionMock),
+ assessmentSection),
EntryPointL = (RoundedDouble) 2.0
};
@@ -673,7 +673,7 @@
{
// Setup
var mocks = new MockRepository();
- var assessmentSectionMock = mocks.Stub();
+ var assessmentSection = mocks.Stub();
var projectObserver = mocks.StrictMock();
projectObserver.Expect(o => o.UpdateObserver());
mocks.ReplayAll();
@@ -684,10 +684,7 @@
PipingInput inputParameters = new PipingInput(new GeneralPipingInput())
{
- HydraulicBoundaryLocation = new HydraulicBoundaryLocation(0, string.Empty, 0.0, 0.0)
- {
- DesignWaterLevel = assessmentLevel
- }
+ HydraulicBoundaryLocation = new TestHydraulicBoundaryLocation(assessmentLevel)
};
inputParameters.Attach(projectObserver);
@@ -698,14 +695,10 @@
Enumerable.Empty(),
Enumerable.Empty(),
failureMechanism,
- assessmentSectionMock)
+ assessmentSection)
};
- string testName = "TestName";
- var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(0, testName, 0, 0)
- {
- DesignWaterLevel = RoundedDouble.NaN
- };
+ var hydraulicBoundaryLocation = new TestHydraulicBoundaryLocation();
var selectableHydraulicBoundaryLocation = new SelectableHydraulicBoundaryLocation(hydraulicBoundaryLocation, null);
// Call
@@ -744,10 +737,7 @@
};
RoundedDouble testLevel = (RoundedDouble) new Random(21).NextDouble();
- var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(0, string.Empty, 0, 0)
- {
- DesignWaterLevel = testLevel
- };
+ var hydraulicBoundaryLocation = new TestHydraulicBoundaryLocation(testLevel);
var selectableHydraulicBoundaryLocation = new SelectableHydraulicBoundaryLocation(hydraulicBoundaryLocation, null);
// Call
@@ -764,7 +754,7 @@
{
// Given
var mocks = new MockRepository();
- var assessmentSectionMock = mocks.Stub();
+ var assessmentSection = mocks.Stub();
mocks.ReplayAll();
PipingCalculationScenario calculationItem = new PipingCalculationScenario(new GeneralPipingInput());
@@ -773,10 +763,7 @@
var random = new Random(21);
PipingInput inputParameters = new PipingInput(new GeneralPipingInput())
{
- HydraulicBoundaryLocation = new HydraulicBoundaryLocation(0, string.Empty, 0, 0)
- {
- DesignWaterLevel = (RoundedDouble) 50
- }
+ HydraulicBoundaryLocation = new TestHydraulicBoundaryLocation((RoundedDouble) 50)
};
PipingInputContextProperties properties = new PipingInputContextProperties
@@ -786,7 +773,7 @@
Enumerable.Empty(),
Enumerable.Empty(),
failureMechanism,
- assessmentSectionMock)
+ assessmentSection)
};
RoundedDouble testLevel = (RoundedDouble) random.NextDouble();
@@ -811,7 +798,7 @@
{
// Setup
var mocks = new MockRepository();
- var assessmentSectionMock = mocks.Stub();
+ var assessmentSection = mocks.Stub();
var projectObserver = mocks.StrictMock();
projectObserver.Expect(o => o.UpdateObserver()).Repeat.Times(1);
mocks.ReplayAll();
@@ -829,7 +816,7 @@
Enumerable.Empty(),
Enumerable.Empty(),
failureMechanism,
- assessmentSectionMock)
+ assessmentSection)
};
// Call
@@ -847,7 +834,7 @@
{
// Given
var mocks = new MockRepository();
- var assessmentSectionMock = mocks.Stub();
+ var assessmentSection = mocks.Stub();
mocks.ReplayAll();
PipingCalculationScenario calculationItem = new PipingCalculationScenario(new GeneralPipingInput());
@@ -864,14 +851,11 @@
Enumerable.Empty(),
Enumerable.Empty(),
failureMechanism,
- assessmentSectionMock)
+ assessmentSection)
};
RoundedDouble testLevel = (RoundedDouble) random.NextDouble();
- var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(0, string.Empty, 0, 0)
- {
- DesignWaterLevel = testLevel
- };
+ var hydraulicBoundaryLocation = new TestHydraulicBoundaryLocation(testLevel);
var selectableHydraulicBoundaryLocation = new SelectableHydraulicBoundaryLocation(hydraulicBoundaryLocation, null);
// When
@@ -890,7 +874,7 @@
{
// Setup
var mocks = new MockRepository();
- var assessmentSectionMock = mocks.StrictMock();
+ var assessmentSection = mocks.Stub();
mocks.ReplayAll();
PipingCalculationScenario calculationItem = new PipingCalculationScenario(new GeneralPipingInput())
@@ -910,7 +894,7 @@
Enumerable.Empty(),
Enumerable.Empty(),
failureMechanism,
- assessmentSectionMock)
+ assessmentSection)
};
inputParameters.StochasticSoilProfile = new StochasticSoilProfile(0.0, SoilProfileType.SoilProfile1D, 0)
{
@@ -931,7 +915,7 @@
{
// Setup
var mocks = new MockRepository();
- var assessmentSectionMock = mocks.StrictMock();
+ var assessmentSection = mocks.Stub();
mocks.ReplayAll();
RingtoetsPipingSurfaceLine testSurfaceLine = ValidSurfaceLine(0, 2);
@@ -961,7 +945,7 @@
stochasticSoilModel
},
failureMechanism,
- assessmentSectionMock)
+ assessmentSection)
};
// Call
@@ -978,7 +962,7 @@
{
// Setup
var mocks = new MockRepository();
- var assessmentSectionMock = mocks.StrictMock();
+ var assessmentSection = mocks.Stub();
mocks.ReplayAll();
StochasticSoilProfile testPipingSoilProfile = new StochasticSoilProfile(0.0, SoilProfileType.SoilProfile1D, 0)
@@ -1010,7 +994,7 @@
stochasticSoilModel
},
failureMechanism,
- assessmentSectionMock)
+ assessmentSection)
};
// Call
@@ -1027,7 +1011,7 @@
{
// Setup
var mocks = new MockRepository();
- var assessmentSectionMock = mocks.StrictMock();
+ var assessmentSection = mocks.Stub();
mocks.ReplayAll();
RingtoetsPipingSurfaceLine testSurfaceLine = ValidSurfaceLine(0, 2);
@@ -1061,7 +1045,7 @@
Enumerable.Empty(),
Enumerable.Empty(),
failureMechanism,
- assessmentSectionMock)
+ assessmentSection)
};
// Call
@@ -1079,8 +1063,8 @@
{
// Given
var mocks = new MockRepository();
- var typeDescriptorContextMock = mocks.StrictMock();
- var assessmentSectionMock = mocks.StrictMock();
+ var typeDescriptorContext = mocks.StrictMock();
+ var assessmentSection = mocks.Stub();
PipingCalculationScenario calculationItem = new PipingCalculationScenario(new GeneralPipingInput());
PipingFailureMechanism failureMechanism = new PipingFailureMechanism();
@@ -1093,20 +1077,17 @@
Enumerable.Empty(),
Enumerable.Empty(),
failureMechanism,
- assessmentSectionMock)
+ assessmentSection)
};
- inputParameters.HydraulicBoundaryLocation = new HydraulicBoundaryLocation(0, string.Empty, 0, 0)
- {
- DesignWaterLevel = (RoundedDouble) 1.0
- };
+ inputParameters.HydraulicBoundaryLocation = new TestHydraulicBoundaryLocation((RoundedDouble) 1.0);
DesignVariable phreaticLevelExitProperty = contextProperties.PhreaticLevelExit;
DynamicPropertyBag dynamicPropertyBag = new DynamicPropertyBag(contextProperties);
- typeDescriptorContextMock.Expect(tdc => tdc.Instance).Return(dynamicPropertyBag).Repeat.Twice();
- typeDescriptorContextMock.Stub(tdc => tdc.PropertyDescriptor).Return(dynamicPropertyBag.GetProperties()["PhreaticLevelExit"]);
+ typeDescriptorContext.Expect(tdc => tdc.Instance).Return(dynamicPropertyBag).Repeat.Twice();
+ typeDescriptorContext.Stub(tdc => tdc.PropertyDescriptor).Return(dynamicPropertyBag.GetProperties()["PhreaticLevelExit"]);
mocks.ReplayAll();
- PropertyDescriptorCollection properties = new NormalDistributionDesignVariableTypeConverter().GetProperties(typeDescriptorContextMock, phreaticLevelExitProperty);
+ PropertyDescriptorCollection properties = new NormalDistributionDesignVariableTypeConverter().GetProperties(typeDescriptorContext, phreaticLevelExitProperty);
Assert.NotNull(properties);
// When
@@ -1334,14 +1315,14 @@
{
// Setup
var mocks = new MockRepository();
- var assessmentSectionStub = mocks.Stub();
+ var assessmentSection = mocks.Stub();
mocks.ReplayAll();
var failureMechanism = new PipingFailureMechanism();
var calculation = new PipingCalculationScenario(failureMechanism.GeneralInput);
var context = new PipingInputContext(calculation.InputParameters, calculation,
failureMechanism.SurfaceLines, failureMechanism.StochasticSoilModels,
- failureMechanism, assessmentSectionStub);
+ failureMechanism, assessmentSection);
var properties = new PipingInputContextProperties
{
Data = context