Exemple #1
0
        public void Should_map_assembly()
        {
            // align

            // act
            MessageMapper.RegisterMappingsFromAssembly(typeof(MessageMapperRegisteredCommand).Assembly);
            var name = MessageMapper.GetQueueName(typeof(MessageMapperRegisteredCommand));

            // assert
            name.Should().Be("awesome-queue");
        }
Exemple #2
0
        public void Should_find_registered_mapping_queue_name()
        {
            // align
            IMessageMapping queue = new TestCommandMapping();

            MessageMapper.RegisterMapping(typeof(RegisteredMessageMapping), queue);

            // act
            var queueName = MessageMapper.GetQueueName(typeof(RegisteredMessageMapping));

            // assert
            queueName.Should().Be(queue.QueueName);
        }
Exemple #3
0
        public void Should_find_registered_mapping()
        {
            // align
            const string name = "queue";

            MessageMapper.RegisterMapping(typeof(RegisteredMessageMapping), name);

            // act
            var queueName = MessageMapper.GetQueueName(typeof(RegisteredMessageMapping));

            // assert
            queueName.Should().Be(name);
        }
Exemple #4
0
        public void Should_throw_for_non_registered_message()
        {
            var action = new Func <string>(() => MessageMapper.GetQueueName(typeof(NotRegisteredMessage)));

            action.Invoking(m => m.Invoke()).Should().Throw <MessageMappingMissingException>();
        }