Index: Riskeer/Common/test/Riskeer.Common.Forms.Test/Views/WaveHeightCalculationsViewTest.cs =================================================================== diff -u -r96ccefa48aa5c97c949f7a7858fcb4d3dc727a3a -rbf3756be8da69ed24ee622bca79a1fe39a038df0 --- Riskeer/Common/test/Riskeer.Common.Forms.Test/Views/WaveHeightCalculationsViewTest.cs (.../WaveHeightCalculationsViewTest.cs) (revision 96ccefa48aa5c97c949f7a7858fcb4d3dc727a3a) +++ Riskeer/Common/test/Riskeer.Common.Forms.Test/Views/WaveHeightCalculationsViewTest.cs (.../WaveHeightCalculationsViewTest.cs) (revision bf3756be8da69ed24ee622bca79a1fe39a038df0) @@ -77,34 +77,32 @@ mockRepository.ReplayAll(); // Call - TestDelegate test = () => new WaveHeightCalculationsView(new ObservableList(), - assessmentSection, - null, - "A"); + void Call() => new WaveHeightCalculationsView(new ObservableList(), + assessmentSection, + null, + () => "1/100"); // Assert - var exception = Assert.Throws(test); + var exception = Assert.Throws(Call); Assert.AreEqual("getNormFunc", exception.ParamName); } [Test] - [TestCase(null)] - [TestCase("")] - public void Constructor_CategoryBoundaryNameInvalid_ThrowsArgumentException(string categoryBoundaryName) + public void Constructor_GetCalculationIdentifierFuncNull_ThrowsArgumentNullException() { // Setup IAssessmentSection assessmentSection = AssessmentSectionTestHelper.CreateAssessmentSectionStub(mockRepository); mockRepository.ReplayAll(); // Call - TestDelegate test = () => new WaveHeightCalculationsView(new ObservableList(), - assessmentSection, - () => 0.01, - categoryBoundaryName); + void Call() => new WaveHeightCalculationsView(new ObservableList(), + assessmentSection, + () => 0.01, + null); // Assert - var exception = Assert.Throws(test); - Assert.AreEqual("'categoryBoundaryName' must have a value.", exception.Message); + var exception = Assert.Throws(Call); + Assert.AreEqual("getCalculationIdentifierFunc", exception.ParamName); } [Test] @@ -118,7 +116,7 @@ using (var view = new WaveHeightCalculationsView(new ObservableList(), assessmentSection, () => 0.01, - "A")) + () => "1/100")) { // Assert Assert.IsInstanceOf(view); @@ -137,7 +135,7 @@ ShowWaveHeightCalculationsView(new ObservableList(), assessmentSection, 0.01, - "A", + "1/100", testForm); // Assert @@ -358,10 +356,10 @@ var button = new ButtonTester("CalculateForSelectedButton", testForm); // Call - TestDelegate test = () => button.Click(); + void Call() => button.Click(); // Assert - Assert.DoesNotThrow(test); + Assert.DoesNotThrow(Call); } [Test] @@ -370,7 +368,7 @@ // Setup const string databaseFilePath = "DatabaseFilePath"; const double norm = 0.01; - const string categoryBoundaryName = "A"; + const string calculationIdentifier = "1/100"; var assessmentSection = mockRepository.Stub(); var hydraulicBoundaryDatabase = new HydraulicBoundaryDatabase @@ -389,14 +387,14 @@ IAssessmentSection assessmentSectionValue = null; HydraulicBoundaryLocationCalculation[] performedCalculations = null; double normValue = double.NaN; - string categoryBoundaryNameValue = null; + string calculationIdentifierValue = null; guiService.Expect(ch => ch.CalculateWaveHeights(null, null, int.MinValue, null)).IgnoreArguments().WhenCalled( invocation => { performedCalculations = ((IEnumerable) invocation.Arguments[0]).ToArray(); assessmentSectionValue = (IAssessmentSection) invocation.Arguments[1]; normValue = (double) invocation.Arguments[2]; - categoryBoundaryNameValue = (string) invocation.Arguments[3]; + calculationIdentifierValue = (string) invocation.Arguments[3]; }); mockRepository.ReplayAll(); @@ -406,7 +404,7 @@ WaveHeightCalculationsView view = ShowWaveHeightCalculationsView(hydraulicBoundaryLocationCalculations, assessmentSection, norm, - categoryBoundaryName, + calculationIdentifier, testForm); DataGridView calculationsDataGridView = GetCalculationsDataGridView(); @@ -420,7 +418,7 @@ button.Click(); // Assert - Assert.AreEqual(categoryBoundaryName, categoryBoundaryNameValue); + Assert.AreEqual(calculationIdentifier, calculationIdentifierValue); Assert.AreSame(assessmentSection, assessmentSectionValue); Assert.AreEqual(norm, normValue); Assert.AreEqual(1, performedCalculations.Length); @@ -460,13 +458,13 @@ private static WaveHeightCalculationsView ShowWaveHeightCalculationsView(IObservableEnumerable calculations, IAssessmentSection assessmentSection, double norm, - string categoryBoundaryName, + string calculationIdentifier, Form form) { var view = new WaveHeightCalculationsView(calculations, assessmentSection, () => norm, - categoryBoundaryName); + () => calculationIdentifier); form.Controls.Add(view); form.Show(); @@ -479,7 +477,7 @@ { var assessmentSection = new AssessmentSectionStub(); - return ShowWaveHeightCalculationsView(calculations, assessmentSection, 0.01, "A", form); + return ShowWaveHeightCalculationsView(calculations, assessmentSection, 0.01, "1/100", form); } private static ObservableList GetTestHydraulicBoundaryLocationCalculations()