Index: Riskeer/ClosingStructures/test/Riskeer.ClosingStructures.Forms.Test/Views/ClosingStructuresCalculationsViewTest.cs =================================================================== diff -u -r4e8d9d5f3b19a4bcd8c6d217e3d2b180d3171915 -r7251030b241c883c3832846d42e0c04cc11cf720 --- Riskeer/ClosingStructures/test/Riskeer.ClosingStructures.Forms.Test/Views/ClosingStructuresCalculationsViewTest.cs (.../ClosingStructuresCalculationsViewTest.cs) (revision 4e8d9d5f3b19a4bcd8c6d217e3d2b180d3171915) +++ Riskeer/ClosingStructures/test/Riskeer.ClosingStructures.Forms.Test/Views/ClosingStructuresCalculationsViewTest.cs (.../ClosingStructuresCalculationsViewTest.cs) (revision 7251030b241c883c3832846d42e0c04cc11cf720) @@ -695,6 +695,40 @@ mocks.VerifyAll(); // No observer notified } + [Test] + public void GivenForeshoreProfile_WhenSelectingAnotherForeshoreProfile_ThenCorrectColumnStates() + { + // Given + var mocks = new MockRepository(); + var assessmentSection = mocks.Stub(); + ConfigureHydraulicBoundaryDatabase(assessmentSection); + mocks.ReplayAll(); + + ClosingStructuresFailureMechanism failureMechanism = ConfigureFailureMechanism(); + CalculationGroup calculationGroup = ConfigureCalculationGroup(failureMechanism, assessmentSection); + + ShowCalculationsView(calculationGroup, failureMechanism, assessmentSection); + + var dataGridView = (DataGridView) new ControlTester("dataGridView").TheObject; + var foreshoreProfileComboBox = (DataGridViewComboBoxColumn) dataGridView.Columns[foreshoreProfileColumnIndex]; + + // Precondition + Assert.AreEqual(3, foreshoreProfileComboBox.Items.Count); + Assert.AreEqual(false, dataGridView.Rows[0].Cells[useBreakWaterColumnIndex].ReadOnly); + Assert.AreEqual(false, dataGridView.Rows[0].Cells[breakWaterTypeColumnIndex].ReadOnly); + Assert.AreEqual(false, dataGridView.Rows[0].Cells[breakWaterHeightColumnIndex].ReadOnly); + + // When + dataGridView.Rows[0].Cells[foreshoreProfileColumnIndex].Value = new DataGridViewComboBoxItemWrapper(null); + + // Then + Assert.AreEqual(true, dataGridView.Rows[0].Cells[useBreakWaterColumnIndex].ReadOnly); + Assert.AreEqual(true, dataGridView.Rows[0].Cells[breakWaterTypeColumnIndex].ReadOnly); + Assert.AreEqual(true, dataGridView.Rows[0].Cells[breakWaterHeightColumnIndex].ReadOnly); + + mocks.VerifyAll(); + } + public override void Setup() { base.Setup();