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))); }