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

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

            // assert
            name.Should().Be("awesome-queue");
            mapping.GetType().Should().Be(typeof(TestCommandMapping));
        }
Example #2
0
        public void Should_find_registered_mapping()
        {
            // align
            IMessageMapping testCommandMapping = new TestCommandMapping();

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

            // act
            var mapping = MessageMapper.GetMapping(typeof(RegisteredMessageMapping));

            // assert
            mapping.GetType().Should().Be(typeof(TestCommandMapping));
        }