Index: Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/Views/GrassCoverErosionOutwardsDesignWaterLevelLocationsViewTest.cs =================================================================== diff -u -rd372d283df25bff1c4c41c6c544929a38917004e -rf81cdf78d5aac96ca1d450216b26cfb1b6b74b52 --- Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/Views/GrassCoverErosionOutwardsDesignWaterLevelLocationsViewTest.cs (.../GrassCoverErosionOutwardsDesignWaterLevelLocationsViewTest.cs) (revision d372d283df25bff1c4c41c6c544929a38917004e) +++ Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/Views/GrassCoverErosionOutwardsDesignWaterLevelLocationsViewTest.cs (.../GrassCoverErosionOutwardsDesignWaterLevelLocationsViewTest.cs) (revision f81cdf78d5aac96ca1d450216b26cfb1b6b74b52) @@ -338,8 +338,7 @@ // Assert Assert.AreEqual(1, performedCalculations.Length); - HydraulicBoundaryLocation expectedLocation = view.FailureMechanism.HydraulicBoundaryLocations.First(); - Assert.AreSame(expectedLocation, performedCalculations.First().HydraulicBoundaryLocation); + Assert.AreSame(view.FailureMechanism.HydraulicBoundaryLocations.First(), performedCalculations.First().HydraulicBoundaryLocation); Assert.AreSame(dataGridViewSource, locationsDataGridView.DataSource); Assert.IsTrue((bool) rows[0].Cells[locationCalculateColumnIndex].Value); Assert.IsFalse((bool) rows[1].Cells[locationCalculateColumnIndex].Value); @@ -421,19 +420,17 @@ var hydraulicBoundaryDatabaseFilePathValue = ""; var preprocessorDirectoryValue = ""; - HydraulicBoundaryLocation[] calculatedLocationsValue = null; - Func getCalculationFunc = null; + HydraulicBoundaryLocationCalculation[] performedCalculations = null; double normValue = double.NaN; ICalculationMessageProvider messageProviderValue = null; - guiService.Expect(ch => ch.CalculateDesignWaterLevels(null, null, null, null, int.MinValue, null)).IgnoreArguments().WhenCalled( + guiService.Expect(ch => ch.CalculateDesignWaterLevels(null, null, null, int.MinValue, null)).IgnoreArguments().WhenCalled( invocation => { hydraulicBoundaryDatabaseFilePathValue = invocation.Arguments[0].ToString(); preprocessorDirectoryValue = invocation.Arguments[1].ToString(); - calculatedLocationsValue = ((IEnumerable) invocation.Arguments[2]).ToArray(); - getCalculationFunc = (Func) invocation.Arguments[3]; - normValue = (double) invocation.Arguments[4]; - messageProviderValue = (ICalculationMessageProvider) invocation.Arguments[5]; + performedCalculations = ((IEnumerable) invocation.Arguments[2]).ToArray(); + normValue = (double) invocation.Arguments[3]; + messageProviderValue = (ICalculationMessageProvider) invocation.Arguments[4]; }); mockRepository.ReplayAll(); @@ -442,7 +439,6 @@ GrassCoverErosionOutwardsDesignWaterLevelLocationsView view = ShowFullyConfiguredDesignWaterLevelLocationsView(assessmentSection, norm, testForm); GrassCoverErosionOutwardsFailureMechanism failureMechanism = view.FailureMechanism; - ObservableList locations = failureMechanism.HydraulicBoundaryLocations; DataGridView locationsDataGridView = GetLocationsDataGridView(); DataGridViewRowCollection rows = locationsDataGridView.Rows; rows[0].Cells[locationCalculateColumnIndex].Value = true; @@ -463,10 +459,8 @@ Assert.AreEqual(databaseFilePath, hydraulicBoundaryDatabaseFilePathValue); Assert.AreEqual("", preprocessorDirectoryValue); Assert.AreEqual(expectedNorm, normValue); - Assert.AreEqual(1, calculatedLocationsValue.Length); - HydraulicBoundaryLocation expectedLocation = locations.First(); - Assert.AreEqual(expectedLocation, calculatedLocationsValue.First()); - Assert.AreSame(expectedLocation.DesignWaterLevelCalculation1, getCalculationFunc(expectedLocation)); + Assert.AreEqual(1, performedCalculations.Length); + Assert.AreSame(failureMechanism.HydraulicBoundaryLocations.First(), performedCalculations.First().HydraulicBoundaryLocation); } [Test] @@ -488,19 +482,17 @@ var hydraulicBoundaryDatabaseFilePathValue = ""; var preprocessorDirectoryValue = ""; - HydraulicBoundaryLocation[] calculatedLocationsValue = null; - Func getCalculationFunc = null; + HydraulicBoundaryLocationCalculation[] performedCalculations = null; double normValue = double.NaN; ICalculationMessageProvider messageProviderValue = null; - guiService.Expect(ch => ch.CalculateDesignWaterLevels(null, null, null, null, int.MinValue, null)).IgnoreArguments().WhenCalled( + guiService.Expect(ch => ch.CalculateDesignWaterLevels(null, null, null, int.MinValue, null)).IgnoreArguments().WhenCalled( invocation => { hydraulicBoundaryDatabaseFilePathValue = invocation.Arguments[0].ToString(); preprocessorDirectoryValue = invocation.Arguments[1].ToString(); - calculatedLocationsValue = ((IEnumerable) invocation.Arguments[2]).ToArray(); - getCalculationFunc = (Func) invocation.Arguments[3]; - normValue = (double) invocation.Arguments[4]; - messageProviderValue = (ICalculationMessageProvider) invocation.Arguments[5]; + performedCalculations = ((IEnumerable) invocation.Arguments[2]).ToArray(); + normValue = (double) invocation.Arguments[3]; + messageProviderValue = (ICalculationMessageProvider) invocation.Arguments[4]; }); mockRepository.ReplayAll(); @@ -533,10 +525,8 @@ Assert.AreEqual(databaseFilePath, hydraulicBoundaryDatabaseFilePathValue); Assert.AreEqual(preprocessorDirectory, preprocessorDirectoryValue); Assert.AreEqual(expectedNorm, normValue); - Assert.AreEqual(1, calculatedLocationsValue.Length); - HydraulicBoundaryLocation expectedLocation = failureMechanism.HydraulicBoundaryLocations.First(); - Assert.AreEqual(expectedLocation, calculatedLocationsValue.First()); - Assert.AreSame(expectedLocation.DesignWaterLevelCalculation1, getCalculationFunc(expectedLocation)); + Assert.AreEqual(1, performedCalculations.Length); + Assert.AreSame(failureMechanism.HydraulicBoundaryLocations.First(), performedCalculations.First().HydraulicBoundaryLocation); } [Test] @@ -557,19 +547,17 @@ var hydraulicBoundaryDatabaseFilePathValue = ""; var preprocessorDirectoryValue = ""; - HydraulicBoundaryLocation[] calculatedLocationsValue = null; - Func getCalculationFunc = null; + HydraulicBoundaryLocationCalculation[] performedCalculations = null; double normValue = double.NaN; ICalculationMessageProvider messageProviderValue = null; - guiService.Expect(ch => ch.CalculateDesignWaterLevels(null, null, null, null, int.MinValue, null)).IgnoreArguments().WhenCalled( + guiService.Expect(ch => ch.CalculateDesignWaterLevels(null, null, null, int.MinValue, null)).IgnoreArguments().WhenCalled( invocation => { hydraulicBoundaryDatabaseFilePathValue = invocation.Arguments[0].ToString(); preprocessorDirectoryValue = invocation.Arguments[1].ToString(); - calculatedLocationsValue = ((IEnumerable) invocation.Arguments[2]).ToArray(); - getCalculationFunc = (Func) invocation.Arguments[3]; - normValue = (double) invocation.Arguments[4]; - messageProviderValue = (ICalculationMessageProvider) invocation.Arguments[5]; + performedCalculations = ((IEnumerable) invocation.Arguments[2]).ToArray(); + normValue = (double) invocation.Arguments[3]; + messageProviderValue = (ICalculationMessageProvider) invocation.Arguments[4]; }); mockRepository.ReplayAll(); @@ -602,10 +590,8 @@ Assert.AreEqual(databaseFilePath, hydraulicBoundaryDatabaseFilePathValue); Assert.AreEqual("", preprocessorDirectoryValue); Assert.AreEqual(expectedNorm, normValue); - Assert.AreEqual(1, calculatedLocationsValue.Length); - HydraulicBoundaryLocation expectedLocation = failureMechanism.HydraulicBoundaryLocations.First(); - Assert.AreEqual(expectedLocation, calculatedLocationsValue.First()); - Assert.AreSame(expectedLocation.DesignWaterLevelCalculation1, getCalculationFunc(expectedLocation)); + Assert.AreEqual(1, performedCalculations.Length); + Assert.AreSame(failureMechanism.HydraulicBoundaryLocations.First(), performedCalculations.First().HydraulicBoundaryLocation); } private DataGridView GetLocationsDataGridView() Index: Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/Views/GrassCoverErosionOutwardsWaveHeightLocationsViewTest.cs =================================================================== diff -u -rd372d283df25bff1c4c41c6c544929a38917004e -rf81cdf78d5aac96ca1d450216b26cfb1b6b74b52 --- Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/Views/GrassCoverErosionOutwardsWaveHeightLocationsViewTest.cs (.../GrassCoverErosionOutwardsWaveHeightLocationsViewTest.cs) (revision d372d283df25bff1c4c41c6c544929a38917004e) +++ Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/Views/GrassCoverErosionOutwardsWaveHeightLocationsViewTest.cs (.../GrassCoverErosionOutwardsWaveHeightLocationsViewTest.cs) (revision f81cdf78d5aac96ca1d450216b26cfb1b6b74b52) @@ -338,8 +338,7 @@ // Assert Assert.AreEqual(1, performedCalculations.Length); - HydraulicBoundaryLocation expectedLocation = view.FailureMechanism.HydraulicBoundaryLocations.First(); - Assert.AreSame(expectedLocation, performedCalculations.First().HydraulicBoundaryLocation); + Assert.AreSame(view.FailureMechanism.HydraulicBoundaryLocations.First(), performedCalculations.First().HydraulicBoundaryLocation); Assert.AreSame(dataGridViewSource, locationsDataGridView.DataSource); Assert.IsTrue((bool) rows[0].Cells[locationCalculateColumnIndex].Value); Assert.IsFalse((bool) rows[1].Cells[locationCalculateColumnIndex].Value); @@ -421,19 +420,17 @@ var hydraulicBoundaryDatabaseFilePathValue = ""; var preprocessorDirectoryValue = ""; - HydraulicBoundaryLocation[] calculatedLocationsValue = null; - Func getCalculationFunc = null; + HydraulicBoundaryLocationCalculation[] performedCalculations = null; double normValue = double.NaN; ICalculationMessageProvider messageProviderValue = null; - guiService.Expect(ch => ch.CalculateWaveHeights(null, null, null, null, int.MinValue, null)).IgnoreArguments().WhenCalled( + guiService.Expect(ch => ch.CalculateWaveHeights(null, null, null, int.MinValue, null)).IgnoreArguments().WhenCalled( invocation => { hydraulicBoundaryDatabaseFilePathValue = invocation.Arguments[0].ToString(); preprocessorDirectoryValue = invocation.Arguments[1].ToString(); - calculatedLocationsValue = ((IEnumerable) invocation.Arguments[2]).ToArray(); - getCalculationFunc = (Func) invocation.Arguments[3]; - normValue = (double) invocation.Arguments[4]; - messageProviderValue = (ICalculationMessageProvider) invocation.Arguments[5]; + performedCalculations = ((IEnumerable) invocation.Arguments[2]).ToArray(); + normValue = (double) invocation.Arguments[3]; + messageProviderValue = (ICalculationMessageProvider) invocation.Arguments[4]; }); mockRepository.ReplayAll(); @@ -462,10 +459,8 @@ Assert.AreEqual(databaseFilePath, hydraulicBoundaryDatabaseFilePathValue); Assert.AreEqual("", preprocessorDirectoryValue); Assert.AreEqual(expectedNorm, normValue); - Assert.AreEqual(1, calculatedLocationsValue.Length); - HydraulicBoundaryLocation expectedLocation = failureMechanism.HydraulicBoundaryLocations.First(); - Assert.AreEqual(expectedLocation, calculatedLocationsValue.First()); - Assert.AreSame(expectedLocation.WaveHeightCalculation1, getCalculationFunc(expectedLocation)); + Assert.AreEqual(1, performedCalculations.Length); + Assert.AreSame(failureMechanism.HydraulicBoundaryLocations.First(), performedCalculations.First().HydraulicBoundaryLocation); } [Test] @@ -487,19 +482,17 @@ var hydraulicBoundaryDatabaseFilePathValue = ""; var preprocessorDirectoryValue = ""; - HydraulicBoundaryLocation[] calculatedLocationsValue = null; - Func getCalculationFunc = null; + HydraulicBoundaryLocationCalculation[] performedCalculations = null; double normValue = double.NaN; ICalculationMessageProvider messageProviderValue = null; - guiService.Expect(ch => ch.CalculateWaveHeights(null, null, null, null, int.MinValue, null)).IgnoreArguments().WhenCalled( + guiService.Expect(ch => ch.CalculateWaveHeights(null, null, null, int.MinValue, null)).IgnoreArguments().WhenCalled( invocation => { hydraulicBoundaryDatabaseFilePathValue = invocation.Arguments[0].ToString(); preprocessorDirectoryValue = invocation.Arguments[1].ToString(); - calculatedLocationsValue = ((IEnumerable) invocation.Arguments[2]).ToArray(); - getCalculationFunc = (Func) invocation.Arguments[3]; - normValue = (double) invocation.Arguments[4]; - messageProviderValue = (ICalculationMessageProvider) invocation.Arguments[5]; + performedCalculations = ((IEnumerable) invocation.Arguments[2]).ToArray(); + normValue = (double) invocation.Arguments[3]; + messageProviderValue = (ICalculationMessageProvider) invocation.Arguments[4]; }); mockRepository.ReplayAll(); @@ -532,10 +525,8 @@ Assert.AreEqual(databaseFilePath, hydraulicBoundaryDatabaseFilePathValue); Assert.AreEqual(preprocessorDirectory, preprocessorDirectoryValue); Assert.AreEqual(expectedNorm, normValue); - Assert.AreEqual(1, calculatedLocationsValue.Length); - HydraulicBoundaryLocation expectedLocation = failureMechanism.HydraulicBoundaryLocations.First(); - Assert.AreEqual(expectedLocation, calculatedLocationsValue.First()); - Assert.AreSame(expectedLocation.WaveHeightCalculation1, getCalculationFunc(expectedLocation)); + Assert.AreEqual(1, performedCalculations.Length); + Assert.AreSame(failureMechanism.HydraulicBoundaryLocations.First(), performedCalculations.First().HydraulicBoundaryLocation); } [Test] @@ -556,19 +547,17 @@ var hydraulicBoundaryDatabaseFilePathValue = ""; var preprocessorDirectoryValue = ""; - HydraulicBoundaryLocation[] calculatedLocationsValue = null; - Func getCalculationFunc = null; + HydraulicBoundaryLocationCalculation[] performedCalculations = null; double normValue = double.NaN; ICalculationMessageProvider messageProviderValue = null; - guiService.Expect(ch => ch.CalculateWaveHeights(null, null, null, null, int.MinValue, null)).IgnoreArguments().WhenCalled( + guiService.Expect(ch => ch.CalculateWaveHeights(null, null, null, int.MinValue, null)).IgnoreArguments().WhenCalled( invocation => { hydraulicBoundaryDatabaseFilePathValue = invocation.Arguments[0].ToString(); preprocessorDirectoryValue = invocation.Arguments[1].ToString(); - calculatedLocationsValue = ((IEnumerable) invocation.Arguments[2]).ToArray(); - getCalculationFunc = (Func) invocation.Arguments[3]; - normValue = (double) invocation.Arguments[4]; - messageProviderValue = (ICalculationMessageProvider) invocation.Arguments[5]; + performedCalculations = ((IEnumerable) invocation.Arguments[2]).ToArray(); + normValue = (double) invocation.Arguments[3]; + messageProviderValue = (ICalculationMessageProvider) invocation.Arguments[4]; }); mockRepository.ReplayAll(); @@ -601,10 +590,8 @@ Assert.AreEqual(databaseFilePath, hydraulicBoundaryDatabaseFilePathValue); Assert.AreEqual("", preprocessorDirectoryValue); Assert.AreEqual(expectedNorm, normValue); - Assert.AreEqual(1, calculatedLocationsValue.Length); - HydraulicBoundaryLocation expectedLocation = failureMechanism.HydraulicBoundaryLocations.First(); - Assert.AreEqual(expectedLocation, calculatedLocationsValue.First()); - Assert.AreSame(expectedLocation.WaveHeightCalculation1, getCalculationFunc(expectedLocation)); + Assert.AreEqual(1, performedCalculations.Length); + Assert.AreSame(failureMechanism.HydraulicBoundaryLocations.First(), performedCalculations.First().HydraulicBoundaryLocation); } private DataGridView GetLocationsDataGridView()