public void RegisterAssemblyMessageHandlers() {
     var conventions = new MessageTypeConventions();
     conventions.AddConvention(x => x.IsInterface && x.Namespace == "CWServiceBus.Dispatch.TestData");
     messageHandlerCollection = new MessageHandlerCollection(conventions);
     messageHandlerCollection.AddAssemblyToScan(GetType().Assembly);
     messageHandlerCollection.Init();
 }
 public void Supports_Conventions() {
     var conventions = new MessageTypeConventions();
     conventions.AddConvention(x => x.Name.EndsWith("MessageWithoutHandler"));
     messageHandlerCollection = new MessageHandlerCollection(conventions);
     messageHandlerCollection.AddAssemblyToScan(GetType().Assembly);
     messageHandlerCollection.Init();
     messageHandlerCollection.AllMessageTypes().Contains(typeof(MessageWithoutHandler));
     Assert.IsEmpty(messageHandlerCollection.GetOrderedDispatchInfoFor(typeof(MessageWithoutHandler)));
 }
示例#3
0
        public void RegisterAssemblyMessageHandlers()
        {
            var conventions = new MessageTypeConventions();

            conventions.AddConvention(x => x.IsInterface && x.Namespace == "CWServiceBus.Dispatch.TestData");
            messageHandlerCollection = new MessageHandlerCollection(conventions);
            messageHandlerCollection.AddAssemblyToScan(GetType().Assembly);
            messageHandlerCollection.Init();
        }
示例#4
0
        public void Supports_Conventions()
        {
            var conventions = new MessageTypeConventions();

            conventions.AddConvention(x => x.Name.EndsWith("MessageWithoutHandler"));
            messageHandlerCollection = new MessageHandlerCollection(conventions);
            messageHandlerCollection.AddAssemblyToScan(GetType().Assembly);
            messageHandlerCollection.Init();
            messageHandlerCollection.AllMessageTypes().Contains(typeof(MessageWithoutHandler));
            Assert.IsEmpty(messageHandlerCollection.GetOrderedDispatchInfoFor(typeof(MessageWithoutHandler)));
        }