예제 #1
0
        public void FromDelimitedString_WithAllProperties_ReturnsCorrectlyInitializedFields()
        {
            ISegment expected = new Al1Segment
            {
                SetIdAl1         = 1,
                AllergenTypeCode = new CodedWithExceptions
                {
                    Identifier = "2"
                },
                AllergenCodeMnemonicDescription = new CodedWithExceptions
                {
                    Identifier = "3"
                },
                AllergySeverityCode = new CodedWithExceptions
                {
                    Identifier = "4"
                },
                AllergyReactionCode = new string[]
                {
                    "5"
                },
                IdentificationDate = new DateTime(2020, 6, 6)
            };

            ISegment actual = new Al1Segment();

            actual.FromDelimitedString("AL1|1|2|3|4|5|20200606");

            expected.Should().BeEquivalentTo(actual);
        }
예제 #2
0
 public void FromDelimitedString_WithIncorrectSegmentId_ThrowsArgumentException()
 {
     Assert.Throws <ArgumentException>(() =>
     {
         ISegment hl7Segment = new Al1Segment();
         hl7Segment.FromDelimitedString("ALA|^~&|3|4|5|6");
     });
 }