Index: Ringtoets/Common/test/Ringtoets.Common.Forms.TestUtil/LocationsViewDataSynchronizationTester.cs
===================================================================
diff -u -r8e6506f609db1f94bfce07a20629b5781184be73 -r2fac008f9a91a37ac4300ec2e0cdf2b4e5eeea1b
--- Ringtoets/Common/test/Ringtoets.Common.Forms.TestUtil/LocationsViewDataSynchronizationTester.cs (.../LocationsViewDataSynchronizationTester.cs) (revision 8e6506f609db1f94bfce07a20629b5781184be73)
+++ Ringtoets/Common/test/Ringtoets.Common.Forms.TestUtil/LocationsViewDataSynchronizationTester.cs (.../LocationsViewDataSynchronizationTester.cs) (revision 2fac008f9a91a37ac4300ec2e0cdf2b4e5eeea1b)
@@ -23,6 +23,7 @@
using System.Windows.Forms;
using Core.Common.Controls.DataGrid;
using NUnit.Framework;
+using Rhino.Mocks;
using Ringtoets.Common.Forms.PresentationObjects;
using Ringtoets.Common.Forms.Views;
@@ -34,18 +35,21 @@
/// The type of the locations contained by the view.
public abstract class LocationsViewDataSynchronizationTester where T : class
{
- private Form testForm;
+ protected Form testForm;
+ protected MockRepository mockRepository;
[SetUp]
public void Setup()
{
testForm = new Form();
+ mockRepository = new MockRepository();
}
[TearDown]
public void TearDown()
{
testForm.Dispose();
+ mockRepository.VerifyAll();
}
///
Index: Ringtoets/Common/test/Ringtoets.Common.Forms.TestUtil/Ringtoets.Common.Forms.TestUtil.csproj
===================================================================
diff -u -r3fa158d7e6052014732df99d2a8e0fcad6bd1d18 -r2fac008f9a91a37ac4300ec2e0cdf2b4e5eeea1b
--- Ringtoets/Common/test/Ringtoets.Common.Forms.TestUtil/Ringtoets.Common.Forms.TestUtil.csproj (.../Ringtoets.Common.Forms.TestUtil.csproj) (revision 3fa158d7e6052014732df99d2a8e0fcad6bd1d18)
+++ Ringtoets/Common/test/Ringtoets.Common.Forms.TestUtil/Ringtoets.Common.Forms.TestUtil.csproj (.../Ringtoets.Common.Forms.TestUtil.csproj) (revision 2fac008f9a91a37ac4300ec2e0cdf2b4e5eeea1b)
@@ -42,6 +42,10 @@
..\..\..\..\packages\NUnit.3.7.1\lib\net40\nunit.framework.dll
True
+
+ ..\..\..\..\packages\RhinoMocks.3.6.1\lib\net\Rhino.Mocks.dll
+ True
+
Index: Ringtoets/Common/test/Ringtoets.Common.Forms.TestUtil/packages.config
===================================================================
diff -u -r7b7bd75dc1c1327386c9be96b5d480565bb8ecd6 -r2fac008f9a91a37ac4300ec2e0cdf2b4e5eeea1b
--- Ringtoets/Common/test/Ringtoets.Common.Forms.TestUtil/packages.config (.../packages.config) (revision 7b7bd75dc1c1327386c9be96b5d480565bb8ecd6)
+++ Ringtoets/Common/test/Ringtoets.Common.Forms.TestUtil/packages.config (.../packages.config) (revision 2fac008f9a91a37ac4300ec2e0cdf2b4e5eeea1b)
@@ -23,4 +23,5 @@
-->
+
\ No newline at end of file
Index: Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/Views/GrassCoverErosionOutwardsDesignWaterLevelLocationsViewTest.cs
===================================================================
diff -u -r8e6506f609db1f94bfce07a20629b5781184be73 -r2fac008f9a91a37ac4300ec2e0cdf2b4e5eeea1b
--- Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/Views/GrassCoverErosionOutwardsDesignWaterLevelLocationsViewTest.cs (.../GrassCoverErosionOutwardsDesignWaterLevelLocationsViewTest.cs) (revision 8e6506f609db1f94bfce07a20629b5781184be73)
+++ Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/Views/GrassCoverErosionOutwardsDesignWaterLevelLocationsViewTest.cs (.../GrassCoverErosionOutwardsDesignWaterLevelLocationsViewTest.cs) (revision 2fac008f9a91a37ac4300ec2e0cdf2b4e5eeea1b)
@@ -50,7 +50,7 @@
namespace Ringtoets.GrassCoverErosionOutwards.Forms.Test.Views
{
[TestFixture]
- public class GrassCoverErosionOutwardsDesignWaterLevelLocationsViewTest
+ public class GrassCoverErosionOutwardsDesignWaterLevelLocationsViewTest : LocationsViewDataSynchronizationTester
{
private const int locationCalculateColumnIndex = 0;
private const int includeIllustrationPointsColumnIndex = 1;
@@ -59,23 +59,6 @@
private const int locationColumnIndex = 4;
private const int locationDesignWaterlevelColumnIndex = 5;
- private Form testForm;
- private MockRepository mockRepository;
-
- [SetUp]
- public void Setup()
- {
- testForm = new Form();
- mockRepository = new MockRepository();
- }
-
- [TearDown]
- public void TearDown()
- {
- testForm.Dispose();
- mockRepository.VerifyAll();
- }
-
[Test]
public void DefaultConstructor_DefaultValues()
{
@@ -419,65 +402,6 @@
Assert.AreEqual(expectedErrorMessage, errorProvider.GetError(button));
}
- [TestFixture]
- public class SynchronizationTester : LocationsViewDataSynchronizationTester
- {
- protected override int OutputColumnIndex
- {
- get
- {
- return locationDesignWaterlevelColumnIndex;
- }
- }
-
- protected override object GetLocationSelection(LocationsView view, object selectedRowObject)
- {
- return new GrassCoverErosionOutwardsDesignWaterLevelLocationContext((ObservableList) view.Data,
- ((HydraulicBoundaryLocationRow) selectedRowObject).CalculatableObject);
- }
-
- protected override LocationsView ShowFullyConfiguredLocationsView(Form form)
- {
- return ShowFullyConfiguredDesignWaterLevelLocationsView(new ObservableTestAssessmentSectionStub(), form);
- }
-
- protected override void ReplaceHydraulicBoundaryDatabaseAndNotifyObservers(LocationsView view)
- {
- var locations = (ObservableList) view.Data;
- var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(10, "10", 10.0, 10.0)
- {
- DesignWaterLevelCalculation =
- {
- InputParameters =
- {
- ShouldIllustrationPointsBeCalculated = true
- },
- Output = new TestHydraulicBoundaryLocationOutput(10.23)
- }
- };
-
- locations.Clear();
- locations.Add(hydraulicBoundaryLocation);
- locations.NotifyObservers();
- }
-
- protected override void ClearLocationOutputAndNotifyObservers(LocationsView view)
- {
- var locations = (ObservableList) view.Data;
-
- locations.ForEach(loc => loc.DesignWaterLevelCalculation.Output = null);
- locations.NotifyObservers();
- }
-
- protected override void AddLocationOutputAndNotifyObservers(LocationsView view)
- {
- var locations = (ObservableList) view.Data;
-
- locations.First().DesignWaterLevelCalculation.Output = new TestHydraulicBoundaryLocationOutput(new TestGeneralResultSubMechanismIllustrationPoint());
- locations.NotifyObservers();
- }
- }
-
private static IEnumerable CreateControlItems(
GeneralResult generalResult)
{
@@ -577,5 +501,64 @@
return view;
}
+
+ #region LocationsViewDataSynchronizationTester implementation
+
+ protected override int OutputColumnIndex
+ {
+ get
+ {
+ return locationDesignWaterlevelColumnIndex;
+ }
+ }
+
+ protected override object GetLocationSelection(LocationsView view, object selectedRowObject)
+ {
+ return new GrassCoverErosionOutwardsDesignWaterLevelLocationContext((ObservableList) view.Data,
+ ((HydraulicBoundaryLocationRow) selectedRowObject).CalculatableObject);
+ }
+
+ protected override LocationsView ShowFullyConfiguredLocationsView(Form form)
+ {
+ return ShowFullyConfiguredDesignWaterLevelLocationsView(new ObservableTestAssessmentSectionStub(), form);
+ }
+
+ protected override void ReplaceHydraulicBoundaryDatabaseAndNotifyObservers(LocationsView view)
+ {
+ var locations = (ObservableList) view.Data;
+ var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(10, "10", 10.0, 10.0)
+ {
+ DesignWaterLevelCalculation =
+ {
+ InputParameters =
+ {
+ ShouldIllustrationPointsBeCalculated = true
+ },
+ Output = new TestHydraulicBoundaryLocationOutput(10.23)
+ }
+ };
+
+ locations.Clear();
+ locations.Add(hydraulicBoundaryLocation);
+ locations.NotifyObservers();
+ }
+
+ protected override void ClearLocationOutputAndNotifyObservers(LocationsView view)
+ {
+ var locations = (ObservableList) view.Data;
+
+ locations.ForEach(loc => loc.DesignWaterLevelCalculation.Output = null);
+ locations.NotifyObservers();
+ }
+
+ protected override void AddLocationOutputAndNotifyObservers(LocationsView view)
+ {
+ var locations = (ObservableList) view.Data;
+
+ locations.First().DesignWaterLevelCalculation.Output = new TestHydraulicBoundaryLocationOutput(new TestGeneralResultSubMechanismIllustrationPoint());
+ locations.NotifyObservers();
+ }
+
+ #endregion
}
}
\ No newline at end of file
Index: Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/Views/GrassCoverErosionOutwardsWaveHeightLocationsViewTest.cs
===================================================================
diff -u -r8e6506f609db1f94bfce07a20629b5781184be73 -r2fac008f9a91a37ac4300ec2e0cdf2b4e5eeea1b
--- Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/Views/GrassCoverErosionOutwardsWaveHeightLocationsViewTest.cs (.../GrassCoverErosionOutwardsWaveHeightLocationsViewTest.cs) (revision 8e6506f609db1f94bfce07a20629b5781184be73)
+++ Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/Views/GrassCoverErosionOutwardsWaveHeightLocationsViewTest.cs (.../GrassCoverErosionOutwardsWaveHeightLocationsViewTest.cs) (revision 2fac008f9a91a37ac4300ec2e0cdf2b4e5eeea1b)
@@ -50,7 +50,7 @@
namespace Ringtoets.GrassCoverErosionOutwards.Forms.Test.Views
{
[TestFixture]
- public class GrassCoverErosionOutwardsWaveHeightLocationsViewTest
+ public class GrassCoverErosionOutwardsWaveHeightLocationsViewTest : LocationsViewDataSynchronizationTester
{
private const int locationCalculateColumnIndex = 0;
private const int includeIllustrationPointsColumnIndex = 1;
@@ -59,23 +59,6 @@
private const int locationColumnIndex = 4;
private const int locationWaveHeightColumnIndex = 5;
- private Form testForm;
- private MockRepository mockRepository;
-
- [SetUp]
- public void Setup()
- {
- testForm = new Form();
- mockRepository = new MockRepository();
- }
-
- [TearDown]
- public void TearDown()
- {
- testForm.Dispose();
- mockRepository.VerifyAll();
- }
-
[Test]
public void DefaultConstructor_DefaultValues()
{
@@ -418,65 +401,6 @@
Assert.AreEqual(expectedErrorMessage, errorProvider.GetError(button));
}
- [TestFixture]
- public class SynchronizationTester : LocationsViewDataSynchronizationTester
- {
- protected override int OutputColumnIndex
- {
- get
- {
- return locationWaveHeightColumnIndex;
- }
- }
-
- protected override object GetLocationSelection(LocationsView view, object selectedRowObject)
- {
- return new GrassCoverErosionOutwardsWaveHeightLocationContext((ObservableList) view.Data,
- ((HydraulicBoundaryLocationRow) selectedRowObject).CalculatableObject);
- }
-
- protected override LocationsView ShowFullyConfiguredLocationsView(Form form)
- {
- return ShowFullyConfiguredWaveHeightLocationsView(new ObservableTestAssessmentSectionStub(), form);
- }
-
- protected override void ReplaceHydraulicBoundaryDatabaseAndNotifyObservers(LocationsView view)
- {
- var locations = (ObservableList) view.Data;
- var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(10, "10", 10.0, 10.0)
- {
- WaveHeightCalculation =
- {
- InputParameters =
- {
- ShouldIllustrationPointsBeCalculated = true
- },
- Output = new TestHydraulicBoundaryLocationOutput(10.23)
- }
- };
-
- locations.Clear();
- locations.Add(hydraulicBoundaryLocation);
- locations.NotifyObservers();
- }
-
- protected override void ClearLocationOutputAndNotifyObservers(LocationsView view)
- {
- var locations = (ObservableList) view.Data;
-
- locations.ForEach(loc => loc.WaveHeightCalculation.Output = null);
- locations.NotifyObservers();
- }
-
- protected override void AddLocationOutputAndNotifyObservers(LocationsView view)
- {
- var locations = (ObservableList) view.Data;
-
- locations.First().WaveHeightCalculation.Output = new TestHydraulicBoundaryLocationOutput(new TestGeneralResultSubMechanismIllustrationPoint());
- locations.NotifyObservers();
- }
- }
-
private static IEnumerable CreateControlItems(
GeneralResult generalResult)
{
@@ -576,5 +500,64 @@
return view;
}
+
+ #region LocationsViewDataSynchronizationTester implementation
+
+ protected override int OutputColumnIndex
+ {
+ get
+ {
+ return locationWaveHeightColumnIndex;
+ }
+ }
+
+ protected override object GetLocationSelection(LocationsView view, object selectedRowObject)
+ {
+ return new GrassCoverErosionOutwardsWaveHeightLocationContext((ObservableList) view.Data,
+ ((HydraulicBoundaryLocationRow) selectedRowObject).CalculatableObject);
+ }
+
+ protected override LocationsView ShowFullyConfiguredLocationsView(Form form)
+ {
+ return ShowFullyConfiguredWaveHeightLocationsView(new ObservableTestAssessmentSectionStub(), form);
+ }
+
+ protected override void ReplaceHydraulicBoundaryDatabaseAndNotifyObservers(LocationsView view)
+ {
+ var locations = (ObservableList) view.Data;
+ var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(10, "10", 10.0, 10.0)
+ {
+ WaveHeightCalculation =
+ {
+ InputParameters =
+ {
+ ShouldIllustrationPointsBeCalculated = true
+ },
+ Output = new TestHydraulicBoundaryLocationOutput(10.23)
+ }
+ };
+
+ locations.Clear();
+ locations.Add(hydraulicBoundaryLocation);
+ locations.NotifyObservers();
+ }
+
+ protected override void ClearLocationOutputAndNotifyObservers(LocationsView view)
+ {
+ var locations = (ObservableList) view.Data;
+
+ locations.ForEach(loc => loc.WaveHeightCalculation.Output = null);
+ locations.NotifyObservers();
+ }
+
+ protected override void AddLocationOutputAndNotifyObservers(LocationsView view)
+ {
+ var locations = (ObservableList) view.Data;
+
+ locations.First().WaveHeightCalculation.Output = new TestHydraulicBoundaryLocationOutput(new TestGeneralResultSubMechanismIllustrationPoint());
+ locations.NotifyObservers();
+ }
+
+ #endregion
}
}
\ No newline at end of file
Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/DesignWaterLevelLocationsViewTest.cs
===================================================================
diff -u -r8e6506f609db1f94bfce07a20629b5781184be73 -r2fac008f9a91a37ac4300ec2e0cdf2b4e5eeea1b
--- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/DesignWaterLevelLocationsViewTest.cs (.../DesignWaterLevelLocationsViewTest.cs) (revision 8e6506f609db1f94bfce07a20629b5781184be73)
+++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/DesignWaterLevelLocationsViewTest.cs (.../DesignWaterLevelLocationsViewTest.cs) (revision 2fac008f9a91a37ac4300ec2e0cdf2b4e5eeea1b)
@@ -45,28 +45,15 @@
namespace Ringtoets.Integration.Forms.Test.Views
{
[TestFixture]
- public class DesignWaterLevelLocationsViewTest
+ public class DesignWaterLevelLocationsViewTest : LocationsViewDataSynchronizationTester
{
private const int locationCalculateColumnIndex = 0;
private const int includeIllustrationPointsColumnIndex = 1;
private const int locationNameColumnIndex = 2;
private const int locationIdColumnIndex = 3;
private const int locationColumnIndex = 4;
private const int locationDesignWaterlevelColumnIndex = 5;
- private Form testForm;
- [SetUp]
- public void Setup()
- {
- testForm = new Form();
- }
-
- [TearDown]
- public void TearDown()
- {
- testForm.Dispose();
- }
-
[Test]
public void Constructor_ExpectedValues()
{
@@ -253,7 +240,6 @@
DataGridViewRowCollection rows = dataGridViewControl.Rows;
rows[0].Cells[locationCalculateColumnIndex].Value = true;
- var mockRepository = new MockRepository();
var guiService = mockRepository.StrictMock();
var observer = mockRepository.StrictMock();
@@ -286,8 +272,6 @@
Assert.AreEqual(1, hydraulicBoundaryLocations.Length);
HydraulicBoundaryLocation expectedLocation = assessmentSection.HydraulicBoundaryDatabase.Locations.First();
Assert.AreEqual(expectedLocation, hydraulicBoundaryLocations.First());
-
- mockRepository.VerifyAll();
}
[Test]
@@ -324,73 +308,6 @@
return ControlTestHelper.GetControls(testForm, "IllustrationPointsControl").First();
}
- [TestFixture]
- public class SynchronizationTester : LocationsViewDataSynchronizationTester
- {
- protected override int OutputColumnIndex
- {
- get
- {
- return locationDesignWaterlevelColumnIndex;
- }
- }
-
- protected override object GetLocationSelection(LocationsView view, object selectedRowObject)
- {
- IAssessmentSection assessmentSection = view.AssessmentSection;
-
- return new DesignWaterLevelLocationContext(assessmentSection.HydraulicBoundaryDatabase,
- ((HydraulicBoundaryLocationRow) selectedRowObject).CalculatableObject);
- }
-
- protected override LocationsView ShowFullyConfiguredLocationsView(Form form)
- {
- return ShowFullyConfiguredDesignWaterLevelLocationsView(form);
- }
-
- protected override void ReplaceHydraulicBoundaryDatabaseAndNotifyObservers(LocationsView view)
- {
- IAssessmentSection assessmentSection = view.AssessmentSection;
- var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(10, "10", 10.0, 10.0)
- {
- WaveHeightCalculation =
- {
- InputParameters =
- {
- ShouldIllustrationPointsBeCalculated = true
- },
- Output = new TestHydraulicBoundaryLocationOutput(10.23)
- }
- };
-
- assessmentSection.HydraulicBoundaryDatabase = new HydraulicBoundaryDatabase
- {
- Locations =
- {
- hydraulicBoundaryLocation
- }
- };
-
- assessmentSection.NotifyObservers();
- }
-
- protected override void ClearLocationOutputAndNotifyObservers(LocationsView view)
- {
- IAssessmentSection assessmentSection = view.AssessmentSection;
-
- assessmentSection.HydraulicBoundaryDatabase.Locations.ForEach(loc => loc.DesignWaterLevelCalculation.Output = null);
- assessmentSection.NotifyObservers();
- }
-
- protected override void AddLocationOutputAndNotifyObservers(LocationsView view)
- {
- IAssessmentSection assessmentSection = view.AssessmentSection;
-
- assessmentSection.HydraulicBoundaryDatabase.Locations.First().DesignWaterLevelCalculation.Output = new TestHydraulicBoundaryLocationOutput(new TestGeneralResultSubMechanismIllustrationPoint());
- assessmentSection.NotifyObservers();
- }
- }
-
private static IEnumerable CreateControlItems(
GeneralResult generalResult)
{
@@ -485,5 +402,72 @@
});
}
}
+
+ #region LocationsViewDataSynchronizationTester implementation
+
+ protected override int OutputColumnIndex
+ {
+ get
+ {
+ return locationDesignWaterlevelColumnIndex;
+ }
+ }
+
+ protected override object GetLocationSelection(LocationsView view, object selectedRowObject)
+ {
+ IAssessmentSection assessmentSection = view.AssessmentSection;
+
+ return new DesignWaterLevelLocationContext(assessmentSection.HydraulicBoundaryDatabase,
+ ((HydraulicBoundaryLocationRow) selectedRowObject).CalculatableObject);
+ }
+
+ protected override LocationsView ShowFullyConfiguredLocationsView(Form form)
+ {
+ return ShowFullyConfiguredDesignWaterLevelLocationsView(form);
+ }
+
+ protected override void ReplaceHydraulicBoundaryDatabaseAndNotifyObservers(LocationsView view)
+ {
+ IAssessmentSection assessmentSection = view.AssessmentSection;
+ var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(10, "10", 10.0, 10.0)
+ {
+ WaveHeightCalculation =
+ {
+ InputParameters =
+ {
+ ShouldIllustrationPointsBeCalculated = true
+ },
+ Output = new TestHydraulicBoundaryLocationOutput(10.23)
+ }
+ };
+
+ assessmentSection.HydraulicBoundaryDatabase = new HydraulicBoundaryDatabase
+ {
+ Locations =
+ {
+ hydraulicBoundaryLocation
+ }
+ };
+
+ assessmentSection.NotifyObservers();
+ }
+
+ protected override void ClearLocationOutputAndNotifyObservers(LocationsView view)
+ {
+ IAssessmentSection assessmentSection = view.AssessmentSection;
+
+ assessmentSection.HydraulicBoundaryDatabase.Locations.ForEach(loc => loc.DesignWaterLevelCalculation.Output = null);
+ assessmentSection.NotifyObservers();
+ }
+
+ protected override void AddLocationOutputAndNotifyObservers(LocationsView view)
+ {
+ IAssessmentSection assessmentSection = view.AssessmentSection;
+
+ assessmentSection.HydraulicBoundaryDatabase.Locations.First().DesignWaterLevelCalculation.Output = new TestHydraulicBoundaryLocationOutput(new TestGeneralResultSubMechanismIllustrationPoint());
+ assessmentSection.NotifyObservers();
+ }
+
+ #endregion
}
}
\ No newline at end of file
Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/WaveHeightLocationsViewTest.cs
===================================================================
diff -u -r8e6506f609db1f94bfce07a20629b5781184be73 -r2fac008f9a91a37ac4300ec2e0cdf2b4e5eeea1b
--- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/WaveHeightLocationsViewTest.cs (.../WaveHeightLocationsViewTest.cs) (revision 8e6506f609db1f94bfce07a20629b5781184be73)
+++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/WaveHeightLocationsViewTest.cs (.../WaveHeightLocationsViewTest.cs) (revision 2fac008f9a91a37ac4300ec2e0cdf2b4e5eeea1b)
@@ -43,28 +43,15 @@
namespace Ringtoets.Integration.Forms.Test.Views
{
[TestFixture]
- public class WaveHeightLocationsViewTest
+ public class WaveHeightLocationsViewTest : LocationsViewDataSynchronizationTester
{
private const int locationCalculateColumnIndex = 0;
private const int includeIllustrationPointsColumnIndex = 1;
private const int locationNameColumnIndex = 2;
private const int locationIdColumnIndex = 3;
private const int locationColumnIndex = 4;
private const int locationWaveHeightColumnIndex = 5;
- private Form testForm;
- [SetUp]
- public void Setup()
- {
- testForm = new Form();
- }
-
- [TearDown]
- public void TearDown()
- {
- testForm.Dispose();
- }
-
[Test]
public void Constructor_ExpectedValues()
{
@@ -251,7 +238,6 @@
DataGridViewRowCollection rows = dataGridViewControl.Rows;
rows[0].Cells[locationCalculateColumnIndex].Value = true;
- var mockRepository = new MockRepository();
var guiService = mockRepository.StrictMock();
var observer = mockRepository.StrictMock();
@@ -278,7 +264,6 @@
Assert.AreEqual(1, hydraulicBoundaryLocations.Length);
HydraulicBoundaryLocation expectedLocation = assessmentSection.HydraulicBoundaryDatabase.Locations.First();
Assert.AreEqual(expectedLocation, hydraulicBoundaryLocations.First());
- mockRepository.VerifyAll();
}
[Test]
@@ -315,73 +300,6 @@
return ControlTestHelper.GetControls(testForm, "IllustrationPointsControl").First();
}
- [TestFixture]
- public class SynchronizationTester : LocationsViewDataSynchronizationTester
- {
- protected override int OutputColumnIndex
- {
- get
- {
- return locationWaveHeightColumnIndex;
- }
- }
-
- protected override object GetLocationSelection(LocationsView view, object selectedRowObject)
- {
- IAssessmentSection assessmentSection = view.AssessmentSection;
-
- return new WaveHeightLocationContext(assessmentSection.HydraulicBoundaryDatabase,
- ((HydraulicBoundaryLocationRow) selectedRowObject).CalculatableObject);
- }
-
- protected override LocationsView ShowFullyConfiguredLocationsView(Form form)
- {
- return ShowFullyConfiguredWaveHeightLocationsView(form);
- }
-
- protected override void ReplaceHydraulicBoundaryDatabaseAndNotifyObservers(LocationsView view)
- {
- IAssessmentSection assessmentSection = view.AssessmentSection;
- var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(10, "10", 10.0, 10.0)
- {
- WaveHeightCalculation =
- {
- InputParameters =
- {
- ShouldIllustrationPointsBeCalculated = true
- },
- Output = new TestHydraulicBoundaryLocationOutput(10.23)
- }
- };
-
- assessmentSection.HydraulicBoundaryDatabase = new HydraulicBoundaryDatabase
- {
- Locations =
- {
- hydraulicBoundaryLocation
- }
- };
-
- assessmentSection.NotifyObservers();
- }
-
- protected override void ClearLocationOutputAndNotifyObservers(LocationsView view)
- {
- IAssessmentSection assessmentSection = view.AssessmentSection;
-
- assessmentSection.HydraulicBoundaryDatabase.Locations.ForEach(loc => loc.WaveHeightCalculation.Output = null);
- assessmentSection.NotifyObservers();
- }
-
- protected override void AddLocationOutputAndNotifyObservers(LocationsView view)
- {
- IAssessmentSection assessmentSection = view.AssessmentSection;
-
- assessmentSection.HydraulicBoundaryDatabase.Locations.First().WaveHeightCalculation.Output = new TestHydraulicBoundaryLocationOutput(new TestGeneralResultSubMechanismIllustrationPoint());
- assessmentSection.NotifyObservers();
- }
- }
-
private static IEnumerable CreateControlItems(
GeneralResult generalResult)
{
@@ -476,5 +394,72 @@
});
}
}
+
+ #region LocationsViewDataSynchronizationTester implementation
+
+ protected override int OutputColumnIndex
+ {
+ get
+ {
+ return locationWaveHeightColumnIndex;
+ }
+ }
+
+ protected override object GetLocationSelection(LocationsView view, object selectedRowObject)
+ {
+ IAssessmentSection assessmentSection = view.AssessmentSection;
+
+ return new WaveHeightLocationContext(assessmentSection.HydraulicBoundaryDatabase,
+ ((HydraulicBoundaryLocationRow) selectedRowObject).CalculatableObject);
+ }
+
+ protected override LocationsView ShowFullyConfiguredLocationsView(Form form)
+ {
+ return ShowFullyConfiguredWaveHeightLocationsView(form);
+ }
+
+ protected override void ReplaceHydraulicBoundaryDatabaseAndNotifyObservers(LocationsView view)
+ {
+ IAssessmentSection assessmentSection = view.AssessmentSection;
+ var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(10, "10", 10.0, 10.0)
+ {
+ WaveHeightCalculation =
+ {
+ InputParameters =
+ {
+ ShouldIllustrationPointsBeCalculated = true
+ },
+ Output = new TestHydraulicBoundaryLocationOutput(10.23)
+ }
+ };
+
+ assessmentSection.HydraulicBoundaryDatabase = new HydraulicBoundaryDatabase
+ {
+ Locations =
+ {
+ hydraulicBoundaryLocation
+ }
+ };
+
+ assessmentSection.NotifyObservers();
+ }
+
+ protected override void ClearLocationOutputAndNotifyObservers(LocationsView view)
+ {
+ IAssessmentSection assessmentSection = view.AssessmentSection;
+
+ assessmentSection.HydraulicBoundaryDatabase.Locations.ForEach(loc => loc.WaveHeightCalculation.Output = null);
+ assessmentSection.NotifyObservers();
+ }
+
+ protected override void AddLocationOutputAndNotifyObservers(LocationsView view)
+ {
+ IAssessmentSection assessmentSection = view.AssessmentSection;
+
+ assessmentSection.HydraulicBoundaryDatabase.Locations.First().WaveHeightCalculation.Output = new TestHydraulicBoundaryLocationOutput(new TestGeneralResultSubMechanismIllustrationPoint());
+ assessmentSection.NotifyObservers();
+ }
+
+ #endregion
}
}
\ No newline at end of file