public void Can_Resolve_MessageType_For_Unknown_Type()
 {
     var messageNamingService = new DefaultMessageNamingService();
     var messageType = messageNamingService.GetTypeForName("Platibus.UnitTests.DefaultMessageNamingServiceTests+ContractA");
     Assert.That(messageType, Is.Not.Null);
     Assert.That(messageType, Is.EqualTo(typeof(ContractA)));
 }
        public void MessageTypeCanBeResolvedForUnregisteredTypes()
        {
            var messageNamingService = new DefaultMessageNamingService();
            var messageType          = messageNamingService.GetTypeForName("Platibus.UnitTests.DefaultMessageNamingServiceTests+ContractA");

            Assert.NotNull(messageType);
            Assert.Equal(typeof(ContractA), messageType);
        }
Esempio n. 3
0
        private static object DeserializeMessageContent(Message message)
        {
            var messageNamingService = new DefaultMessageNamingService();
            var serializationService = new DefaultSerializationService();

            var messageType = messageNamingService.GetTypeForName(message.Headers.MessageName);
            var serializer  = serializationService.GetSerializer(message.Headers.ContentType);

            return(serializer.Deserialize(message.Content, messageType));
        }