Example #1
0
        /// <summary>
        /// Sends the one message.
        /// </summary>
        /// <returns></returns>
        public bool SendOneMessage()
        {
            IMQAdapter <PushMessageModel> activemq = new ActiveMQAdapter <PushMessageModel>(mq_Ip_address, QUEUE_DESTINATION);
            var msg = CreateNewTestMessage();

            int flag = activemq.SendMessage <PushMessageModel>(msg);

            return(flag > 0);
        }
Example #2
0
        public void ShouldSendMessageForModelToMQ()
        {
            //assume
            var activemq = new ActiveMQAdapter <PushMessageModel>(mq_Ip_address, QUEUE_DESTINATION);
            var msg      = CreateNewTestMessage();

            int flag = activemq.SendMessage <PushMessageModel>(msg);

            //assert
            Assert.Equal(1, flag);
        }
Example #3
0
        /// <summary>
        /// Shoulds the send message model to mq and get them.
        /// </summary>
        //[Fact]
        public void ShouldSendMessageModelToMQAndGetThem()
        {
            //assume
            var activemq = new ActiveMQAdapter <PushMessageModel>(mq_Ip_address, QUEUE_DESTINATION);
            var msg      = CreateNewTestMessage();


            //act
            activemq.SendMessage <PushMessageModel>(msg);

            Thread.Sleep(1000);
            var msglist = activemq.ReceviceMessage <PushMessageModel>();

            //assert
            Assert.NotNull(msglist);
            Assert.Equal(1, msglist.Length);
        }