Beispiel #1
0
        public void TestParseMessageFail14()
        {
            parser = new XmlMessageParser("message.parser.XmlMessageParser.Unidentified");
            string messageText = File.ReadAllText("../../test_files/testMessageInvalid3.xml");

            parser.ParseMessage(messageText);
        }
Beispiel #2
0
        public void TestParseMessageFail12()
        {
            parser = new XmlMessageParser("message.parser.XmlMessageParser.Invalid7");
            string messageText = File.ReadAllText("../../test_files/testMessage.xml");

            parser.ParseMessage(messageText);
        }
Beispiel #3
0
        public void TestParseMessage2()
        {
            parser = new XmlMessageParser("message.parser.XmlMessageParserValid2");
            string  messageText = File.ReadAllText("../../test_files/testMessage.xml");
            Message message     = parser.ParseMessage(messageText);

            Assert.AreEqual(message.DestinationQueue, null, "DestinationQueue is incorrect.");
        }
Beispiel #4
0
        public void TestParseMessageFail11()
        {
            XmlMessageTypeDetector       detector         = new XmlMessageTypeDetector("type.detector.XmlMessageTypeDetectorWithValidator");
            IList <IMessageTypeDetector> configParameters = new List <IMessageTypeDetector>();

            configParameters.Add(detector);
            parser = new XmlMessageParser(configParameters);

            string messageText = File.ReadAllText("../../test_files/testMessage2.xml");

            parser.ParseMessage(messageText);
        }
        public void TestParseMessage()
        {
            string  messageText = File.ReadAllText("../../test_files/accuracyTests/MessageParse.xml");
            Message message     = parser.ParseMessage(messageText);

            Assert.AreEqual(messageText, message.DisplayMessage, "DisplayMessage of returned message is incorrect");
            Assert.AreEqual(DateTime.Now.Date, message.Received.Date, "Received of returned message is incorrect");
            Assert.AreEqual("Source Queue", message.SourceQueue.Name, "SourceQueue of returned message is incorrect");
            Assert.AreEqual("MyDescription", message.SourceQueue.Description,
                            "SourceQueue of returned message is incorrect");
            Assert.AreEqual("Mypath", message.SourceQueue.Path, "SourceQueue of returned message is incorrect");
            Assert.IsNull(message.DestinationQueue, "DestinationQueue is incorrect.");
            Assert.AreEqual("SRequest", message.Type.Name, "DestinationQueue is incorrect.");
        }