Пример #1
0
        public MessageDirectoryFixture()
        {
            var hint    = MethodInvokerHint.FromConsumerSample <IConsumeMessage <IMessage> >(m => m.Consume(null));
            var scanner = new DomainAssemblyScanner();

            scanner.Constrain(hint);
            scanner.WithAssemblyOf <When_activation_map_constrained_to_catch_all_consumer>();
            Mappings = scanner.Build(hint.ConsumerTypeDefinition).ToArray();


            Builder = new MessageDirectoryBuilder(Mappings);

            var nestedTypes = typeof(MessageDirectoryFixture).GetNestedTypes();

            TestMessageTypes = nestedTypes
                               .Where(t => typeof(IMessage).IsAssignableFrom(t)).ToArray();
            TestConsumerTypes = nestedTypes
                                .Where(t => typeof(IConsumeMessage).IsAssignableFrom(t)).ToArray();
        }
 public void Default_definition_is_accepted()
 {
     MethodInvokerHint.FromConsumerSample <IConsume <Feature.DirectoryDispatch.Default.IMessage> >(c => c.Consume(null));
 }
 public void Non_generic_handler_is_not_accepted()
 {
     MethodInvokerHint.FromConsumerSample <IConumerWithoutGeneric>(c => c.Consume(null));
 }
 public void Handler_with_generic_method_is_not_accepted()
 {
     MethodInvokerHint.FromConsumerSample <IConsumerWithoutGenericClass>(c => c.Consume <IMessage>(null));
 }
 public void Two_arguments_are_not_accepted()
 {
     MethodInvokerHint.FromConsumerSample <IConsumerWith2Arguments <IMessage> >(c => c.Consume(null, null));
 }