Index: Riskeer/Common/test/Riskeer.Common.Forms.Test/PresentationObjects/LocationCalculationsContextTest.cs =================================================================== diff -u -r7f91b938135e4f0e5782ce023ec8ae94cd07c221 -re6a58af7809b1e415633fc361c808e94f18c14ed --- Riskeer/Common/test/Riskeer.Common.Forms.Test/PresentationObjects/LocationCalculationsContextTest.cs (.../LocationCalculationsContextTest.cs) (revision 7f91b938135e4f0e5782ce023ec8ae94cd07c221) +++ Riskeer/Common/test/Riskeer.Common.Forms.Test/PresentationObjects/LocationCalculationsContextTest.cs (.../LocationCalculationsContextTest.cs) (revision e6a58af7809b1e415633fc361c808e94f18c14ed) @@ -19,6 +19,7 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. +using System; using System.Linq; using Core.Common.Base; using Core.Common.Controls.PresentationObjects; @@ -129,6 +130,32 @@ mockRepository.VerifyAll(); } + [Test] + public void GivenContextWithObserverAttachedThatThrowsInvalidOperationException_WhenNotifyingLocationCalculationsElementInListToObserve_ThenNoExceptionThrown() + { + // Given + var mockRepository = new MockRepository(); + var observer = mockRepository.StrictMock(); + observer.Expect(o => o.UpdateObserver()).Do((Action) (() => throw new InvalidOperationException())); + mockRepository.ReplayAll(); + + var observable = new TestObservable(); + var locationCalculationsListToObserve = new ObservableList + { + observable + }; + + var context = new TestLocationCalculationsContext(new object(), locationCalculationsListToObserve); + + context.Attach(observer); + + // When + observable.NotifyObservers(); + + // Then + mockRepository.VerifyAll(); + } + private class TestLocationCalculationsContext : LocationCalculationsContext { public TestLocationCalculationsContext(object wrappedData, ObservableList locationCalculationsListToObserve) : base(wrappedData)