Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/WaveHeightLocationsViewTest.cs =================================================================== diff -u -r84afb606e58d67c6342c4f11bf66b042e49f52d6 -r807598022746fc4a110fa6af9038c0896f5a6c0f --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/WaveHeightLocationsViewTest.cs (.../WaveHeightLocationsViewTest.cs) (revision 84afb606e58d67c6342c4f11bf66b042e49f52d6) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/WaveHeightLocationsViewTest.cs (.../WaveHeightLocationsViewTest.cs) (revision 807598022746fc4a110fa6af9038c0896f5a6c0f) @@ -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