public void GivenViewWithCalculationData_WhenCalculationUpdatedAndNotified_ThenMapDataUpdated() { // Given var calculationA = new GrassCoverErosionOutwardsWaveConditionsCalculation { InputParameters = { ForeshoreProfile = new TestForeshoreProfile(new Point2D(1.3, 1.3)), HydraulicBoundaryLocation = new TestHydraulicBoundaryLocation() } }; var failureMechanism = new GrassCoverErosionOutwardsFailureMechanism(); failureMechanism.CalculationsGroup.Children.Add(calculationA); GrassCoverErosionOutwardsFailureMechanismView view = CreateView(failureMechanism, new AssessmentSectionStub()); IMapControl map = ((RiskeerMapControl)view.Controls[0]).MapControl; var mocks = new MockRepository(); IObserver[] observers = AttachMapDataObservers(mocks, map.Data.Collection); observers[calculationObserverIndex].Expect(obs => obs.UpdateObserver()); mocks.ReplayAll(); var calculationMapData = (MapLineData)map.Data.Collection.ElementAt(calculationsIndex); // Precondition AssertCalculationsMapData(failureMechanism.Calculations.Cast <GrassCoverErosionOutwardsWaveConditionsCalculation>(), calculationMapData); // When calculationA.Name = "new name"; calculationA.NotifyObservers(); // Then AssertCalculationsMapData(failureMechanism.Calculations.Cast <GrassCoverErosionOutwardsWaveConditionsCalculation>(), calculationMapData); mocks.VerifyAll(); }