Index: Riskeer/Common/src/Riskeer.Common.Forms/PresentationObjects/DesignWaterLevelCalculationContext.cs
===================================================================
diff -u -r6e3bc0437167a40cf4a79f0f04e31dc61ef4407f -rd09b2f2aeab8aa4b21f0d85de8962afcf70a4c99
--- Riskeer/Common/src/Riskeer.Common.Forms/PresentationObjects/DesignWaterLevelCalculationContext.cs (.../DesignWaterLevelCalculationContext.cs) (revision 6e3bc0437167a40cf4a79f0f04e31dc61ef4407f)
+++ Riskeer/Common/src/Riskeer.Common.Forms/PresentationObjects/DesignWaterLevelCalculationContext.cs (.../DesignWaterLevelCalculationContext.cs) (revision d09b2f2aeab8aa4b21f0d85de8962afcf70a4c99)
@@ -20,6 +20,7 @@
// All rights reserved.
using System;
+using Riskeer.Common.Data.AssessmentSection;
using Riskeer.Common.Data.Hydraulics;
namespace Riskeer.Common.Forms.PresentationObjects
@@ -35,8 +36,9 @@
///
/// The which the
/// belongs to.
- /// Thrown when is null.
- public DesignWaterLevelCalculationContext(HydraulicBoundaryLocationCalculation wrappedData)
- : base(wrappedData) {}
+ /// The assessment section the calculation belongs to.
+ /// Thrown when any parameter is null.
+ public DesignWaterLevelCalculationContext(HydraulicBoundaryLocationCalculation wrappedData, IAssessmentSection assessmentSection)
+ : base(wrappedData, assessmentSection) {}
}
}
\ No newline at end of file
Index: Riskeer/Common/src/Riskeer.Common.Forms/Views/DesignWaterLevelCalculationsView.cs
===================================================================
diff -u -rcd66114d9af655f71f133ceb542da2bf2c0693e4 -rd09b2f2aeab8aa4b21f0d85de8962afcf70a4c99
--- Riskeer/Common/src/Riskeer.Common.Forms/Views/DesignWaterLevelCalculationsView.cs (.../DesignWaterLevelCalculationsView.cs) (revision cd66114d9af655f71f133ceb542da2bf2c0693e4)
+++ Riskeer/Common/src/Riskeer.Common.Forms/Views/DesignWaterLevelCalculationsView.cs (.../DesignWaterLevelCalculationsView.cs) (revision d09b2f2aeab8aa4b21f0d85de8962afcf70a4c99)
@@ -74,7 +74,8 @@
if (currentRow != null)
{
- return new DesignWaterLevelCalculationContext(((HydraulicBoundaryLocationCalculationRow) currentRow.DataBoundItem).CalculatableObject);
+ return new DesignWaterLevelCalculationContext(((HydraulicBoundaryLocationCalculationRow) currentRow.DataBoundItem).CalculatableObject,
+ AssessmentSection);
}
return null;
Index: Riskeer/Common/test/Riskeer.Common.Forms.Test/PresentationObjects/DesignWaterLevelCalculationContextTest.cs
===================================================================
diff -u -r6e3bc0437167a40cf4a79f0f04e31dc61ef4407f -rd09b2f2aeab8aa4b21f0d85de8962afcf70a4c99
--- Riskeer/Common/test/Riskeer.Common.Forms.Test/PresentationObjects/DesignWaterLevelCalculationContextTest.cs (.../DesignWaterLevelCalculationContextTest.cs) (revision 6e3bc0437167a40cf4a79f0f04e31dc61ef4407f)
+++ Riskeer/Common/test/Riskeer.Common.Forms.Test/PresentationObjects/DesignWaterLevelCalculationContextTest.cs (.../DesignWaterLevelCalculationContextTest.cs) (revision d09b2f2aeab8aa4b21f0d85de8962afcf70a4c99)
@@ -20,6 +20,8 @@
// All rights reserved.
using NUnit.Framework;
+using Rhino.Mocks;
+using Riskeer.Common.Data.AssessmentSection;
using Riskeer.Common.Data.Hydraulics;
using Riskeer.Common.Data.TestUtil;
using Riskeer.Common.Forms.PresentationObjects;
@@ -33,14 +35,20 @@
public void Constructor_ValidParameters_ExpectedValues()
{
// Setup
+ var mocks = new MockRepository();
+ var assessmentSection = mocks.Stub();
+ mocks.ReplayAll();
+
var hydraulicBoundaryLocationCalculation = new HydraulicBoundaryLocationCalculation(new TestHydraulicBoundaryLocation());
// Call
- var context = new DesignWaterLevelCalculationContext(hydraulicBoundaryLocationCalculation);
+ var context = new DesignWaterLevelCalculationContext(hydraulicBoundaryLocationCalculation, assessmentSection);
// Assert
Assert.IsInstanceOf(context);
Assert.AreSame(hydraulicBoundaryLocationCalculation, context.WrappedData);
+ Assert.AreSame(assessmentSection, context.AssessmentSection);
+ mocks.VerifyAll();
}
}
}
\ No newline at end of file
Index: Riskeer/Common/test/Riskeer.Common.Forms.Test/Views/DesignWaterLevelCalculationsViewTest.cs
===================================================================
diff -u -ra3158400866c3db88b69ea30cc80b2e123fb759a -rd09b2f2aeab8aa4b21f0d85de8962afcf70a4c99
--- Riskeer/Common/test/Riskeer.Common.Forms.Test/Views/DesignWaterLevelCalculationsViewTest.cs (.../DesignWaterLevelCalculationsViewTest.cs) (revision a3158400866c3db88b69ea30cc80b2e123fb759a)
+++ Riskeer/Common/test/Riskeer.Common.Forms.Test/Views/DesignWaterLevelCalculationsViewTest.cs (.../DesignWaterLevelCalculationsViewTest.cs) (revision d09b2f2aeab8aa4b21f0d85de8962afcf70a4c99)
@@ -486,7 +486,8 @@
protected override object GetCalculationSelection(HydraulicBoundaryCalculationsView view, object selectedRowObject)
{
- return new DesignWaterLevelCalculationContext(((HydraulicBoundaryLocationCalculationRow) selectedRowObject).CalculatableObject, assessmentSection);
+ return new DesignWaterLevelCalculationContext(((HydraulicBoundaryLocationCalculationRow) selectedRowObject).CalculatableObject,
+ view.AssessmentSection);
}
protected override HydraulicBoundaryCalculationsView ShowFullyConfiguredCalculationsView(Form form)
Index: Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/PropertyInfos/DesignWaterLevelCalculationContextPropertyInfoTest.cs
===================================================================
diff -u -r01c40dbdf75bccae38a7728556afe2f8968f55c0 -rd09b2f2aeab8aa4b21f0d85de8962afcf70a4c99
--- Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/PropertyInfos/DesignWaterLevelCalculationContextPropertyInfoTest.cs (.../DesignWaterLevelCalculationContextPropertyInfoTest.cs) (revision 01c40dbdf75bccae38a7728556afe2f8968f55c0)
+++ Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/PropertyInfos/DesignWaterLevelCalculationContextPropertyInfoTest.cs (.../DesignWaterLevelCalculationContextPropertyInfoTest.cs) (revision d09b2f2aeab8aa4b21f0d85de8962afcf70a4c99)
@@ -23,6 +23,8 @@
using Core.Gui.Plugin;
using Core.Gui.PropertyBag;
using NUnit.Framework;
+using Rhino.Mocks;
+using Riskeer.Common.Data.AssessmentSection;
using Riskeer.Common.Data.Hydraulics;
using Riskeer.Common.Data.TestUtil;
using Riskeer.Common.Forms.PresentationObjects;
@@ -52,9 +54,13 @@
public void CreateInstance_WithContext_SetsDataCorrectly()
{
// Setup
+ var mocks = new MockRepository();
+ var assessmentSection = mocks.Stub();
+ mocks.ReplayAll();
+
var hydraulicBoundaryLocationCalculation = new HydraulicBoundaryLocationCalculation(new TestHydraulicBoundaryLocation());
- var context = new DesignWaterLevelCalculationContext(hydraulicBoundaryLocationCalculation);
+ var context = new DesignWaterLevelCalculationContext(hydraulicBoundaryLocationCalculation, assessmentSection);
using (var plugin = new RiskeerPlugin())
{
@@ -67,6 +73,8 @@
Assert.IsInstanceOf(objectProperties);
Assert.AreSame(hydraulicBoundaryLocationCalculation, objectProperties.Data);
}
+
+ mocks.VerifyAll();
}
private static PropertyInfo GetInfo(RiskeerPlugin plugin)