Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/WaveHeightLocationsViewTest.cs =================================================================== diff -u -r161308cb864a66713f62357c6bcdb6ede03b619f -r28e867674791c1111107ea44e960313f43fc6aea --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/WaveHeightLocationsViewTest.cs (.../WaveHeightLocationsViewTest.cs) (revision 161308cb864a66713f62357c6bcdb6ede03b619f) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/WaveHeightLocationsViewTest.cs (.../WaveHeightLocationsViewTest.cs) (revision 28e867674791c1111107ea44e960313f43fc6aea) @@ -27,7 +27,6 @@ using Core.Common.Base; using Core.Common.Base.Data; using Core.Common.Base.Geometry; -using Core.Common.Controls.Views; using Core.Common.Gui.Selection; using NUnit.Extensions.Forms; using NUnit.Framework; @@ -66,8 +65,7 @@ using (var view = new WaveHeightLocationsView()) { // Assert - Assert.IsInstanceOf(view); - Assert.IsInstanceOf(view); + Assert.IsInstanceOf(view); Assert.IsNull(view.Data); } } @@ -356,27 +354,20 @@ } [Test] - public void CalculateForSelectedButton_NoneSelected_CallsCalculateWaveHeights() + public void CalculateForSelectedButton_NoneSelected_CalculateForSelectedButtonDisabled() { // Setup - WaveHeightLocationsView view = ShowFullyConfiguredWaveHeightLocationsView(); - var mockRepository = new MockRepository(); var commandHandlerMock = mockRepository.StrictMock(); - - IEnumerable locations = null; - commandHandlerMock.Expect(ch => ch.CalculateWaveHeights(null)).IgnoreArguments().WhenCalled( - invocation => { locations = (IEnumerable) invocation.Arguments[0]; }); mockRepository.ReplayAll(); + WaveHeightLocationsView view = ShowFullyConfiguredWaveHeightLocationsView(); view.CalculationCommandHandler = commandHandlerMock; - var button = new ButtonTester("CalculateForSelectedButton", testForm); - // Call - button.Click(); - // Assert - Assert.AreEqual(0, locations.Count()); + var buttonTester = new ButtonTester("CalculateForSelectedButton", testForm); + var button = (Button) buttonTester.TheObject; + Assert.IsFalse(button.Enabled); mockRepository.VerifyAll(); } @@ -413,10 +404,15 @@ } [Test] - public void CalculateForSelectedButton_CalculationCommandHandlerNotSet_DoesNotThrowException() + public void CalculateForSelectedButton_OneSelectedButCalculationCommandHandlerNotSet_DoesNotThrowException() { // Setup ShowFullyConfiguredWaveHeightLocationsView(); + + var dataGridView = (DataGridView) new ControlTester("dataGridView").TheObject; + var rows = dataGridView.Rows; + rows[0].Cells[locationCalculateColumnIndex].Value = true; + var button = new ButtonTester("CalculateForSelectedButton", testForm); // Call