Index: Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Forms.Test/PropertyClasses/DuneLocationsPropertiesTest.cs =================================================================== diff -u -rc743d1f229ff553fff9a05964c1adac6e510df4a -r5cd1ac2b1438ea93461625d699a5377739c5abbf --- Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Forms.Test/PropertyClasses/DuneLocationsPropertiesTest.cs (.../DuneLocationsPropertiesTest.cs) (revision c743d1f229ff553fff9a05964c1adac6e510df4a) +++ Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Forms.Test/PropertyClasses/DuneLocationsPropertiesTest.cs (.../DuneLocationsPropertiesTest.cs) (revision 5cd1ac2b1438ea93461625d699a5377739c5abbf) @@ -38,64 +38,53 @@ private const int requiredLocationsPropertyIndex = 0; [Test] - public void Constructor_LocationsNull_ThrowsArgumentNullException() + public void Constructor_CalculationsNull_ThrowsArgumentNullException() { // Call - TestDelegate call = () => new DuneLocationsProperties(null, dl => new DuneLocationCalculation(new TestDuneLocation())); + TestDelegate call = () => new DuneLocationsProperties(null); // Assert var exception = Assert.Throws(call); - Assert.AreEqual("locations", exception.ParamName); + Assert.AreEqual("calculations", exception.ParamName); } [Test] - public void Constructor_GetCalculationFuncNull_ThrowsArgumentNullException() - { - // Call - TestDelegate call = () => new DuneLocationsProperties(new ObservableList(), null); - - // Assert - var exception = Assert.Throws(call); - Assert.AreEqual("getCalculationFunc", exception.ParamName); - } - - [Test] public void Constructor_WithData_ReturnExpectedValues() { // Setup - var location = new TestDuneLocation(); - var locations = new ObservableList + var calculation = new DuneLocationCalculation(new TestDuneLocation()); + var duneLocationCalculations = new ObservableList { - location + calculation }; // Call - using (var properties = new DuneLocationsProperties(locations, dl => new DuneLocationCalculation(new TestDuneLocation()))) + using (var properties = new DuneLocationsProperties(duneLocationCalculations)) { // Assert - Assert.IsInstanceOf>>(properties); + Assert.IsInstanceOf>>(properties); Assert.IsInstanceOf(properties); Assert.AreEqual(1, properties.Locations.Length); - Assert.AreSame(location, properties.Locations[0].Data); + Assert.AreSame(calculation.DuneLocation, properties.Locations[0].Data); } } [Test] public void Constructor_Always_PropertiesHaveExpectedAttributesValues() { // Setup - var location = new TestDuneLocation(); - var locations = new ObservableList + var calculation = new DuneLocationCalculation(new TestDuneLocation()); + var duneLocationCalculations = new ObservableList { - location + calculation }; // Call - using (var properties = new DuneLocationsProperties(locations, dl => new DuneLocationCalculation(new TestDuneLocation()))) + using (var properties = new DuneLocationsProperties(duneLocationCalculations)) { // Assert - Assert.AreSame(locations, properties.Data); + Assert.AreSame(duneLocationCalculations, properties.Data); PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); Assert.AreEqual(1, dynamicProperties.Count); @@ -111,40 +100,40 @@ } [Test] - public void GivenPropertyControlWithData_WhenSingleLocationUpdated_RefreshRequiredEventRaised() + public void GivenPropertyControlWithData_WhenSingleCalculationUpdated_RefreshRequiredEventRaised() { // Given - DuneLocation location = new TestDuneLocation(); - var duneLocations = new ObservableList + var calculation = new DuneLocationCalculation(new TestDuneLocation()); + var duneLocationCalculations = new ObservableList { - location + calculation }; - using (var properties = new DuneLocationsProperties(duneLocations, dl => new DuneLocationCalculation(new TestDuneLocation()))) + using (var properties = new DuneLocationsProperties(duneLocationCalculations)) { var refreshRequiredRaised = 0; properties.RefreshRequired += (sender, args) => refreshRequiredRaised++; // When - location.NotifyObservers(); + calculation.NotifyObservers(); // Then Assert.AreEqual(1, refreshRequiredRaised); } } [Test] - public void GivenDisposedPropertyControlWithData_WhenSingleLocationUpdated_RefreshRequiredEventNotRaised() + public void GivenDisposedPropertyControlWithData_WhenSingleCalculationUpdated_RefreshRequiredEventNotRaised() { // Given - DuneLocation location = new TestDuneLocation(); - var duneLocations = new ObservableList + var calculation = new DuneLocationCalculation(new TestDuneLocation()); + var duneLocationCalculations = new ObservableList { - location + calculation }; - using (var properties = new DuneLocationsProperties(duneLocations, dl => new DuneLocationCalculation(new TestDuneLocation()))) + using (var properties = new DuneLocationsProperties(duneLocationCalculations)) { var refreshRequiredRaised = 0; @@ -153,7 +142,7 @@ properties.Dispose(); // When - location.NotifyObservers(); + calculation.NotifyObservers(); // Then Assert.AreEqual(0, refreshRequiredRaised);