예제 #1
0
        public void AttachedToEventWithReThrow()
        {
            TryCatch tryCatch = new TryCatch(new ReThrowExceptionHandler());

            ComponentWithEvent component = new ComponentWithEvent();

            component.PropertyChanged += tryCatch.Wrap <PropertyChangedEventHandler>(OnPropertyChanged);
            component.Name             = "John";
        }
예제 #2
0
        public void AttachedToEvent()
        {
            handler.Count = 0;

            ComponentWithEvent component = new ComponentWithEvent();

            component.PropertyChanged += tryCatch.Wrap <PropertyChangedEventHandler>(OnPropertyChanged);
            component.Name             = "John";

            Assert.AreEqual(1, handler.Count);
        }