예제 #1
0
        public void FromDelimitedString_WithAllProperties_ReturnsCorrectlyInitializedFields()
        {
            ISegment expected = new SprSegment
            {
                QueryTag = "1",
                QueryResponseFormatCode = "2",
                StoredProcedureName     = new CodedElement
                {
                    Identifier = "3"
                },
                InputParameterList = new QueryInputParameterList[]
                {
                    new QueryInputParameterList
                    {
                        SegmentFieldName = "4"
                    }
                }
            };

            ISegment actual = new SprSegment();

            actual.FromDelimitedString("SPR|1|2|3|4");

            expected.Should().BeEquivalentTo(actual);
        }
예제 #2
0
 public void FromDelimitedString_WithIncorrectSegmentId_ThrowsArgumentException()
 {
     Assert.Throws <ArgumentException>(() =>
     {
         ISegment hl7Segment = new SprSegment();
         hl7Segment.FromDelimitedString("SPA|^~&|3|4|5|6");
     });
 }
예제 #3
0
        public void ToDelimitedString_WithAllProperties_ReturnsCorrectlySequencedFields()
        {
            ISegment hl7Segment = new SprSegment
            {
                QueryTag = "1",
                QueryResponseFormatCode = "2",
                StoredProcedureName     = new CodedElement
                {
                    Identifier = "3"
                },
                InputParameterList = new QueryInputParameterList[]
                {
                    new QueryInputParameterList
                    {
                        SegmentFieldName = "4"
                    }
                }
            };

            string expected = "SPR|1|2|3|4";
            string actual   = hl7Segment.ToDelimitedString();

            Assert.Equal(expected, actual);
        }