Index: Ringtoets/Common/src/Ringtoets.Common.Forms/Ringtoets.Common.Forms.csproj =================================================================== diff -u -re8ddc7a63f03cb28eeb3974363d6edb4ba51c896 -r8cf808db7be49f9a3c28ae9f9d5dbf283d26c284 --- Ringtoets/Common/src/Ringtoets.Common.Forms/Ringtoets.Common.Forms.csproj (.../Ringtoets.Common.Forms.csproj) (revision e8ddc7a63f03cb28eeb3974363d6edb4ba51c896) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/Ringtoets.Common.Forms.csproj (.../Ringtoets.Common.Forms.csproj) (revision 8cf808db7be49f9a3c28ae9f9d5dbf283d26c284) @@ -161,11 +161,11 @@ IllustrationPointsTableControl.cs - + UserControl - - LocationsView.cs + + CalculationsView.cs UserControl @@ -242,8 +242,8 @@ IllustrationPointsTableControl.cs - - LocationsView.cs + + CalculationsView.cs FailureMechanismView.cs Index: Ringtoets/Common/src/Ringtoets.Common.Forms/Views/CalculationsView.Designer.cs =================================================================== diff -u --- Ringtoets/Common/src/Ringtoets.Common.Forms/Views/CalculationsView.Designer.cs (revision 0) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/Views/CalculationsView.Designer.cs (revision 8cf808db7be49f9a3c28ae9f9d5dbf283d26c284) @@ -0,0 +1,188 @@ +// 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.Windows.Forms; + +namespace Ringtoets.Common.Forms.Views +{ + partial class CalculationsView + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + this.dataGridViewControl = new Core.Common.Controls.DataGrid.DataGridViewControl(); + this.CalculateForSelectedButton = new System.Windows.Forms.Button(); + this.DeselectAllButton = new System.Windows.Forms.Button(); + this.SelectAllButton = new System.Windows.Forms.Button(); + this.ButtonGroupBox = new System.Windows.Forms.GroupBox(); + this.CalculateForSelectedButtonErrorProvider = new System.Windows.Forms.ErrorProvider(this.components); + this.splitContainer = new System.Windows.Forms.SplitContainer(); + this.illustrationPointsControl = new Ringtoets.Common.Forms.Views.IllustrationPointsControl(); + this.ButtonGroupBox.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.CalculateForSelectedButtonErrorProvider)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).BeginInit(); + this.splitContainer.Panel1.SuspendLayout(); + this.splitContainer.Panel2.SuspendLayout(); + this.splitContainer.SuspendLayout(); + this.SuspendLayout(); + // + // dataGridViewControl + // + this.dataGridViewControl.Dock = System.Windows.Forms.DockStyle.Fill; + this.dataGridViewControl.Location = new System.Drawing.Point(0, 0); + this.dataGridViewControl.MultiSelect = true; + this.dataGridViewControl.Name = "dataGridViewControl"; + this.dataGridViewControl.Padding = new System.Windows.Forms.Padding(0, 0, 0, 5); + this.dataGridViewControl.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.RowHeaderSelect; + this.dataGridViewControl.Size = new System.Drawing.Size(443, 480); + this.dataGridViewControl.TabIndex = 0; + // + // CalculateForSelectedButton + // + this.CalculateForSelectedButton.Enabled = false; + this.CalculateForSelectedButtonErrorProvider.SetIconPadding(this.CalculateForSelectedButton, 2); + this.CalculateForSelectedButton.Location = new System.Drawing.Point(227, 29); + this.CalculateForSelectedButton.Name = "CalculateForSelectedButton"; + this.CalculateForSelectedButton.Size = new System.Drawing.Size(207, 23); + this.CalculateForSelectedButton.TabIndex = 2; + this.CalculateForSelectedButton.UseVisualStyleBackColor = true; + this.CalculateForSelectedButton.Click += new System.EventHandler(this.CalculateForSelectedButton_Click); + // + // DeselectAllButton + // + this.DeselectAllButton.Location = new System.Drawing.Point(110, 29); + this.DeselectAllButton.Name = "DeselectAllButton"; + this.DeselectAllButton.Size = new System.Drawing.Size(111, 23); + this.DeselectAllButton.TabIndex = 1; + this.DeselectAllButton.UseVisualStyleBackColor = true; + this.DeselectAllButton.Click += new System.EventHandler(this.DeselectAllButton_Click); + // + // SelectAllButton + // + this.SelectAllButton.Location = new System.Drawing.Point(6, 29); + this.SelectAllButton.Name = "SelectAllButton"; + this.SelectAllButton.Size = new System.Drawing.Size(98, 23); + this.SelectAllButton.TabIndex = 0; + this.SelectAllButton.UseVisualStyleBackColor = true; + this.SelectAllButton.Click += new System.EventHandler(this.SelectAllButton_Click); + // + // ButtonGroupBox + // + this.ButtonGroupBox.Controls.Add(this.CalculateForSelectedButton); + this.ButtonGroupBox.Controls.Add(this.DeselectAllButton); + this.ButtonGroupBox.Controls.Add(this.SelectAllButton); + this.ButtonGroupBox.Dock = System.Windows.Forms.DockStyle.Bottom; + this.ButtonGroupBox.Location = new System.Drawing.Point(0, 480); + this.ButtonGroupBox.MinimumSize = new System.Drawing.Size(445, 61); + this.ButtonGroupBox.Name = "ButtonGroupBox"; + this.ButtonGroupBox.Size = new System.Drawing.Size(445, 61); + this.ButtonGroupBox.TabIndex = 3; + this.ButtonGroupBox.TabStop = false; + // + // CalculateForSelectedButtonErrorProvider + // + this.CalculateForSelectedButtonErrorProvider.BlinkStyle = System.Windows.Forms.ErrorBlinkStyle.NeverBlink; + this.CalculateForSelectedButtonErrorProvider.ContainerControl = this; + this.CalculateForSelectedButtonErrorProvider.Icon = global::Ringtoets.Common.Forms.Properties.Resources.warning; + // + // splitContainer + // + this.splitContainer.BorderStyle = System.Windows.Forms.BorderStyle.None; + this.splitContainer.Dock = System.Windows.Forms.DockStyle.Fill; + this.splitContainer.Location = new System.Drawing.Point(0, 0); + this.splitContainer.Name = "splitContainer"; + this.splitContainer.Size = new System.Drawing.Size(822, 543); + this.splitContainer.SplitterDistance = 445; + this.splitContainer.TabIndex = 1; + // + // splitContainer.Panel1 + // + this.splitContainer.Panel1.AutoScroll = true; + this.splitContainer.Panel1.AutoScrollMinSize = new System.Drawing.Size(535, 0); + this.splitContainer.Panel1.Controls.Add(this.dataGridViewControl); + this.splitContainer.Panel1.Controls.Add(this.ButtonGroupBox); + // + // splitContainer.Panel2 + // + this.splitContainer.Panel2.Controls.Add(this.illustrationPointsControl); + // + // illustrationPointsControl + // + this.illustrationPointsControl.Data = null; + this.illustrationPointsControl.Dock = System.Windows.Forms.DockStyle.Fill; + this.illustrationPointsControl.Location = new System.Drawing.Point(0, 0); + this.illustrationPointsControl.Name = "illustrationPointsControl"; + this.illustrationPointsControl.Size = new System.Drawing.Size(440, 524); + this.illustrationPointsControl.TabIndex = 0; + // + // CalculationsView + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.splitContainer); + this.Name = "CalculationsView"; + this.Size = new System.Drawing.Size(822, 543); + this.ButtonGroupBox.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.CalculateForSelectedButtonErrorProvider)).EndInit(); + this.splitContainer.Panel1.ResumeLayout(false); + this.splitContainer.Panel2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).EndInit(); + this.splitContainer.ResumeLayout(false); + this.ResumeLayout(false); + + } + + #endregion + + protected Core.Common.Controls.DataGrid.DataGridViewControl dataGridViewControl; + private System.Windows.Forms.Button CalculateForSelectedButton; + private System.Windows.Forms.Button DeselectAllButton; + private System.Windows.Forms.Button SelectAllButton; + protected System.Windows.Forms.GroupBox ButtonGroupBox; + private System.Windows.Forms.ErrorProvider CalculateForSelectedButtonErrorProvider; + private System.Windows.Forms.SplitContainer splitContainer; + private IllustrationPointsControl illustrationPointsControl; + } +} \ No newline at end of file Index: Ringtoets/Common/src/Ringtoets.Common.Forms/Views/CalculationsView.cs =================================================================== diff -u --- Ringtoets/Common/src/Ringtoets.Common.Forms/Views/CalculationsView.cs (revision 0) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/Views/CalculationsView.cs (revision 8cf808db7be49f9a3c28ae9f9d5dbf283d26c284) @@ -0,0 +1,293 @@ +// 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 System.Collections.Generic; +using System.Linq; +using System.Windows.Forms; +using Core.Common.Controls.Views; +using Core.Common.Util.Extensions; +using Ringtoets.Common.Data.AssessmentSection; +using Ringtoets.Common.Data.IllustrationPoints; +using Ringtoets.Common.Forms.PresentationObjects; +using Ringtoets.Common.Forms.Properties; + +namespace Ringtoets.Common.Forms.Views +{ + /// + /// Base view for selecting and performing hydraulic boundary location calculations. + /// + /// The type of the calculation objects. + public abstract partial class CalculationsView : UserControl, ISelectionProvider, IView where T : class + { + private const int calculateColumnIndex = 0; + private bool suspendAllEvents; + private bool suspendIllustrationPointsControlSelectionChanges; + public event EventHandler SelectionChanged; + + /// + /// Creates a new instance of . + /// + protected CalculationsView() + { + InitializeComponent(); + LocalizeControls(); + InitializeEventHandlers(); + } + + /// + /// Gets or sets the . + /// + public IAssessmentSection AssessmentSection { get; protected set; } + + public object Selection { get; private set; } + + public abstract object Data { get; set; } + + protected override void OnLoad(EventArgs e) + { + base.OnLoad(e); + InitializeDataGridView(); + } + + /// + /// Updates the data source of the data table based on the . + /// + protected void UpdateDataGridViewDataSource() + { + suspendAllEvents = true; + SetDataSource(); + illustrationPointsControl.Data = GetIllustrationPointControlItems(); + suspendAllEvents = false; + + UpdateCalculateForSelectedButton(); + ProvideCalculationSelection(); + } + + /// + /// Initializes the . + /// + protected virtual void InitializeDataGridView() + { + dataGridViewControl.AddCheckBoxColumn(nameof(CalculatableRow.ShouldCalculate), + Resources.CalculatableView_Calculate); + } + + /// + /// Creates a new object that is used as the object for from + /// the currently selected row in the data table. + /// + /// The newly created object. + protected abstract object CreateSelectedItemFromCurrentRow(); + + /// + /// Sets the data source on the . + /// + protected abstract void SetDataSource(); + + /// + /// Handles the calculation routine for the currently selected rows. + /// + protected abstract void CalculateForSelectedRows(); + + /// + /// Gets all the row items from the . + /// + protected IEnumerable> GetCalculatableRows() + { + return dataGridViewControl.Rows + .Cast() + .Select(row => (CalculatableRow) row.DataBoundItem); + } + + /// + /// Gets all the selected calculatable objects. + /// + protected IEnumerable GetSelectedCalculatableObjects() + { + return GetCalculatableRows().Where(r => r.ShouldCalculate) + .Select(r => r.CalculatableObject); + } + + /// + /// Validates the calculatable objects. + /// + /// A validation message in case no calculations can be performed, null otherwise. + protected virtual string ValidateCalculatableObjects() + { + if (!GetCalculatableRows().Any(r => r.ShouldCalculate)) + { + return Resources.CalculatableViews_No_calculations_selected; + } + + return null; + } + + /// + /// Updates the state of the calculation button and the corresponding error provider. + /// + protected void UpdateCalculateForSelectedButton() + { + string validationText = ValidateCalculatableObjects(); + if (!string.IsNullOrEmpty(validationText)) + { + CalculateForSelectedButton.Enabled = false; + CalculateForSelectedButtonErrorProvider.SetError(CalculateForSelectedButton, validationText); + } + else + { + CalculateForSelectedButton.Enabled = true; + CalculateForSelectedButtonErrorProvider.SetError(CalculateForSelectedButton, ""); + } + } + + /// + /// Handles the update of a hydraulic boundary location calculation by refreshing the data grid view + /// and updating the data of the illustration points control. + /// + protected void HandleHydraulicBoundaryLocationCalculationUpdate() + { + suspendAllEvents = true; + dataGridViewControl.RefreshDataGridView(); + HandlePossibleOutdatedIllustrationPointsControl(); + suspendAllEvents = false; + + HandlePossibleOutdatedIllustrationPointsSelection(); + } + + private void HandlePossibleOutdatedIllustrationPointsControl() + { + IEnumerable illustrationPointControlItems = GetIllustrationPointControlItems(); + + if (illustrationPointsControl.Data.Count() != illustrationPointControlItems.Count()) + { + illustrationPointsControl.Data = illustrationPointControlItems; + } + } + + private void HandlePossibleOutdatedIllustrationPointsSelection() + { + if (illustrationPointsControl.Selection == null && Selection is SelectedTopLevelSubMechanismIllustrationPoint) + { + ProvideCalculationSelection(); + } + } + + private void LocalizeControls() + { + CalculateForSelectedButton.Text = Resources.CalculatableView_CalculateForSelectedButton_Text; + DeselectAllButton.Text = Resources.CalculatableView_DeselectAllButton_Text; + SelectAllButton.Text = Resources.CalculatableView_SelectAllButton_Text; + ButtonGroupBox.Text = Resources.CalculatableView_ButtonGroupBox_Text; + } + + private void InitializeEventHandlers() + { + dataGridViewControl.CurrentRowChanged += DataGridViewControlOnCurrentRowChanged; + dataGridViewControl.CellValueChanged += DataGridViewControlOnCellValueChanged; + illustrationPointsControl.SelectionChanged += IllustrationPointsControlOnSelectionChanged; + } + + private void OnSelectionChanged() + { + SelectionChanged?.Invoke(this, new EventArgs()); + } + + private void ProvideCalculationSelection() + { + Selection = CreateSelectedItemFromCurrentRow(); + OnSelectionChanged(); + } + + #region Event handling + + private void DataGridViewControlOnCurrentRowChanged(object sender, EventArgs e) + { + if (suspendAllEvents) + { + return; + } + + suspendIllustrationPointsControlSelectionChanges = true; + illustrationPointsControl.Data = GetIllustrationPointControlItems(); + suspendIllustrationPointsControlSelectionChanges = false; + + ProvideCalculationSelection(); + } + + private void DataGridViewControlOnCellValueChanged(object sender, DataGridViewCellEventArgs e) + { + if (suspendAllEvents || e.ColumnIndex != calculateColumnIndex) + { + return; + } + + UpdateCalculateForSelectedButton(); + } + + private void IllustrationPointsControlOnSelectionChanged(object sender, EventArgs eventArgs) + { + if (suspendAllEvents || suspendIllustrationPointsControlSelectionChanges) + { + return; + } + + var selection = illustrationPointsControl.Selection as IllustrationPointControlItem; + Selection = selection != null + ? new SelectedTopLevelSubMechanismIllustrationPoint((TopLevelSubMechanismIllustrationPoint) selection.Source, + GetIllustrationPointControlItems().Select(ipci => ipci.ClosingSituation)) + : null; + + OnSelectionChanged(); + } + + /// + /// Gets the illustration point control items based on the data of the illustration points. + /// + /// The illustration point control items if it has obtained as part of the calculation, null + /// otherwise. + protected abstract IEnumerable GetIllustrationPointControlItems(); + + private void SelectAllButton_Click(object sender, EventArgs e) + { + SetShouldCalculateForAllRowsAndRefresh(true); + } + + private void DeselectAllButton_Click(object sender, EventArgs e) + { + SetShouldCalculateForAllRowsAndRefresh(false); + } + + private void SetShouldCalculateForAllRowsAndRefresh(bool newShouldCalculateValue) + { + GetCalculatableRows().ForEachElementDo(row => row.ShouldCalculate = newShouldCalculateValue); + dataGridViewControl.RefreshDataGridView(); + UpdateCalculateForSelectedButton(); + } + + private void CalculateForSelectedButton_Click(object sender, EventArgs e) + { + CalculateForSelectedRows(); + } + + #endregion + } +} \ No newline at end of file Index: Ringtoets/Common/src/Ringtoets.Common.Forms/Views/CalculationsView.resx =================================================================== diff -u --- Ringtoets/Common/src/Ringtoets.Common.Forms/Views/CalculationsView.resx (revision 0) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/Views/CalculationsView.resx (revision 8cf808db7be49f9a3c28ae9f9d5dbf283d26c284) @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + \ No newline at end of file Index: Ringtoets/Common/src/Ringtoets.Common.Forms/Views/HydraulicBoundaryLocationsView.cs =================================================================== diff -u -rcb7ad1d43946f69cc0de0efbe3b0874a38824ad5 -r8cf808db7be49f9a3c28ae9f9d5dbf283d26c284 --- Ringtoets/Common/src/Ringtoets.Common.Forms/Views/HydraulicBoundaryLocationsView.cs (.../HydraulicBoundaryLocationsView.cs) (revision cb7ad1d43946f69cc0de0efbe3b0874a38824ad5) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/Views/HydraulicBoundaryLocationsView.cs (.../HydraulicBoundaryLocationsView.cs) (revision 8cf808db7be49f9a3c28ae9f9d5dbf283d26c284) @@ -36,7 +36,7 @@ /// Base view for views which should be derived in /// order to get a consistent look and feel. /// - public abstract partial class HydraulicBoundaryLocationsView : LocationsView + public abstract partial class HydraulicBoundaryLocationsView : CalculationsView { private readonly Observer calculationsObserver; private readonly RecursiveObserver, HydraulicBoundaryLocationCalculation> calculationObserver; Fisheye: Tag 8cf808db7be49f9a3c28ae9f9d5dbf283d26c284 refers to a dead (removed) revision in file `Ringtoets/Common/src/Ringtoets.Common.Forms/Views/LocationsView.Designer.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 8cf808db7be49f9a3c28ae9f9d5dbf283d26c284 refers to a dead (removed) revision in file `Ringtoets/Common/src/Ringtoets.Common.Forms/Views/LocationsView.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 8cf808db7be49f9a3c28ae9f9d5dbf283d26c284 refers to a dead (removed) revision in file `Ringtoets/Common/src/Ringtoets.Common.Forms/Views/LocationsView.resx'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Ringtoets.Common.Forms.Test.csproj =================================================================== diff -u -re8ddc7a63f03cb28eeb3974363d6edb4ba51c896 -r8cf808db7be49f9a3c28ae9f9d5dbf283d26c284 --- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Ringtoets.Common.Forms.Test.csproj (.../Ringtoets.Common.Forms.Test.csproj) (revision e8ddc7a63f03cb28eeb3974363d6edb4ba51c896) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Ringtoets.Common.Forms.Test.csproj (.../Ringtoets.Common.Forms.Test.csproj) (revision 8cf808db7be49f9a3c28ae9f9d5dbf283d26c284) @@ -131,7 +131,7 @@ - + Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Views/CalculationsViewTest.cs =================================================================== diff -u --- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Views/CalculationsViewTest.cs (revision 0) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Views/CalculationsViewTest.cs (revision 8cf808db7be49f9a3c28ae9f9d5dbf283d26c284) @@ -0,0 +1,377 @@ +// 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.Collections.Generic; +using System.Linq; +using System.Windows.Forms; +using Core.Common.Controls.DataGrid; +using Core.Common.Controls.Views; +using Core.Common.Util.Reflection; +using NUnit.Extensions.Forms; +using NUnit.Framework; +using Ringtoets.Common.Data.IllustrationPoints; +using Ringtoets.Common.Data.TestUtil.IllustrationPoints; +using Ringtoets.Common.Forms.TestUtil; +using Ringtoets.Common.Forms.Views; + +namespace Ringtoets.Common.Forms.Test.Views +{ + [TestFixture] + public class CalculationsViewTest + { + private const int calculateColumnIndex = 0; + + private Form testForm; + + [SetUp] + public void Setup() + { + testForm = new Form(); + } + + [TearDown] + public void TearDown() + { + testForm.Dispose(); + } + + [Test] + public void DefaultConstructor_DefaultValues() + { + // Call + using (var view = new TestCalculationsView()) + { + // Assert + Assert.IsInstanceOf(view); + Assert.IsInstanceOf(view); + Assert.IsInstanceOf(view); + Assert.IsNull(view.Data); + + Assert.AreEqual(1, view.Controls.Count); + + var splitContainer = view.Controls[0] as SplitContainer; + Assert.IsNotNull(splitContainer); + Control.ControlCollection verticalSplitContainerPanel1Controls = splitContainer.Panel1.Controls; + Assert.AreEqual(2, verticalSplitContainerPanel1Controls.Count); + Assert.IsInstanceOf(verticalSplitContainerPanel1Controls[0]); + Assert.IsInstanceOf(verticalSplitContainerPanel1Controls[1]); + + Control.ControlCollection verticalSplitContainerPanel2Controls = splitContainer.Panel2.Controls; + Assert.AreEqual(1, verticalSplitContainerPanel2Controls.Count); + Assert.IsInstanceOf(verticalSplitContainerPanel2Controls[0]); + } + } + + [Test] + public void Constructor_CalculateAllButtonCorrectlyInitialized() + { + // Setup & Call + TestCalculationsView view = ShowTestCalculatableView(); + + // Assert + var button = (Button) view.Controls.Find("CalculateForSelectedButton", true)[0]; + Assert.IsFalse(button.Enabled); + } + + [Test] + public void OnLoad_DataGridViewCorrectlyInitialized() + { + // Setup & Call + TestCalculationsView view = ShowTestCalculatableView(); + + // Assert + DataGridView dataGridView = ControlTestHelper.GetDataGridView(testForm, "DataGridView"); + Assert.AreEqual(1, dataGridView.ColumnCount); + + var calculateColumn = (DataGridViewCheckBoxColumn) dataGridView.Columns[calculateColumnIndex]; + const string expectedCalculateHeaderText = "Berekenen"; + Assert.AreEqual(expectedCalculateHeaderText, calculateColumn.HeaderText); + + var button = (Button) view.Controls.Find("CalculateForSelectedButton", true)[0]; + Assert.IsFalse(button.Enabled); + } + + [Test] + public void Selection_WithoutCalculations_ReturnsNull() + { + // Call + using (var view = new TestCalculationsView()) + { + // Assert + Assert.IsNull(view.Selection); + } + } + + [Test] + public void GivenFullyConfiguredView_WhenSelectingCellInRow_ThenSelectionChangedFired() + { + // Given + TestCalculationsView view = ShowFullyConfiguredTestCalculatableView(); + + var selectionChangedCount = 0; + view.SelectionChanged += (sender, args) => selectionChangedCount++; + + DataGridView dataGridView = ControlTestHelper.GetDataGridView(testForm, "DataGridView"); + + // When + dataGridView.CurrentCell = dataGridView.Rows[1].Cells[calculateColumnIndex]; + EventHelper.RaiseEvent(dataGridView, "CellClick", new DataGridViewCellEventArgs(0, 0)); + + // Then + Assert.AreEqual(1, selectionChangedCount); + } + + [Test] + public void SelectAllButton_SelectAllButtonClicked_AllCalculatableItemsSelected() + { + // Setup + ShowFullyConfiguredTestCalculatableView(); + + DataGridView dataGridView = ControlTestHelper.GetDataGridView(testForm, "DataGridView"); + DataGridViewRowCollection rows = dataGridView.Rows; + var button = new ButtonTester("SelectAllButton", testForm); + + // Precondition + Assert.IsFalse((bool) rows[0].Cells[calculateColumnIndex].Value); + Assert.IsFalse((bool) rows[1].Cells[calculateColumnIndex].Value); + + // Call + button.Click(); + + // Assert + Assert.IsTrue((bool) rows[0].Cells[calculateColumnIndex].Value); + Assert.IsTrue((bool) rows[1].Cells[calculateColumnIndex].Value); + } + + [Test] + public void DeselectAllButton_AllCalculatableItemsSelectedDeselectAllButtonClicked_AllCalculatableItemsNotSelected() + { + // Setup + ShowFullyConfiguredTestCalculatableView(); + + DataGridView dataGridView = ControlTestHelper.GetDataGridView(testForm, "DataGridView"); + var button = new ButtonTester("DeselectAllButton", testForm); + + DataGridViewRowCollection rows = dataGridView.Rows; + foreach (DataGridViewRow row in rows) + { + row.Cells[calculateColumnIndex].Value = true; + } + + // Precondition + Assert.IsTrue((bool) rows[0].Cells[calculateColumnIndex].Value); + Assert.IsTrue((bool) rows[1].Cells[calculateColumnIndex].Value); + + // Call + button.Click(); + + // Assert + Assert.IsFalse((bool) rows[0].Cells[calculateColumnIndex].Value); + Assert.IsFalse((bool) rows[1].Cells[calculateColumnIndex].Value); + } + + [Test] + public void GivenFullyConfiguredView_WhenNoRowsSelected_ThenCalculateForSelectedButtonDisabledAndErrorMessageProvided() + { + // Given & When + TestCalculationsView view = ShowFullyConfiguredTestCalculatableView(); + + // Then + var button = (Button) view.Controls.Find("CalculateForSelectedButton", true)[0]; + Assert.IsFalse(button.Enabled); + var errorProvider = TypeUtils.GetField(view, "CalculateForSelectedButtonErrorProvider"); + Assert.AreEqual("Er zijn geen berekeningen geselecteerd.", errorProvider.GetError(button)); + } + + [Test] + public void GivenFullyConfiguredView_WhenRowsSelected_ThenCalculateForSelectedButtonEnabledAndNoErrorMessageProvided() + { + // Given + TestCalculationsView view = ShowFullyConfiguredTestCalculatableView(); + DataGridView dataGridView = ControlTestHelper.GetDataGridView(testForm, "DataGridView"); + + // When + dataGridView.Rows[0].Cells[calculateColumnIndex].Value = true; + + // Then + var button = (Button) view.Controls.Find("CalculateForSelectedButton", true)[0]; + Assert.IsTrue(button.Enabled); + var errorProvider = TypeUtils.GetField(view, "CalculateForSelectedButtonErrorProvider"); + Assert.AreEqual("", errorProvider.GetError(button)); + } + + [Test] + public void CalculateForSelectedButton_OneSelected_CallsCalculateHandleCalculateSelectedObjects() + { + // Setup + TestCalculationsView view = ShowFullyConfiguredTestCalculatableView(); + + DataGridView dataGridView = ControlTestHelper.GetDataGridView(testForm, "DataGridView"); + + DataGridViewRowCollection rows = dataGridView.Rows; + rows[0].Cells[calculateColumnIndex].Value = true; + + var buttonTester = new ButtonTester("CalculateForSelectedButton", testForm); + + // Call + buttonTester.Click(); + + // Assert + Assert.AreEqual(1, view.ObjectsToCalculate.Count()); + TestCalculatableObject expectedObject = ((IEnumerable) view.Data).First(); + Assert.AreEqual(expectedObject, view.ObjectsToCalculate.First()); + } + + private TestCalculationsView ShowTestCalculatableView() + { + var view = new TestCalculationsView(); + + testForm.Controls.Add(view); + testForm.Show(); + + return view; + } + + private TestCalculationsView ShowFullyConfiguredTestCalculatableView() + { + TestCalculationsView view = ShowTestCalculatableView(); + view.Data = new[] + { + new TestCalculatableObject + { + GeneralResult = new GeneralResult( + WindDirectionTestFactory.CreateTestWindDirection(), + Enumerable.Empty(), + new[] + { + new TopLevelSubMechanismIllustrationPoint( + WindDirectionTestFactory.CreateTestWindDirection(), "Regular", + new SubMechanismIllustrationPoint("Point 1", 0.9, + Enumerable.Empty(), + Enumerable.Empty())), + new TopLevelSubMechanismIllustrationPoint( + WindDirectionTestFactory.CreateTestWindDirection(), "Open", + new SubMechanismIllustrationPoint("Point 2", 0.7, + Enumerable.Empty(), + Enumerable.Empty())) + }) + }, + new TestCalculatableObject + { + GeneralResult = new GeneralResult( + WindDirectionTestFactory.CreateTestWindDirection(), + Enumerable.Empty(), + new[] + { + new TopLevelSubMechanismIllustrationPoint( + WindDirectionTestFactory.CreateTestWindDirection(), "Regular", + new SubMechanismIllustrationPoint("Point 1", 0.9, + Enumerable.Empty(), + Enumerable.Empty())), + new TopLevelSubMechanismIllustrationPoint( + WindDirectionTestFactory.CreateTestWindDirection(), "Open", + new SubMechanismIllustrationPoint("Point 2", 0.7, + Enumerable.Empty(), + Enumerable.Empty())), + new TopLevelSubMechanismIllustrationPoint( + WindDirectionTestFactory.CreateTestWindDirection(), "Closed", + new SubMechanismIllustrationPoint("Point 3", 0.8, + Enumerable.Empty(), + Enumerable.Empty())) + }) + } + }; + return view; + } + + private class TestCalculatableRow : CalculatableRow + { + public TestCalculatableRow(TestCalculatableObject calculatableObject) : base(calculatableObject) + { + ShouldCalculate = calculatableObject.IsChecked; + } + } + + private class TestCalculatableObject + { + public bool IsChecked { get; } + + public GeneralResult GeneralResult { get; set; } + } + + private class TestCalculationsView : CalculationsView + { + private IEnumerable data; + + public TestCalculationsView() + { + ObjectsToCalculate = new List(); + } + + public override object Data + { + get + { + return data; + } + set + { + data = value as IEnumerable; + UpdateDataGridViewDataSource(); + } + } + + public IEnumerable ObjectsToCalculate { get; private set; } + + protected override object CreateSelectedItemFromCurrentRow() + { + return ((TestCalculatableRow) dataGridViewControl.CurrentRow?.DataBoundItem)?.CalculatableObject; + } + + protected override void SetDataSource() + { + dataGridViewControl.SetDataSource(data.Select(d => new TestCalculatableRow(d)).ToArray()); + } + + protected override void CalculateForSelectedRows() + { + ObjectsToCalculate = GetCalculatableRows() + .Where(r => r.ShouldCalculate) + .Cast() + .Select(row => row.CalculatableObject); + } + + protected override IEnumerable GetIllustrationPointControlItems() + { + TestCalculatableObject calculatableObject = ((TestCalculatableRow) dataGridViewControl.CurrentRow?.DataBoundItem)?.CalculatableObject; + + return calculatableObject?.GeneralResult?.TopLevelIllustrationPoints + .Select(topLevelSubMechanismIllustrationPoint => + new IllustrationPointControlItem(topLevelSubMechanismIllustrationPoint, + topLevelSubMechanismIllustrationPoint.WindDirection.Name, + topLevelSubMechanismIllustrationPoint.ClosingSituation, + topLevelSubMechanismIllustrationPoint.SubMechanismIllustrationPoint.Stochasts, + topLevelSubMechanismIllustrationPoint.SubMechanismIllustrationPoint.Beta)) + .ToArray(); + } + } + } +} \ No newline at end of file Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Views/HydraulicBoundaryLocationsViewTest.cs =================================================================== diff -u -r68a504ed77ed5a98c8023539f140b8a36d7de768 -r8cf808db7be49f9a3c28ae9f9d5dbf283d26c284 --- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Views/HydraulicBoundaryLocationsViewTest.cs (.../HydraulicBoundaryLocationsViewTest.cs) (revision 68a504ed77ed5a98c8023539f140b8a36d7de768) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Views/HydraulicBoundaryLocationsViewTest.cs (.../HydraulicBoundaryLocationsViewTest.cs) (revision 8cf808db7be49f9a3c28ae9f9d5dbf283d26c284) @@ -90,7 +90,7 @@ TestHydraulicBoundaryLocationsView view = ShowFullyConfiguredTestHydraulicBoundaryLocationsView(); // Assert - Assert.IsInstanceOf>(view); + Assert.IsInstanceOf>(view); Assert.IsNull(view.Data); } Fisheye: Tag 8cf808db7be49f9a3c28ae9f9d5dbf283d26c284 refers to a dead (removed) revision in file `Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Views/LocationsViewTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/Common/test/Ringtoets.Common.Forms.TestUtil/LocationsViewSynchronizationTester.cs =================================================================== diff -u -r7df9e3ff6a7b1ae8fa03d837c6e356f775d92575 -r8cf808db7be49f9a3c28ae9f9d5dbf283d26c284 --- Ringtoets/Common/test/Ringtoets.Common.Forms.TestUtil/LocationsViewSynchronizationTester.cs (.../LocationsViewSynchronizationTester.cs) (revision 7df9e3ff6a7b1ae8fa03d837c6e356f775d92575) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.TestUtil/LocationsViewSynchronizationTester.cs (.../LocationsViewSynchronizationTester.cs) (revision 8cf808db7be49f9a3c28ae9f9d5dbf283d26c284) @@ -33,7 +33,7 @@ namespace Ringtoets.Common.Forms.TestUtil { /// - /// Class for testing data and selection synchronization in derivatives. + /// Class for testing data and selection synchronization in derivatives. /// /// The type of the calculations contained by the view. [TestFixture] @@ -64,7 +64,7 @@ /// The calculations view involved. /// The selected calculation row object. /// The view selection object. - protected abstract object GetCalculationSelection(LocationsView view, object selectedRowObject); + protected abstract object GetCalculationSelection(CalculationsView view, object selectedRowObject); /// /// Method for showing a fully configured calculations view. @@ -80,16 +80,16 @@ /// /// /// The fully configured calculations view. - protected abstract LocationsView ShowFullyConfiguredCalculationsView(Form form); + protected abstract CalculationsView ShowFullyConfiguredCalculationsView(Form form); /// /// Method for getting the calculations in . /// /// The view to get the calculations from. /// An of calculations. - protected abstract ObservableList GetCalculationsInView(LocationsView view); + protected abstract ObservableList GetCalculationsInView(CalculationsView view); - private void ReplaceCalculationsAndNotifyObservers(LocationsView view) + private void ReplaceCalculationsAndNotifyObservers(CalculationsView view) { ObservableList calculations = GetCalculationsInView(view); @@ -98,7 +98,7 @@ calculations.NotifyObservers(); } - private void ClearCalculationOutputAndNotifyObservers(LocationsView view) + private void ClearCalculationOutputAndNotifyObservers(CalculationsView view) { ObservableList calculations = GetCalculationsInView(view); @@ -109,7 +109,7 @@ }); } - private void SetCalculationOutputAndNotifyObservers(LocationsView view) + private void SetCalculationOutputAndNotifyObservers(CalculationsView view) { ObservableList calculations = GetCalculationsInView(view); @@ -192,7 +192,7 @@ public void GivenFullyConfiguredViewWithFilledIllustrationPointsControl_WhenOutputCleared_ThenDataGridViewsUpdated() { // Given - LocationsView view = ShowFullyConfiguredCalculationsView(testForm); + CalculationsView view = ShowFullyConfiguredCalculationsView(testForm); DataGridView calculationsDataGridView = GetCalculationsDataGridView(); DataGridViewRowCollection dataGridViewRows = calculationsDataGridView.Rows; @@ -230,7 +230,7 @@ public void GivenFullyConfiguredView_WhenSelectingCalculation_ThenSelectionUpdated() { // Given - LocationsView view = ShowFullyConfiguredCalculationsView(testForm); + CalculationsView view = ShowFullyConfiguredCalculationsView(testForm); DataGridView calculationsDataGridView = GetCalculationsDataGridView(); @@ -247,7 +247,7 @@ public void GivenFullyConfiguredViewWithCalculationSelection_WhenCalculationsReplaced_ThenSelectionUpdated() { // Given - LocationsView view = ShowFullyConfiguredCalculationsView(testForm); + CalculationsView view = ShowFullyConfiguredCalculationsView(testForm); DataGridView calculationsDataGridView = GetCalculationsDataGridView(); calculationsDataGridView.CurrentCell = calculationsDataGridView.Rows[3].Cells[0]; @@ -270,7 +270,7 @@ public void GivenFullyConfiguredViewWithCalculationSelection_WhenOutputCleared_ThenSelectionPreserved() { // Given - LocationsView view = ShowFullyConfiguredCalculationsView(testForm); + CalculationsView view = ShowFullyConfiguredCalculationsView(testForm); DataGridView calculationsDataGridView = GetCalculationsDataGridView(); calculationsDataGridView.CurrentCell = calculationsDataGridView.Rows[3].Cells[0]; @@ -293,7 +293,7 @@ public void GivenFullyConfiguredViewWithCalculationSelection_WhenOutputUpdated_ThenSelectionPreserved() { // Given - LocationsView view = ShowFullyConfiguredCalculationsView(testForm); + CalculationsView view = ShowFullyConfiguredCalculationsView(testForm); DataGridView calculationsDataGridView = GetCalculationsDataGridView(); calculationsDataGridView.CurrentCell = calculationsDataGridView.Rows[3].Cells[0]; @@ -316,7 +316,7 @@ public void GivenFullyConfiguredView_WhenSelectingIllustrationPoint_ThenSelectionUpdated() { // Given - LocationsView view = ShowFullyConfiguredCalculationsView(testForm); + CalculationsView view = ShowFullyConfiguredCalculationsView(testForm); DataGridView calculationsDataGridView = GetCalculationsDataGridView(); calculationsDataGridView.CurrentCell = calculationsDataGridView.Rows[3].Cells[0]; @@ -333,7 +333,7 @@ public void GivenFullyConfiguredViewWithIllustrationPointSelection_WhenCalculationsReplaced_ThenSelectionSetToCalculation() { // Given - LocationsView view = ShowFullyConfiguredCalculationsView(testForm); + CalculationsView view = ShowFullyConfiguredCalculationsView(testForm); DataGridView calculationsDataGridView = GetCalculationsDataGridView(); calculationsDataGridView.CurrentCell = calculationsDataGridView.Rows[3].Cells[0]; @@ -357,7 +357,7 @@ public void GivenFullyConfiguredViewWithIllustrationPointSelection_WhenOutputCleared_ThenSelectionSetToCalculation() { // Given - LocationsView view = ShowFullyConfiguredCalculationsView(testForm); + CalculationsView view = ShowFullyConfiguredCalculationsView(testForm); DataGridView calculationsDataGridView = GetCalculationsDataGridView(); calculationsDataGridView.CurrentCell = calculationsDataGridView.Rows[3].Cells[0]; @@ -381,7 +381,7 @@ public void GivenFullyConfiguredViewWithIllustrationPointSelection_WhenOutputUpdated_ThenSelectionPreserved() { // Given - LocationsView view = ShowFullyConfiguredCalculationsView(testForm); + CalculationsView view = ShowFullyConfiguredCalculationsView(testForm); DataGridView calculationsDataGridView = GetCalculationsDataGridView(); calculationsDataGridView.CurrentCell = calculationsDataGridView.Rows[3].Cells[0]; Index: Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/Views/GrassCoverErosionOutwardsDesignWaterLevelLocationsViewTest.cs =================================================================== diff -u -r31c4f7ce05aa2e32499eab25eb02494eb959441e -r8cf808db7be49f9a3c28ae9f9d5dbf283d26c284 --- Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/Views/GrassCoverErosionOutwardsDesignWaterLevelLocationsViewTest.cs (.../GrassCoverErosionOutwardsDesignWaterLevelLocationsViewTest.cs) (revision 31c4f7ce05aa2e32499eab25eb02494eb959441e) +++ Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/Views/GrassCoverErosionOutwardsDesignWaterLevelLocationsViewTest.cs (.../GrassCoverErosionOutwardsDesignWaterLevelLocationsViewTest.cs) (revision 8cf808db7be49f9a3c28ae9f9d5dbf283d26c284) @@ -715,17 +715,17 @@ base.Setup(); } - protected override object GetCalculationSelection(LocationsView view, object selectedRowObject) + protected override object GetCalculationSelection(CalculationsView view, object selectedRowObject) { return new GrassCoverErosionOutwardsDesignWaterLevelCalculationContext(((HydraulicBoundaryLocationRow) selectedRowObject).CalculatableObject); } - protected override LocationsView ShowFullyConfiguredCalculationsView(Form form) + protected override CalculationsView ShowFullyConfiguredCalculationsView(Form form) { return ShowDesignWaterLevelLocationsView(calculations, new ObservableTestAssessmentSectionStub(), 0.01, form); } - protected override ObservableList GetCalculationsInView(LocationsView view) + protected override ObservableList GetCalculationsInView(CalculationsView view) { return calculations; } Index: Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/Views/GrassCoverErosionOutwardsWaveHeightLocationsViewTest.cs =================================================================== diff -u -r31c4f7ce05aa2e32499eab25eb02494eb959441e -r8cf808db7be49f9a3c28ae9f9d5dbf283d26c284 --- Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/Views/GrassCoverErosionOutwardsWaveHeightLocationsViewTest.cs (.../GrassCoverErosionOutwardsWaveHeightLocationsViewTest.cs) (revision 31c4f7ce05aa2e32499eab25eb02494eb959441e) +++ Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/Views/GrassCoverErosionOutwardsWaveHeightLocationsViewTest.cs (.../GrassCoverErosionOutwardsWaveHeightLocationsViewTest.cs) (revision 8cf808db7be49f9a3c28ae9f9d5dbf283d26c284) @@ -715,17 +715,17 @@ base.Setup(); } - protected override object GetCalculationSelection(LocationsView view, object selectedRowObject) + protected override object GetCalculationSelection(CalculationsView view, object selectedRowObject) { return new GrassCoverErosionOutwardsWaveHeightCalculationContext(((HydraulicBoundaryLocationRow) selectedRowObject).CalculatableObject); } - protected override LocationsView ShowFullyConfiguredCalculationsView(Form form) + protected override CalculationsView ShowFullyConfiguredCalculationsView(Form form) { return ShowWaveHeightLocationsView(calculations, new ObservableTestAssessmentSectionStub(), 0.01, form); } - protected override ObservableList GetCalculationsInView(LocationsView view) + protected override ObservableList GetCalculationsInView(CalculationsView view) { return calculations; } Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/DesignWaterLevelLocationsViewTest.cs =================================================================== diff -u -r7df9e3ff6a7b1ae8fa03d837c6e356f775d92575 -r8cf808db7be49f9a3c28ae9f9d5dbf283d26c284 --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/DesignWaterLevelLocationsViewTest.cs (.../DesignWaterLevelLocationsViewTest.cs) (revision 7df9e3ff6a7b1ae8fa03d837c6e356f775d92575) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/DesignWaterLevelLocationsViewTest.cs (.../DesignWaterLevelLocationsViewTest.cs) (revision 8cf808db7be49f9a3c28ae9f9d5dbf283d26c284) @@ -672,17 +672,17 @@ } } - protected override object GetCalculationSelection(LocationsView view, object selectedRowObject) + protected override object GetCalculationSelection(CalculationsView view, object selectedRowObject) { return new DesignWaterLevelCalculationContext(((HydraulicBoundaryLocationRow) selectedRowObject).CalculatableObject); } - protected override LocationsView ShowFullyConfiguredCalculationsView(Form form) + protected override CalculationsView ShowFullyConfiguredCalculationsView(Form form) { return ShowFullyConfiguredDesignWaterLevelLocationsView(calculations, form); } - protected override ObservableList GetCalculationsInView(LocationsView view) + protected override ObservableList GetCalculationsInView(CalculationsView view) { return calculations; } Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/WaveHeightLocationsViewTest.cs =================================================================== diff -u -r7df9e3ff6a7b1ae8fa03d837c6e356f775d92575 -r8cf808db7be49f9a3c28ae9f9d5dbf283d26c284 --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/WaveHeightLocationsViewTest.cs (.../WaveHeightLocationsViewTest.cs) (revision 7df9e3ff6a7b1ae8fa03d837c6e356f775d92575) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/WaveHeightLocationsViewTest.cs (.../WaveHeightLocationsViewTest.cs) (revision 8cf808db7be49f9a3c28ae9f9d5dbf283d26c284) @@ -672,17 +672,17 @@ } } - protected override object GetCalculationSelection(LocationsView view, object selectedRowObject) + protected override object GetCalculationSelection(CalculationsView view, object selectedRowObject) { return new WaveHeightCalculationContext(((HydraulicBoundaryLocationRow) selectedRowObject).CalculatableObject); } - protected override LocationsView ShowFullyConfiguredCalculationsView(Form form) + protected override CalculationsView ShowFullyConfiguredCalculationsView(Form form) { return ShowFullyConfiguredWaveHeightLocationsView(calculations, form); } - protected override ObservableList GetCalculationsInView(LocationsView view) + protected override ObservableList GetCalculationsInView(CalculationsView view) { return calculations; }