Пример #1
0
        private static void TestQueWithObjs()
        {
            MSMQHelper.PostMessageToLocalQueue <TestData>("Byron", new TestData("What"));
            MSMQHelper.PostMessageToLocalQueue <TestData>("Byron", new TestData("The"));
            MSMQHelper.PostMessageToLocalQueue <TestData>("Byron", new TestData("Hell"));

            String result = "";

            MSMQHelper.ProcessMessagesFromLocalQueue <TestData>("Byron", (input) =>
            {
                result += input.Data;
                return(false);
            });

            Assert.IsTrue(result == "WhatTheHell");

            result = "";
            MSMQHelper.ProcessMessagesFromLocalQueue <TestData>("Byron", (input) =>
            {
                result += input.Data;
                return(true);
            });

            Assert.IsTrue(result == "WhatTheHell");

            result = "";
            MSMQHelper.ProcessMessagesFromLocalQueue <TestData>("Byron", (input) =>
            {
                result += input.Data;
                return(true);
            });

            Assert.IsTrue(result == "");
        }
Пример #2
0
        private static void TestLocalQue()
        {
            bool retVal = MSMQHelper.PostMessageToLocalQueue <String>("FAILED", "What");

            retVal = MSMQHelper.DeleteLocalQueue("FAILED");

            //Assert.IsTrue(MSMQHelper.TestLocalQueueCreation(out errorMessage) == true);
        }