public void Discover_EventHandlerTypes_discovers_both_projectors_and_consequences()
        {
            var types = Discover.EventHandlerTypes().ToArray();

            types.Should().Contain(typeof(ConcreteProjector));
            types.Should().Contain(typeof(ConcreteConsequenter));
        }
        public void Discover_EventHandlerTypes_returns_a_given_type_only_once()
        {
            var types = Discover.EventHandlerTypes().ToArray();

            types.Should().ContainSingle(t => t == typeof(ConcreteConsequenter));
            types.Should().ContainSingle(t => t == typeof(ConcreteProjector));
        }
Exemple #3
0
        private IDisposable SubscribedHandlers()
        {
            var handlers = Discover.EventHandlerTypes()
                           .Where(t => t.IsNested && t.DeclaringType == GetType())
                           .Select(Activator.CreateInstance)
                           .ToArray();

            return(bus.Subscribe(handlers));
        }
        public void EventHandlerBase_derived_classes_are_discoverable_as_event_handlers()
        {
            var types = Discover.EventHandlerTypes().ToArray();

            types.Should().ContainSingle(t => t == typeof(ConcreteProjector));
        }