public void CreateMessageReceiver_NoDeserializer_Exception()
        {
            var messagingComponentFactory = new MessagingComponentFactory(_configuration, _adapterFactory.Object, new IMessageSerializer[0],
                                                                          new IMessageDeserializer[0], _callContextFactory.Object);

            Assert.Throws <MessagingException>(() => messagingComponentFactory.CreateMessageReceiver <string>("ReValue"),
                                               "There are no message deserializers with the message type System.String for the queue id: ReValue");
        }
        public void CreateMessageReceiver_TwoDeserializers_Exception()
        {
            var deserializers = new List <IMessageDeserializer> {
                new PlainTextSerializer(), new PlainTextSerializer()
            };

            var messagingComponentFactory = new MessagingComponentFactory(_configuration, _adapterFactory.Object, new IMessageSerializer[0],
                                                                          deserializers, _callContextFactory.Object);

            Assert.Throws <MessagingException>(() => messagingComponentFactory.CreateMessageReceiver <string>("ReValue"),
                                               "There are too many message deserializers with the message type System.String for the queue id: ReValue");
        }
        public void CreateMessageReceiver_HasDeserializer_ReceiverCreated()
        {
            var deserializers = new List <IMessageDeserializer> {
                new PlainTextSerializer()
            };

            var messagingComponentFactory = new MessagingComponentFactory(_configuration, _adapterFactory.Object, new IMessageSerializer[0],
                                                                          deserializers, _callContextFactory.Object);
            var result = messagingComponentFactory.CreateMessageReceiver <string>("ReValue");

            Assert.That(result, Is.Not.Null);
        }