public void FromDelimitedString_WithIncorrectSegmentId_ThrowsArgumentException() { Assert.Throws <ArgumentException>(() => { ISegment hl7Segment = new AbsSegment(); hl7Segment.FromDelimitedString("ABA|^~&|3|4|5|6"); }); }
public void FromDelimitedString_WithAllProperties_ReturnsCorrectlyInitializedFields() { ISegment expected = new AbsSegment { DischargeCareProvider = new ExtendedCompositeIdNumberAndNameForPersons { PersonIdentifier = "1" }, TransferMedicalServiceCode = new CodedWithExceptions { Identifier = "2" }, SeverityOfIllnessCode = new CodedWithExceptions { Identifier = "3" }, DateTimeOfAttestation = new DateTime(2020, 4, 1, 0, 0, 0), AttestedBy = new ExtendedCompositeIdNumberAndNameForPersons { PersonIdentifier = "5" }, TriageCode = new CodedWithExceptions { Identifier = "6" }, AbstractCompletionDateTime = new DateTime(2020, 7, 1, 0, 0, 0), AbstractedBy = new ExtendedCompositeIdNumberAndNameForPersons { PersonIdentifier = "8" }, CaseCategoryCode = new CodedWithExceptions { Identifier = "9" }, CaesarianSectionIndicator = "10", GestationCategoryCode = new CodedWithExceptions { Identifier = "11" }, GestationPeriodWeeks = 12, NewbornCode = new CodedWithExceptions { Identifier = "13" }, StillbornIndicator = "14" }; ISegment actual = new AbsSegment(); actual.FromDelimitedString("ABS|1|2|3|20200401000000|5|6|20200701000000|8|9|10|11|12|13|14"); expected.Should().BeEquivalentTo(actual); }