public void NullSubjectInProviderThrowsException()
        {
            NullSubjectSource               eventSource   = new NullSubjectSource();
            SingleEventListener             eventListener = new SingleEventListener();
            ReflectionInstrumentationBinder binder        = new ReflectionInstrumentationBinder();

            binder.Bind(eventSource, eventListener);
        }
        public void EventsDefinedInBaseAreAttachedToListener()
        {
            DerivedEventSource              eventSource   = new DerivedEventSource();
            SingleEventListener             eventListener = new SingleEventListener();
            ReflectionInstrumentationBinder binder        = new ReflectionInstrumentationBinder();

            binder.Bind(eventSource, eventListener);
            eventSource.Raise();
            Assert.IsTrue(eventListener.eventWasRaised);
        }
        public void AttachesOnlyInstrumentedEventsToListener()
        {
            SingleEventSourceWithOtherEvents eventSource  = new SingleEventSourceWithOtherEvents();
            SingleEventListener             eventListener = new SingleEventListener();
            ReflectionInstrumentationBinder binder        = new ReflectionInstrumentationBinder();

            binder.Bind(eventSource, eventListener);
            eventSource.Raise();
            Assert.IsTrue(eventListener.eventWasRaised);
        }
        public void AttachesSingleEventToSingleListener()
        {
            SingleEventSource               eventSource   = new SingleEventSource();
            SingleEventListener             eventListener = new SingleEventListener();
            ReflectionInstrumentationBinder binder        = new ReflectionInstrumentationBinder();

            binder.Bind(eventSource, eventListener);
            eventSource.Raise();
            Assert.IsTrue(eventListener.eventWasRaised);
        }
        public void AttachesSingleEventToSingleListener()
        {
            SingleEventSource eventSource = new SingleEventSource();
            SingleEventListener eventListener = new SingleEventListener();

            ReflectionInstrumentationBinder binder = new ReflectionInstrumentationBinder();

            binder.Bind(eventSource, eventListener);

            eventSource.Raise();

            Assert.IsTrue(eventListener.eventWasRaised);
        }
        public void AttachesOnlyInstrumentedEventsToListener()
        {
            SingleEventSourceWithOtherEvents eventSource = new SingleEventSourceWithOtherEvents();
            SingleEventListener eventListener = new SingleEventListener();

            ReflectionInstrumentationBinder binder = new ReflectionInstrumentationBinder();

            binder.Bind(eventSource, eventListener);

            eventSource.Raise();

            Assert.IsTrue(eventListener.eventWasRaised);
        }
        public void NullSubjectInProviderThrowsException()
        {
            NullSubjectSource eventSource = new NullSubjectSource();
            SingleEventListener eventListener = new SingleEventListener();

            ReflectionInstrumentationBinder binder = new ReflectionInstrumentationBinder();
            binder.Bind(eventSource, eventListener);
        }
        public void EventsDefinedInBaseAreAttachedToListener()
        {
            DerivedEventSource eventSource = new DerivedEventSource();
            SingleEventListener eventListener = new SingleEventListener();

            ReflectionInstrumentationBinder binder = new ReflectionInstrumentationBinder();
            binder.Bind(eventSource, eventListener);

            eventSource.Raise();

            Assert.IsTrue(eventListener.eventWasRaised);
        }