Index: Ringtoets/Revetment/test/Ringtoets.Revetment.Forms.Test/Views/WaveConditionsInputViewTest.cs =================================================================== diff -u -ra48939a116b21f3fec9bbf92e180818439aa7f89 -r5ef2f44bca31b92735dff724f97b717c7c55f912 --- Ringtoets/Revetment/test/Ringtoets.Revetment.Forms.Test/Views/WaveConditionsInputViewTest.cs (.../WaveConditionsInputViewTest.cs) (revision a48939a116b21f3fec9bbf92e180818439aa7f89) +++ Ringtoets/Revetment/test/Ringtoets.Revetment.Forms.Test/Views/WaveConditionsInputViewTest.cs (.../WaveConditionsInputViewTest.cs) (revision 5ef2f44bca31b92735dff724f97b717c7c55f912) @@ -31,7 +31,6 @@ using Core.Components.Chart.Forms; using NUnit.Framework; using Rhino.Mocks; -using Ringtoets.Common.Data.AssessmentSection; using Ringtoets.Common.Data.DikeProfiles; using Ringtoets.Common.Data.Hydraulics; using Ringtoets.Common.Data.TestUtil; @@ -81,89 +80,48 @@ [Test] public void Constructor_InputViewStyleNull_ThrowArgumentNullException() { - // Setup - var mocks = new MockRepository(); - var assessmentSection = mocks.Stub(); - mocks.ReplayAll(); - // Call TestDelegate test = () => new WaveConditionsInputView(CreateTestCalculation(), - assessmentSection, GetHydraulicBoundaryLocationCalculation, null); // Assert var exception = Assert.Throws(test); Assert.AreEqual("inputViewStyle", exception.ParamName); - mocks.VerifyAll(); } [Test] public void Constructor_GetHydraulicBoundaryLocationCalculationFuncNull_ThrowArgumentNullException() { - // Setup - var mocks = new MockRepository(); - var assessmentSection = mocks.Stub(); - mocks.ReplayAll(); - // Call TestDelegate test = () => new WaveConditionsInputView(CreateTestCalculation(), - assessmentSection, null, new TestWaveConditionsInputViewStyle()); // Assert var exception = Assert.Throws(test); Assert.AreEqual("getHydraulicBoundaryLocationCalculationFunc", exception.ParamName); - mocks.VerifyAll(); } [Test] public void Constructor_CalculationNull_ThrowArgumentNullException() { - // Setup - var mocks = new MockRepository(); - var assessmentSection = mocks.Stub(); - mocks.ReplayAll(); - // Call TestDelegate test = () => new WaveConditionsInputView(null, - assessmentSection, GetHydraulicBoundaryLocationCalculation, new TestWaveConditionsInputViewStyle()); // Assert var exception = Assert.Throws(test); Assert.AreEqual("calculation", exception.ParamName); - mocks.VerifyAll(); } [Test] - public void Constructor_AssessmentSectionNull_ThrowArgumentNullException() - { - // Call - TestDelegate test = () => new WaveConditionsInputView(CreateTestCalculation(), - null, - GetHydraulicBoundaryLocationCalculation, - new TestWaveConditionsInputViewStyle()); - - // Assert - var exception = Assert.Throws(test); - Assert.AreEqual("assessmentSection", exception.ParamName); - } - - [Test] public void Constructor_ExpectedValues() { - // Setup - var mocks = new MockRepository(); - var assessmentSection = mocks.Stub(); - mocks.ReplayAll(); - // Call TestWaveConditionsCalculation calculation = CreateTestCalculation(); using (var view = new WaveConditionsInputView(calculation, - assessmentSection, GetHydraulicBoundaryLocationCalculation, new TestWaveConditionsInputViewStyle())) { @@ -174,8 +132,6 @@ Assert.AreSame(calculation, view.Data); Assert.AreEqual(1, view.Controls.Count); } - - mocks.VerifyAll(); } [Test] @@ -202,13 +158,8 @@ } }; - var mocks = new MockRepository(); - var assessmentSection = mocks.Stub(); - mocks.ReplayAll(); - // Call using (var view = new WaveConditionsInputView(calculation, - assessmentSection, () => GetHydraulicBoundaryLocationCalculation(assessmentLevel), new TestWaveConditionsInputViewStyle())) { @@ -253,8 +204,6 @@ calculation.InputParameters.UpperBoundaryRevetment, chartData.Collection.ElementAt(revetmentChartDataIndex)); } - - mocks.VerifyAll(); } [Test] @@ -269,12 +218,7 @@ Name = initialName }; - var mocks = new MockRepository(); - var assessmentSection = mocks.Stub(); - mocks.ReplayAll(); - using (var view = new WaveConditionsInputView(calculation, - assessmentSection, GetHydraulicBoundaryLocationCalculation, new TestWaveConditionsInputViewStyle())) { @@ -289,16 +233,13 @@ // Assert Assert.AreEqual(updatedName, view.Chart.ChartTitle); } - - mocks.VerifyAll(); } [Test] public void UpdateObserver_ForeshoreProfileUpdated_ChartDataUpdatedAndObserversNotified() { // Setup var mocks = new MockRepository(); - var assessmentSection = mocks.Stub(); var observer = mocks.StrictMock(); observer.Expect(o => o.UpdateObserver()).Repeat.Times(numberOfChartDataLayers); mocks.ReplayAll(); @@ -322,7 +263,6 @@ }; using (var view = new WaveConditionsInputView(calculation, - assessmentSection, () => GetHydraulicBoundaryLocationCalculation(assessmentLevel), new TestWaveConditionsInputViewStyle())) { @@ -424,12 +364,7 @@ var assessmentLevel = (RoundedDouble) 6; HydraulicBoundaryLocationCalculation hydraulicBoundaryLocationCalculation = GetHydraulicBoundaryLocationCalculation(assessmentLevel); - var mocks = new MockRepository(); - var assessmentSection = mocks.Stub(); - mocks.ReplayAll(); - using (var view = new WaveConditionsInputView(calculation, - assessmentSection, () => hydraulicBoundaryLocationCalculation, new TestWaveConditionsInputViewStyle())) { @@ -511,12 +446,7 @@ }; HydraulicBoundaryLocationCalculation hydraulicBoundaryLocationCalculation = GetHydraulicBoundaryLocationCalculation(new Random(39).NextRoundedDouble()); - var mocks = new MockRepository(); - var assessmentSection = mocks.Stub(); - mocks.ReplayAll(); - using (var view = new WaveConditionsInputView(calculation, - assessmentSection, () => hydraulicBoundaryLocationCalculation, new TestWaveConditionsInputViewStyle())) { @@ -595,13 +525,8 @@ } }; - var mocks = new MockRepository(); - var assessmentSection = mocks.Stub(); - mocks.ReplayAll(); - var assessmentLevel = (RoundedDouble) 6; using (var view = new WaveConditionsInputView(calculation, - assessmentSection, () => GetHydraulicBoundaryLocationCalculation(assessmentLevel), new TestWaveConditionsInputViewStyle())) {