Esempio n. 1
0
        public void GetCriticalResponseData_FailToParseInvalidMessage()
        {
            var invalidMessage = GetMessage().Replace("P", string.Empty);
            var parser         = new PipeParser();

            var exception = Assert.Throws <HL7Exception>(() => parser.GetCriticalResponseData(invalidMessage));

            Assert.True(exception?.Message.Contains("Can't parse critical fields from MSH segment"));
        }
Esempio n. 2
0
        public void GetCriticalResponseDataFromValidMessage()
        {
            var parser = new PipeParser();

            var parsed = parser.GetCriticalResponseData(GetMessage()) as Model.V231.Segment.MSH;

            Assert.NotNull(parsed);
            Assert.AreEqual("|", parsed.FieldSeparator.Value);
            Assert.AreEqual(@"^~\&", parsed.EncodingCharacters.Value);
            Assert.AreEqual("P", parsed.ProcessingID.ProcessingID.Value);
            Assert.AreEqual("EBzH1711114101206", parsed.MessageControlID.Value);
        }