Index: Riskeer/Common/test/Riskeer.Common.Forms.Test/Views/CalculationsViewTest.cs =================================================================== diff -u -re6fcde3f134bb64e9152651964f5dddc30902c73 -r3345cae48fa054132a022131bbe589a7c3537e77 --- Riskeer/Common/test/Riskeer.Common.Forms.Test/Views/CalculationsViewTest.cs (.../CalculationsViewTest.cs) (revision e6fcde3f134bb64e9152651964f5dddc30902c73) +++ Riskeer/Common/test/Riskeer.Common.Forms.Test/Views/CalculationsViewTest.cs (.../CalculationsViewTest.cs) (revision 3345cae48fa054132a022131bbe589a7c3537e77) @@ -539,7 +539,7 @@ var dataGridView = (DataGridView) new ControlTester("dataGridView").TheObject; dataGridView.CurrentCell = dataGridView.Rows[0].Cells[0]; - // Call + // Call EventHelper.RaiseEvent(dataGridView, "CellClick", new DataGridViewCellEventArgs(1, 0)); // Assert @@ -580,7 +580,6 @@ var assessmentSection = mocks.Stub(); mocks.ReplayAll(); - // Call TestCalculationsView calculationsView = ShowFullyConfiguredCalculationsView(assessmentSection); // Call @@ -591,30 +590,6 @@ mocks.VerifyAll(); } - [Test] - [Apartment(ApartmentState.STA)] - public void CalculationsView_ChangingSubscribedCellValue_ValueCorrectlyAdjusted() - { - // Setup - var mocks = new MockRepository(); - var assessmentSection = mocks.Stub(); - mocks.ReplayAll(); - - TestCalculationsView calculationsView = ShowFullyConfiguredCalculationsView(assessmentSection); - - var dataGridView = (DataGridView) new ControlTester("dataGridView").TheObject; - DataGridViewCell dataGridViewCell = dataGridView.Rows[0].Cells[selectableHydraulicBoundaryLocationsColumnIndex]; - dataGridView.CurrentCell = dataGridViewCell; - - // Call - dataGridViewCell.Value = dataGridView.Rows[1].Cells[selectableHydraulicBoundaryLocationsColumnIndex].Value; - - // Assert - Assert.AreEqual(1, calculationsView.HydraulicBoundaryLocationChangedCounter); - WindowsFormsTestHelper.CloseAll(); - mocks.VerifyAll(); - } - #endregion #region Observers @@ -799,5 +774,29 @@ } #endregion + + [Test] + [Apartment(ApartmentState.STA)] + public void CalculationsView_ChangingSubscribedRow_ListenerCorrectlyNotified() + { + // Setup + var mocks = new MockRepository(); + var assessmentSection = mocks.Stub(); + mocks.ReplayAll(); + + TestCalculationsView calculationsView = ShowFullyConfiguredCalculationsView(assessmentSection); + + var dataGridView = (DataGridView) new ControlTester("dataGridView").TheObject; + DataGridViewCell dataGridViewCell = dataGridView.Rows[0].Cells[selectableHydraulicBoundaryLocationsColumnIndex]; + dataGridView.CurrentCell = dataGridViewCell; + + // Call + dataGridViewCell.Value = dataGridView.Rows[1].Cells[selectableHydraulicBoundaryLocationsColumnIndex].Value; + + // Assert + Assert.AreEqual(1, calculationsView.HydraulicBoundaryLocationChangedCounter); + WindowsFormsTestHelper.CloseAll(); + mocks.VerifyAll(); + } } } \ No newline at end of file