Exemplo 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";
        }
Exemplo 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);
        }