public void FromDelimitedString_WithIncorrectSegmentId_ThrowsArgumentException() { Assert.Throws <ArgumentException>(() => { ISegment hl7Segment = new FacSegment(); hl7Segment.FromDelimitedString("FAA|^~&|3|4|5|6"); }); }
public void FromDelimitedString_WithAllProperties_ReturnsCorrectlyInitializedFields() { ISegment expected = new FacSegment { FacilityIdFac = new EntityIdentifier { EntityId = "1" }, FacilityType = "2", FacilityAddress = new ExtendedAddress[] { new ExtendedAddress { StreetAddress = new StreetAddress { StreetOrMailingAddress = "3" } } }, FacilityTelecommunication = new ExtendedTelecommunicationNumber { TelephoneNumber = "4" }, ContactPerson = new ExtendedCompositeIdNumberAndNameForPersons[] { new ExtendedCompositeIdNumberAndNameForPersons { PersonIdentifier = "5" } }, ContactTitle = new string[] { "6" }, ContactAddress = new ExtendedAddress[] { new ExtendedAddress { StreetAddress = new StreetAddress { StreetOrMailingAddress = "7" } } }, ContactTelecommunication = new ExtendedTelecommunicationNumber[] { new ExtendedTelecommunicationNumber { TelephoneNumber = "8" } }, SignatureAuthority = new ExtendedCompositeIdNumberAndNameForPersons[] { new ExtendedCompositeIdNumberAndNameForPersons { PersonIdentifier = "9" } }, SignatureAuthorityTitle = "10", SignatureAuthorityAddress = new ExtendedAddress[] { new ExtendedAddress { StreetAddress = new StreetAddress { StreetOrMailingAddress = "11" } } }, SignatureAuthorityTelecommunication = new ExtendedTelecommunicationNumber { TelephoneNumber = "12" } }; ISegment actual = new FacSegment(); actual.FromDelimitedString("FAC|1|2|3|4|5|6|7|8|9|10|11|12"); expected.Should().BeEquivalentTo(actual); }
public void ToDelimitedString_WithAllProperties_ReturnsCorrectlySequencedFields() { ISegment hl7Segment = new FacSegment { FacilityIdFac = new EntityIdentifier { EntityId = "1" }, FacilityType = "2", FacilityAddress = new ExtendedAddress[] { new ExtendedAddress { StreetAddress = new StreetAddress { StreetOrMailingAddress = "3" } } }, FacilityTelecommunication = new ExtendedTelecommunicationNumber { TelephoneNumber = "4" }, ContactPerson = new ExtendedCompositeIdNumberAndNameForPersons[] { new ExtendedCompositeIdNumberAndNameForPersons { PersonIdentifier = "5" } }, ContactTitle = new string[] { "6" }, ContactAddress = new ExtendedAddress[] { new ExtendedAddress { StreetAddress = new StreetAddress { StreetOrMailingAddress = "7" } } }, ContactTelecommunication = new ExtendedTelecommunicationNumber[] { new ExtendedTelecommunicationNumber { TelephoneNumber = "8" } }, SignatureAuthority = new ExtendedCompositeIdNumberAndNameForPersons[] { new ExtendedCompositeIdNumberAndNameForPersons { PersonIdentifier = "9" } }, SignatureAuthorityTitle = "10", SignatureAuthorityAddress = new ExtendedAddress[] { new ExtendedAddress { StreetAddress = new StreetAddress { StreetOrMailingAddress = "11" } } }, SignatureAuthorityTelecommunication = new ExtendedTelecommunicationNumber { TelephoneNumber = "12" } }; string expected = "FAC|1|2|3|4|5|6|7|8|9|10|11|12"; string actual = hl7Segment.ToDelimitedString(); Assert.Equal(expected, actual); }