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

            ComponentWithEvent component = new ComponentWithEvent();

            component.PropertyChanged += tryCatch.Wrap <PropertyChangedEventHandler>(OnPropertyChanged);
            component.Name             = "John";
        }
Example #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);
        }