Beispiel #1
0
        public void FromDelimitedString_WithAllProperties_ReturnsCorrectlyInitializedFields()
        {
            ISegment expected = new IarSegment
            {
                AllergyReactionCode = new CodedWithExceptions
                {
                    Identifier = "1"
                },
                AllergySeverityCode = new CodedWithExceptions
                {
                    Identifier = "2"
                },
                SensitivityToCausativeAgentCode = new CodedWithExceptions
                {
                    Identifier = "3"
                },
                Management = "4"
            };

            ISegment actual = new IarSegment();

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

            expected.Should().BeEquivalentTo(actual);
        }
Beispiel #2
0
 public void FromDelimitedString_WithIncorrectSegmentId_ThrowsArgumentException()
 {
     Assert.Throws <ArgumentException>(() =>
     {
         ISegment hl7Segment = new IarSegment();
         hl7Segment.FromDelimitedString("IAA|^~&|3|4|5|6");
     });
 }
Beispiel #3
0
        public void ToDelimitedString_WithAllProperties_ReturnsCorrectlySequencedFields()
        {
            ISegment hl7Segment = new IarSegment
            {
                AllergyReactionCode = new CodedWithExceptions
                {
                    Identifier = "1"
                },
                AllergySeverityCode = new CodedWithExceptions
                {
                    Identifier = "2"
                },
                SensitivityToCausativeAgentCode = new CodedWithExceptions
                {
                    Identifier = "3"
                },
                Management = "4"
            };

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

            Assert.Equal(expected, actual);
        }