Esempio n. 1
0
        public void AttachedToEventWithReThrow()
        {
            TryCatch tryCatch = new TryCatch(new ReThrowExceptionHandler());

            ComponentWithEvent component = new ComponentWithEvent();

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