Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PresentationObjects/DesignWaterLevelLocationContextTest.cs =================================================================== diff -u -rb17eb09f96cdd37af57cb0c615d36366298abc07 -re61200e6c946ac66439f9788cb96dd1ca76c1a7d --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PresentationObjects/DesignWaterLevelLocationContextTest.cs (.../DesignWaterLevelLocationContextTest.cs) (revision b17eb09f96cdd37af57cb0c615d36366298abc07) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PresentationObjects/DesignWaterLevelLocationContextTest.cs (.../DesignWaterLevelLocationContextTest.cs) (revision e61200e6c946ac66439f9788cb96dd1ca76c1a7d) @@ -33,15 +33,15 @@ { // Setup var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(1, "name", 2.0, 3.0); - var calculation = new HydraulicBoundaryLocationCalculation(); + var hydraulicBoundaryLocationCalculation = new HydraulicBoundaryLocationCalculation(hydraulicBoundaryLocation); // Call - var presentationObject = new DesignWaterLevelLocationContext(hydraulicBoundaryLocation, calculation); + var presentationObject = new DesignWaterLevelLocationContext(hydraulicBoundaryLocation, hydraulicBoundaryLocationCalculation); // Assert Assert.IsInstanceOf(presentationObject); Assert.AreSame(hydraulicBoundaryLocation, presentationObject.WrappedData); - Assert.AreSame(calculation, presentationObject.Calculation); + Assert.AreSame(hydraulicBoundaryLocationCalculation, presentationObject.Calculation); } } } \ No newline at end of file Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PresentationObjects/HydraulicBoundaryLocationContextTest.cs =================================================================== diff -u -rb17eb09f96cdd37af57cb0c615d36366298abc07 -re61200e6c946ac66439f9788cb96dd1ca76c1a7d --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PresentationObjects/HydraulicBoundaryLocationContextTest.cs (.../HydraulicBoundaryLocationContextTest.cs) (revision b17eb09f96cdd37af57cb0c615d36366298abc07) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PresentationObjects/HydraulicBoundaryLocationContextTest.cs (.../HydraulicBoundaryLocationContextTest.cs) (revision e61200e6c946ac66439f9788cb96dd1ca76c1a7d) @@ -49,15 +49,15 @@ { // Setup var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(1, "Name", 2.0, 3.0); - var calculation = new HydraulicBoundaryLocationCalculation(); + var hydraulicBoundaryLocationCalculation = new HydraulicBoundaryLocationCalculation(hydraulicBoundaryLocation); // Call - var context = new TestHydraulicBoundaryLocationContext(hydraulicBoundaryLocation, calculation); + var context = new TestHydraulicBoundaryLocationContext(hydraulicBoundaryLocation, hydraulicBoundaryLocationCalculation); // Assert Assert.IsInstanceOf>(context); Assert.AreSame(hydraulicBoundaryLocation, context.WrappedData); - Assert.AreSame(calculation, context.Calculation); + Assert.AreSame(hydraulicBoundaryLocationCalculation, context.Calculation); } private class TestHydraulicBoundaryLocationContext : HydraulicBoundaryLocationContext Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PresentationObjects/WaveHeightLocationContextTest.cs =================================================================== diff -u -rb17eb09f96cdd37af57cb0c615d36366298abc07 -re61200e6c946ac66439f9788cb96dd1ca76c1a7d --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PresentationObjects/WaveHeightLocationContextTest.cs (.../WaveHeightLocationContextTest.cs) (revision b17eb09f96cdd37af57cb0c615d36366298abc07) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PresentationObjects/WaveHeightLocationContextTest.cs (.../WaveHeightLocationContextTest.cs) (revision e61200e6c946ac66439f9788cb96dd1ca76c1a7d) @@ -33,15 +33,15 @@ { // Setup var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(1, "name", 2.0, 3.0); - var calculation = new HydraulicBoundaryLocationCalculation(); + var hydraulicBoundaryLocationCalculation = new HydraulicBoundaryLocationCalculation(hydraulicBoundaryLocation); // Call - var presentationObject = new WaveHeightLocationContext(hydraulicBoundaryLocation, calculation); + var presentationObject = new WaveHeightLocationContext(hydraulicBoundaryLocation, hydraulicBoundaryLocationCalculation); // Assert Assert.IsInstanceOf(presentationObject); Assert.AreSame(hydraulicBoundaryLocation, presentationObject.WrappedData); - Assert.AreSame(calculation, presentationObject.Calculation); + Assert.AreSame(hydraulicBoundaryLocationCalculation, presentationObject.Calculation); } } } \ No newline at end of file Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/DesignWaterLevelLocationsViewTest.cs =================================================================== diff -u -rcde4b8def5d5104b595c2500c0347fdf601da431 -re61200e6c946ac66439f9788cb96dd1ca76c1a7d --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/DesignWaterLevelLocationsViewTest.cs (.../DesignWaterLevelLocationsViewTest.cs) (revision cde4b8def5d5104b595c2500c0347fdf601da431) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/DesignWaterLevelLocationsViewTest.cs (.../DesignWaterLevelLocationsViewTest.cs) (revision e61200e6c946ac66439f9788cb96dd1ca76c1a7d) @@ -81,7 +81,7 @@ // Call TestDelegate test = () => new DesignWaterLevelLocationsView(new ObservableList(), - hbl => new HydraulicBoundaryLocationCalculation(), + hbl => new HydraulicBoundaryLocationCalculation(hbl), assessmentSection, null, "Category"); @@ -100,7 +100,7 @@ // Call using (var view = new DesignWaterLevelLocationsView(new ObservableList(), - hbl => new HydraulicBoundaryLocationCalculation(), + hbl => new HydraulicBoundaryLocationCalculation(hbl), assessmentSection, () => 0.01, "Category")) Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/WaveHeightLocationsViewTest.cs =================================================================== diff -u -rcde4b8def5d5104b595c2500c0347fdf601da431 -re61200e6c946ac66439f9788cb96dd1ca76c1a7d --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/WaveHeightLocationsViewTest.cs (.../WaveHeightLocationsViewTest.cs) (revision cde4b8def5d5104b595c2500c0347fdf601da431) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/WaveHeightLocationsViewTest.cs (.../WaveHeightLocationsViewTest.cs) (revision e61200e6c946ac66439f9788cb96dd1ca76c1a7d) @@ -81,7 +81,7 @@ // Call TestDelegate test = () => new WaveHeightLocationsView(new ObservableList(), - hbl => new HydraulicBoundaryLocationCalculation(), + hbl => new HydraulicBoundaryLocationCalculation(hbl), assessmentSection, null, "Category"); @@ -100,7 +100,7 @@ // Call using (var view = new WaveHeightLocationsView(new ObservableList(), - hbl => new HydraulicBoundaryLocationCalculation(), + hbl => new HydraulicBoundaryLocationCalculation(hbl), assessmentSection, () => 0.01, "Category")) Index: Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/PropertyInfos/DesignWaterLevelLocationContextPropertyInfoTest.cs =================================================================== diff -u -r070acdcdc07854f93138da547e97dd7754a5ffc7 -re61200e6c946ac66439f9788cb96dd1ca76c1a7d --- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/PropertyInfos/DesignWaterLevelLocationContextPropertyInfoTest.cs (.../DesignWaterLevelLocationContextPropertyInfoTest.cs) (revision 070acdcdc07854f93138da547e97dd7754a5ffc7) +++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/PropertyInfos/DesignWaterLevelLocationContextPropertyInfoTest.cs (.../DesignWaterLevelLocationContextPropertyInfoTest.cs) (revision e61200e6c946ac66439f9788cb96dd1ca76c1a7d) @@ -56,7 +56,7 @@ // Setup double designWaterLevel = new Random().NextDouble(); var hydraulicBoundaryLocation = new TestHydraulicBoundaryLocation(); - var hydraulicBoundaryLocationCalculation = new HydraulicBoundaryLocationCalculation + var hydraulicBoundaryLocationCalculation = new HydraulicBoundaryLocationCalculation(hydraulicBoundaryLocation) { Output = new TestHydraulicBoundaryLocationOutput(designWaterLevel) }; Index: Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/PropertyInfos/DesignWaterLevelLocationsContextPropertyInfoTest.cs =================================================================== diff -u -r5a54a4db63685bd36cc9b979d2358c32a8a0f405 -re61200e6c946ac66439f9788cb96dd1ca76c1a7d --- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/PropertyInfos/DesignWaterLevelLocationsContextPropertyInfoTest.cs (.../DesignWaterLevelLocationsContextPropertyInfoTest.cs) (revision 5a54a4db63685bd36cc9b979d2358c32a8a0f405) +++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/PropertyInfos/DesignWaterLevelLocationsContextPropertyInfoTest.cs (.../DesignWaterLevelLocationsContextPropertyInfoTest.cs) (revision e61200e6c946ac66439f9788cb96dd1ca76c1a7d) @@ -20,7 +20,6 @@ // All rights reserved. using System; -using System.Collections.Generic; using System.Linq; using Core.Common.Base; using Core.Common.Gui.Plugin; @@ -62,31 +61,29 @@ mockRepository.ReplayAll(); var random = new Random(); - var hydraulicBoundaryLocations = new ObservableList(); - var hydraulicBoundaryLocationsLookup = new Dictionary + + var hydraulicBoundaryLocations = new ObservableList { + new TestHydraulicBoundaryLocation(), + new TestHydraulicBoundaryLocation() + }; + + var hydraulicBoundaryLocationCalculations = new[] + { + new HydraulicBoundaryLocationCalculation(hydraulicBoundaryLocations[0]) { - new TestHydraulicBoundaryLocation(), - new HydraulicBoundaryLocationCalculation - { - Output = new TestHydraulicBoundaryLocationOutput(random.NextDouble()) - } + Output = new TestHydraulicBoundaryLocationOutput(random.NextDouble()) }, + new HydraulicBoundaryLocationCalculation(hydraulicBoundaryLocations[1]) { - new TestHydraulicBoundaryLocation(), - new HydraulicBoundaryLocationCalculation - { - Output = new TestHydraulicBoundaryLocationOutput(random.NextDouble()) - } + Output = new TestHydraulicBoundaryLocationOutput(random.NextDouble()) } }; - hydraulicBoundaryLocations.AddRange(hydraulicBoundaryLocationsLookup.Keys); - var context = new DesignWaterLevelLocationsContext(hydraulicBoundaryLocations, assessmentSection, () => 0.01, - hbl => hydraulicBoundaryLocationsLookup[hbl], + hbl => hydraulicBoundaryLocationCalculations.First(hblc => ReferenceEquals(hblc.HydraulicBoundaryLocation, hbl)), "Category"); using (var plugin = new RingtoetsPlugin()) @@ -100,8 +97,8 @@ Assert.IsInstanceOf(objectProperties); Assert.AreSame(hydraulicBoundaryLocations, objectProperties.Data); DesignWaterLevelLocationProperties[] locationProperties = ((DesignWaterLevelLocationsProperties) objectProperties).Locations; - CollectionAssert.AreEqual(hydraulicBoundaryLocationsLookup.Keys, locationProperties.Select(p => p.Data)); - CollectionAssert.AreEqual(hydraulicBoundaryLocationsLookup.Values.Select(c => c.Output.Result), locationProperties.Select(p => p.DesignWaterLevel)); + CollectionAssert.AreEqual(hydraulicBoundaryLocations, locationProperties.Select(p => p.Data)); + CollectionAssert.AreEqual(hydraulicBoundaryLocationCalculations.Select(c => c.Output.Result), locationProperties.Select(p => p.DesignWaterLevel)); } mockRepository.VerifyAll(); Index: Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/PropertyInfos/WaveHeightLocationContextPropertyInfoTest.cs =================================================================== diff -u -r070acdcdc07854f93138da547e97dd7754a5ffc7 -re61200e6c946ac66439f9788cb96dd1ca76c1a7d --- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/PropertyInfos/WaveHeightLocationContextPropertyInfoTest.cs (.../WaveHeightLocationContextPropertyInfoTest.cs) (revision 070acdcdc07854f93138da547e97dd7754a5ffc7) +++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/PropertyInfos/WaveHeightLocationContextPropertyInfoTest.cs (.../WaveHeightLocationContextPropertyInfoTest.cs) (revision e61200e6c946ac66439f9788cb96dd1ca76c1a7d) @@ -56,7 +56,7 @@ // Setup double waveHeight = new Random().NextDouble(); var hydraulicBoundaryLocation = new TestHydraulicBoundaryLocation(); - var hydraulicBoundaryLocationCalculation = new HydraulicBoundaryLocationCalculation + var hydraulicBoundaryLocationCalculation = new HydraulicBoundaryLocationCalculation(hydraulicBoundaryLocation) { Output = new TestHydraulicBoundaryLocationOutput(waveHeight) }; Index: Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/PropertyInfos/WaveHeightLocationsContextPropertyInfoTest.cs =================================================================== diff -u -r5a54a4db63685bd36cc9b979d2358c32a8a0f405 -re61200e6c946ac66439f9788cb96dd1ca76c1a7d --- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/PropertyInfos/WaveHeightLocationsContextPropertyInfoTest.cs (.../WaveHeightLocationsContextPropertyInfoTest.cs) (revision 5a54a4db63685bd36cc9b979d2358c32a8a0f405) +++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/PropertyInfos/WaveHeightLocationsContextPropertyInfoTest.cs (.../WaveHeightLocationsContextPropertyInfoTest.cs) (revision e61200e6c946ac66439f9788cb96dd1ca76c1a7d) @@ -20,7 +20,6 @@ // All rights reserved. using System; -using System.Collections.Generic; using System.Linq; using Core.Common.Base; using Core.Common.Gui.Plugin; @@ -62,31 +61,29 @@ mockRepository.ReplayAll(); var random = new Random(); - var hydraulicBoundaryLocations = new ObservableList(); - var hydraulicBoundaryLocationsLookup = new Dictionary + + var hydraulicBoundaryLocations = new ObservableList { + new TestHydraulicBoundaryLocation(), + new TestHydraulicBoundaryLocation() + }; + + var hydraulicBoundaryLocationCalculations = new[] + { + new HydraulicBoundaryLocationCalculation(hydraulicBoundaryLocations[0]) { - new TestHydraulicBoundaryLocation(), - new HydraulicBoundaryLocationCalculation - { - Output = new TestHydraulicBoundaryLocationOutput(random.NextDouble()) - } + Output = new TestHydraulicBoundaryLocationOutput(random.NextDouble()) }, + new HydraulicBoundaryLocationCalculation(hydraulicBoundaryLocations[1]) { - new TestHydraulicBoundaryLocation(), - new HydraulicBoundaryLocationCalculation - { - Output = new TestHydraulicBoundaryLocationOutput(random.NextDouble()) - } + Output = new TestHydraulicBoundaryLocationOutput(random.NextDouble()) } }; - hydraulicBoundaryLocations.AddRange(hydraulicBoundaryLocationsLookup.Keys); - var context = new WaveHeightLocationsContext(hydraulicBoundaryLocations, assessmentSection, () => 0.01, - hbl => hydraulicBoundaryLocationsLookup[hbl], + hbl => hydraulicBoundaryLocationCalculations.First(hblc => ReferenceEquals(hblc.HydraulicBoundaryLocation, hbl)), "Category"); using (var plugin = new RingtoetsPlugin()) @@ -100,8 +97,8 @@ Assert.IsInstanceOf(objectProperties); Assert.AreSame(hydraulicBoundaryLocations, objectProperties.Data); WaveHeightLocationProperties[] locationProperties = ((WaveHeightLocationsProperties) objectProperties).Locations; - CollectionAssert.AreEqual(hydraulicBoundaryLocationsLookup.Keys, locationProperties.Select(p => p.Data)); - CollectionAssert.AreEqual(hydraulicBoundaryLocationsLookup.Values.Select(c => c.Output.Result), locationProperties.Select(p => p.WaveHeight)); + CollectionAssert.AreEqual(hydraulicBoundaryLocations, locationProperties.Select(p => p.Data)); + CollectionAssert.AreEqual(hydraulicBoundaryLocationCalculations.Select(c => c.Output.Result), locationProperties.Select(p => p.WaveHeight)); } mockRepository.VerifyAll();