public void IgnoresTypesWithNoEventBrokerAttributes()
        {
            MockBuilderContext            context  = new MockBuilderContext();
            EventBrokerReflectionStrategy strategy = new EventBrokerReflectionStrategy();

            strategy.BuildUp(context, typeof(object), null);

            Assert.Null(context.Policies.Get <IEventBrokerPolicy>(typeof(object)));
        }
        public void IgnoresNonTypeBuildKeys()
        {
            MockBuilderContext            context  = new MockBuilderContext();
            EventBrokerReflectionStrategy strategy = new EventBrokerReflectionStrategy();

            strategy.BuildUp(context, "Foo", null);

            Assert.Null(context.Policies.Get <IEventBrokerPolicy>("Foo"));
        }
        public void ClassWithSource()
        {
            MockBuilderContext            context  = new MockBuilderContext();
            EventBrokerReflectionStrategy strategy = new EventBrokerReflectionStrategy();

            strategy.BuildUp(context, typeof(Source), null);

            IEventBrokerPolicy policy = context.Policies.Get <IEventBrokerPolicy>(typeof(Source));

            Assert.NotNull(policy);
            Assert.Contains(new KeyValuePair <string, EventInfo>("Baz", typeof(Source).GetEvent("EventSource")), policy.Sources);
        }
        public void ClassWithSink()
        {
            MockBuilderContext            context  = new MockBuilderContext();
            EventBrokerReflectionStrategy strategy = new EventBrokerReflectionStrategy();

            strategy.BuildUp(context, typeof(Sink), null);

            IEventBrokerPolicy policy = context.Policies.Get <IEventBrokerPolicy>(typeof(Sink));

            Assert.NotNull(policy);
            Assert.Contains(new KeyValuePair <string, MethodInfo>("Bar", typeof(Sink).GetMethod("EventSinkMethod")), policy.Sinks);
        }