Index: Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.Forms/PropertyClasses/DuneErosionFailureMechanismProperties.cs =================================================================== diff -u -rc46d2a5e7ce09b3233794d8782a137090b865ca2 -re5e17b215166c0d4451d922e477cc4d0a4c15205 --- Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.Forms/PropertyClasses/DuneErosionFailureMechanismProperties.cs (.../DuneErosionFailureMechanismProperties.cs) (revision c46d2a5e7ce09b3233794d8782a137090b865ca2) +++ Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.Forms/PropertyClasses/DuneErosionFailureMechanismProperties.cs (.../DuneErosionFailureMechanismProperties.cs) (revision e5e17b215166c0d4451d922e477cc4d0a4c15205) @@ -58,6 +58,7 @@ { throw new ArgumentNullException(nameof(data)); } + if (propertyChangeHandler == null) { throw new ArgumentNullException(nameof(propertyChangeHandler)); @@ -100,6 +101,7 @@ { return false; } + return true; } Index: Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.Forms/Views/DuneLocationCalculationsView.cs =================================================================== diff -u -r8fe9bd87da92837297afa5cc804ccdac8b64900d -re5e17b215166c0d4451d922e477cc4d0a4c15205 --- Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.Forms/Views/DuneLocationCalculationsView.cs (.../DuneLocationCalculationsView.cs) (revision 8fe9bd87da92837297afa5cc804ccdac8b64900d) +++ Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.Forms/Views/DuneLocationCalculationsView.cs (.../DuneLocationCalculationsView.cs) (revision e5e17b215166c0d4451d922e477cc4d0a4c15205) @@ -163,13 +163,10 @@ protected override void CalculateForSelectedRows() { - if (CalculationGuiService != null) - { - CalculationGuiService.Calculate(GetSelectedCalculatableObjects(), - AssessmentSection.HydraulicBoundaryDatabase.FilePath, - AssessmentSection.HydraulicBoundaryDatabase.EffectivePreprocessorDirectory(), - getNormFunc()); - } + CalculationGuiService?.Calculate(GetSelectedCalculatableObjects(), + AssessmentSection.HydraulicBoundaryDatabase.FilePath, + AssessmentSection.HydraulicBoundaryDatabase.EffectivePreprocessorDirectory(), + getNormFunc()); } protected override string ValidateCalculatableObjects() Index: Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.IO/DuneLocationsReader.cs =================================================================== diff -u -r5b1b0a2b698e20d3972e2a8f511b4f49dc1cfcd0 -re5e17b215166c0d4451d922e477cc4d0a4c15205 --- Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.IO/DuneLocationsReader.cs (.../DuneLocationsReader.cs) (revision 5b1b0a2b698e20d3972e2a8f511b4f49dc1cfcd0) +++ Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.IO/DuneLocationsReader.cs (.../DuneLocationsReader.cs) (revision e5e17b215166c0d4451d922e477cc4d0a4c15205) @@ -70,7 +70,7 @@ } } - private IEnumerable CreateDuneLocations(FeatureBasedMapData locationsData) + private static IEnumerable CreateDuneLocations(FeatureBasedMapData locationsData) { foreach (MapFeature locationData in locationsData.Features) { Index: Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Data.Test/DuneLocationCalculationTest.cs =================================================================== diff -u -ree62f9ef8c69cd574bd23077bf9079e3e8fbdd8c -re5e17b215166c0d4451d922e477cc4d0a4c15205 --- Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Data.Test/DuneLocationCalculationTest.cs (.../DuneLocationCalculationTest.cs) (revision ee62f9ef8c69cd574bd23077bf9079e3e8fbdd8c) +++ Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Data.Test/DuneLocationCalculationTest.cs (.../DuneLocationCalculationTest.cs) (revision e5e17b215166c0d4451d922e477cc4d0a4c15205) @@ -55,4 +55,4 @@ Assert.IsNull(calculation.Output); } } -} +} \ No newline at end of file Index: Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Forms.Test/Factories/AggregatedDuneLocationFactoryTest.cs =================================================================== diff -u -re9ffbddef7cf414f44668847e1610cecc9429fb7 -re5e17b215166c0d4451d922e477cc4d0a4c15205 --- Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Forms.Test/Factories/AggregatedDuneLocationFactoryTest.cs (.../AggregatedDuneLocationFactoryTest.cs) (revision e9ffbddef7cf414f44668847e1610cecc9429fb7) +++ Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Forms.Test/Factories/AggregatedDuneLocationFactoryTest.cs (.../AggregatedDuneLocationFactoryTest.cs) (revision e5e17b215166c0d4451d922e477cc4d0a4c15205) @@ -76,35 +76,35 @@ Assert.AreEqual(expectedDuneLocation.Offset, aggregatedDuneLocation.Offset); Assert.AreEqual(expectedDuneLocation.D50, aggregatedDuneLocation.D50); - AssertDuneLocationOutput(failureMechanism.CalculationsForMechanismSpecificFactorizedSignalingNorm, - expectedDuneLocation, - aggregatedDuneLocation.WaterLevelForMechanismSpecificFactorizedSignalingNorm, - aggregatedDuneLocation.WaveHeightForMechanismSpecificFactorizedSignalingNorm, - aggregatedDuneLocation.WavePeriodForMechanismSpecificFactorizedSignalingNorm); + AssertDuneLocationCalculationOutput(failureMechanism.CalculationsForMechanismSpecificFactorizedSignalingNorm, + expectedDuneLocation, + aggregatedDuneLocation.WaterLevelForMechanismSpecificFactorizedSignalingNorm, + aggregatedDuneLocation.WaveHeightForMechanismSpecificFactorizedSignalingNorm, + aggregatedDuneLocation.WavePeriodForMechanismSpecificFactorizedSignalingNorm); - AssertDuneLocationOutput(failureMechanism.CalculationsForMechanismSpecificSignalingNorm, - expectedDuneLocation, - aggregatedDuneLocation.WaterLevelForMechanismSpecificSignalingNorm, - aggregatedDuneLocation.WaveHeightForMechanismSpecificSignalingNorm, - aggregatedDuneLocation.WavePeriodForMechanismSpecificSignalingNorm); + AssertDuneLocationCalculationOutput(failureMechanism.CalculationsForMechanismSpecificSignalingNorm, + expectedDuneLocation, + aggregatedDuneLocation.WaterLevelForMechanismSpecificSignalingNorm, + aggregatedDuneLocation.WaveHeightForMechanismSpecificSignalingNorm, + aggregatedDuneLocation.WavePeriodForMechanismSpecificSignalingNorm); - AssertDuneLocationOutput(failureMechanism.CalculationsForMechanismSpecificLowerLimitNorm, - expectedDuneLocation, - aggregatedDuneLocation.WaterLevelForMechanismSpecificLowerLimitNorm, - aggregatedDuneLocation.WaveHeightForMechanismSpecificLowerLimitNorm, - aggregatedDuneLocation.WavePeriodForMechanismSpecificLowerLimitNorm); + AssertDuneLocationCalculationOutput(failureMechanism.CalculationsForMechanismSpecificLowerLimitNorm, + expectedDuneLocation, + aggregatedDuneLocation.WaterLevelForMechanismSpecificLowerLimitNorm, + aggregatedDuneLocation.WaveHeightForMechanismSpecificLowerLimitNorm, + aggregatedDuneLocation.WavePeriodForMechanismSpecificLowerLimitNorm); - AssertDuneLocationOutput(failureMechanism.CalculationsForLowerLimitNorm, - expectedDuneLocation, - aggregatedDuneLocation.WaterLevelForLowerLimitNorm, - aggregatedDuneLocation.WaveHeightForLowerLimitNorm, - aggregatedDuneLocation.WavePeriodForLowerLimitNorm); + AssertDuneLocationCalculationOutput(failureMechanism.CalculationsForLowerLimitNorm, + expectedDuneLocation, + aggregatedDuneLocation.WaterLevelForLowerLimitNorm, + aggregatedDuneLocation.WaveHeightForLowerLimitNorm, + aggregatedDuneLocation.WavePeriodForLowerLimitNorm); - AssertDuneLocationOutput(failureMechanism.CalculationsForFactorizedLowerLimitNorm, - expectedDuneLocation, - aggregatedDuneLocation.WaterLevelForFactorizedLowerLimitNorm, - aggregatedDuneLocation.WaveHeightForFactorizedLowerLimitNorm, - aggregatedDuneLocation.WavePeriodForFactorizedLowerLimitNorm); + AssertDuneLocationCalculationOutput(failureMechanism.CalculationsForFactorizedLowerLimitNorm, + expectedDuneLocation, + aggregatedDuneLocation.WaterLevelForFactorizedLowerLimitNorm, + aggregatedDuneLocation.WaveHeightForFactorizedLowerLimitNorm, + aggregatedDuneLocation.WavePeriodForFactorizedLowerLimitNorm); } } @@ -171,11 +171,11 @@ }); } - private static void AssertDuneLocationOutput(IEnumerable calculations, - DuneLocation duneLocation, - RoundedDouble getWaterLevelFunc, - RoundedDouble getWaveHeightFunc, - RoundedDouble getWavePeriodFunc) + private static void AssertDuneLocationCalculationOutput(IEnumerable calculations, + DuneLocation duneLocation, + RoundedDouble getWaterLevelFunc, + RoundedDouble getWaveHeightFunc, + RoundedDouble getWavePeriodFunc) { DuneLocationCalculationOutput expectedOutput = calculations.Single(calculation => ReferenceEquals(duneLocation, calculation.DuneLocation)) Index: Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Forms.Test/GuiServices/DuneLocationCalculationGuiServiceTest.cs =================================================================== diff -u -r886f53016571b5d7a65318c6e29d6da9385bbade -re5e17b215166c0d4451d922e477cc4d0a4c15205 --- Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Forms.Test/GuiServices/DuneLocationCalculationGuiServiceTest.cs (.../DuneLocationCalculationGuiServiceTest.cs) (revision 886f53016571b5d7a65318c6e29d6da9385bbade) +++ Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Forms.Test/GuiServices/DuneLocationCalculationGuiServiceTest.cs (.../DuneLocationCalculationGuiServiceTest.cs) (revision e5e17b215166c0d4451d922e477cc4d0a4c15205) @@ -201,7 +201,7 @@ var guiService = new DuneLocationCalculationGuiService(viewParent); // Call - Action call = () => guiService.Calculate(new [] + Action call = () => guiService.Calculate(new[] { new DuneLocationCalculation(new TestDuneLocation(duneLocationName)) }, Index: Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Forms.Test/PresentationObjects/DuneLocationCalculationsContextTest.cs =================================================================== diff -u -r6eba4a9d9763f1177d692dd9c557714df1de802b -re5e17b215166c0d4451d922e477cc4d0a4c15205 --- Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Forms.Test/PresentationObjects/DuneLocationCalculationsContextTest.cs (.../DuneLocationCalculationsContextTest.cs) (revision 6eba4a9d9763f1177d692dd9c557714df1de802b) +++ Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Forms.Test/PresentationObjects/DuneLocationCalculationsContextTest.cs (.../DuneLocationCalculationsContextTest.cs) (revision e5e17b215166c0d4451d922e477cc4d0a4c15205) @@ -131,7 +131,7 @@ // Call TestDelegate call = () => new DuneLocationCalculationsContext(new ObservableList(), - new DuneErosionFailureMechanism(), + new DuneErosionFailureMechanism(), assessmentSection, () => 0.01, null); @@ -151,7 +151,7 @@ // Call TestDelegate call = () => new DuneLocationCalculationsContext(new ObservableList(), - new DuneErosionFailureMechanism(), + new DuneErosionFailureMechanism(), assessmentSection, () => 0.01, string.Empty); Index: Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Forms.Test/PropertyClasses/DuneLocationCalculationsPropertiesTest.cs =================================================================== diff -u -r96238ba8b5baef941ae8a1ca49a431f1c9e4800d -re5e17b215166c0d4451d922e477cc4d0a4c15205 --- Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Forms.Test/PropertyClasses/DuneLocationCalculationsPropertiesTest.cs (.../DuneLocationCalculationsPropertiesTest.cs) (revision 96238ba8b5baef941ae8a1ca49a431f1c9e4800d) +++ Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Forms.Test/PropertyClasses/DuneLocationCalculationsPropertiesTest.cs (.../DuneLocationCalculationsPropertiesTest.cs) (revision e5e17b215166c0d4451d922e477cc4d0a4c15205) @@ -111,7 +111,6 @@ using (var properties = new DuneLocationCalculationsProperties(duneLocationCalculations)) { - var refreshRequiredRaised = 0; properties.RefreshRequired += (sender, args) => refreshRequiredRaised++; @@ -135,7 +134,6 @@ using (var properties = new DuneLocationCalculationsProperties(duneLocationCalculations)) { - var refreshRequiredRaised = 0; properties.RefreshRequired += (sender, args) => refreshRequiredRaised++; Index: Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Forms.Test/Views/DuneErosionFailureMechanismViewTest.cs =================================================================== diff -u -re9ffbddef7cf414f44668847e1610cecc9429fb7 -re5e17b215166c0d4451d922e477cc4d0a4c15205 --- Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Forms.Test/Views/DuneErosionFailureMechanismViewTest.cs (.../DuneErosionFailureMechanismViewTest.cs) (revision e9ffbddef7cf414f44668847e1610cecc9429fb7) +++ Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Forms.Test/Views/DuneErosionFailureMechanismViewTest.cs (.../DuneErosionFailureMechanismViewTest.cs) (revision e5e17b215166c0d4451d922e477cc4d0a4c15205) @@ -416,26 +416,6 @@ Assert.AreEqual("Hydraulische randvoorwaarden", duneLocationsMapData.Name); } - private static void AssertDuneLocationsMapData(IEnumerable duneLocations, MapData mapData) - { - Assert.IsInstanceOf(mapData); - var duneLocationsMapData = (MapPointData) mapData; - if (duneLocations == null) - { - CollectionAssert.IsEmpty(duneLocationsMapData.Features); - } - else - { - DuneLocation[] duneLocationsArray = duneLocations.ToArray(); - - Assert.AreEqual(duneLocationsArray.Length, duneLocationsMapData.Features.Count()); - CollectionAssert.AreEqual(duneLocationsArray.Select(duneLocation => duneLocation.Location), - duneLocationsMapData.Features.SelectMany(f => f.MapGeometries.First().PointCollections.First())); - } - - Assert.AreEqual("Hydraulische randvoorwaarden", mapData.Name); - } - private static void AssertDuneLocationsMapData(DuneErosionFailureMechanism failureMechanism, MapData mapData) { Index: Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.IO.Test/DuneLocationCalculationsWriterTest.cs =================================================================== diff -u -r649b0974fb71df7368d19682bc255618f44d49c1 -re5e17b215166c0d4451d922e477cc4d0a4c15205 --- Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.IO.Test/DuneLocationCalculationsWriterTest.cs (.../DuneLocationCalculationsWriterTest.cs) (revision 649b0974fb71df7368d19682bc255618f44d49c1) +++ Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.IO.Test/DuneLocationCalculationsWriterTest.cs (.../DuneLocationCalculationsWriterTest.cs) (revision e5e17b215166c0d4451d922e477cc4d0a4c15205) @@ -99,7 +99,7 @@ // Call TestDelegate call = () => DuneLocationCalculationsWriter.WriteDuneLocationCalculations(Enumerable.Empty(), filePath); - + // Assert var exception = Assert.Throws(call); Assert.AreEqual($"Er is een onverwachte fout opgetreden tijdens het schrijven van het bestand '{filePath}'.", exception.Message); Index: Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Plugin.Test/DuneErosionPluginTest.cs =================================================================== diff -u -rd4a4f6fc0626fe052dc73d5bdba16a28a82e299d -re5e17b215166c0d4451d922e477cc4d0a4c15205 --- Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Plugin.Test/DuneErosionPluginTest.cs (.../DuneErosionPluginTest.cs) (revision d4a4f6fc0626fe052dc73d5bdba16a28a82e299d) +++ Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Plugin.Test/DuneErosionPluginTest.cs (.../DuneErosionPluginTest.cs) (revision e5e17b215166c0d4451d922e477cc4d0a4c15205) @@ -20,7 +20,6 @@ // All rights reserved. using System; -using System.Collections.Generic; using System.Linq; using Core.Common.Base; using Core.Common.Controls.TreeView; Index: Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Plugin.Test/PropertyInfos/DuneErosionFailureMechanismPropertyInfoTest.cs =================================================================== diff -u -ra5bf4f56dbf07e5cf48d0b874f5d46d7d02f0dba -re5e17b215166c0d4451d922e477cc4d0a4c15205 --- Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Plugin.Test/PropertyInfos/DuneErosionFailureMechanismPropertyInfoTest.cs (.../DuneErosionFailureMechanismPropertyInfoTest.cs) (revision a5bf4f56dbf07e5cf48d0b874f5d46d7d02f0dba) +++ Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Plugin.Test/PropertyInfos/DuneErosionFailureMechanismPropertyInfoTest.cs (.../DuneErosionFailureMechanismPropertyInfoTest.cs) (revision e5e17b215166c0d4451d922e477cc4d0a4c15205) @@ -71,6 +71,7 @@ Assert.IsInstanceOf(objectProperties); Assert.AreSame(failureMechanism, objectProperties.Data); } + mocks.VerifyAll(); } Index: Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Plugin.Test/TreeNodeInfos/DuneErosionFailureMechanismSectionResultContextTreeNodeInfoTest.cs =================================================================== diff -u -r3178e116f5e59e03078d465efeb303c5e232c7bf -re5e17b215166c0d4451d922e477cc4d0a4c15205 --- Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Plugin.Test/TreeNodeInfos/DuneErosionFailureMechanismSectionResultContextTreeNodeInfoTest.cs (.../DuneErosionFailureMechanismSectionResultContextTreeNodeInfoTest.cs) (revision 3178e116f5e59e03078d465efeb303c5e232c7bf) +++ Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Plugin.Test/TreeNodeInfos/DuneErosionFailureMechanismSectionResultContextTreeNodeInfoTest.cs (.../DuneErosionFailureMechanismSectionResultContextTreeNodeInfoTest.cs) (revision e5e17b215166c0d4451d922e477cc4d0a4c15205) @@ -133,6 +133,7 @@ // Call info.ContextMenuStrip(null, null, treeViewControl); } + // Assert // Assert expectations are called in TearDown() }