public DynamicMessageHandlerInvoker(Action <IMessage> handler, Type messageType, ICollection <BindingKey> bindingKeys)
            : base(typeof(DummyHandler), messageType, false)
        {
            _handler = handler;

            var messageTypeId = MessageUtil.GetTypeId(messageType);

            _predicates = bindingKeys.Select(x => BindingKeyUtil.BuildPredicate(messageTypeId, x)).ToList();
        }
Esempio n. 2
0
        public void should_match_valid_message(ExpectedResult expectedResult)
        {
            // Arrange
            var messageTypeId = MessageUtil.TypeId <FakeRoutableCommand>();

            // Act
            var predicate = BindingKeyUtil.BuildPredicate(messageTypeId, expectedResult.BindingKey);

            // Assert
            predicate(expectedResult.Message).ShouldEqual(expectedResult.Result);
        }