public void ToDelimitedString_WithAllProperties_ReturnsCorrectlySequencedFields()
        {
            ISegment hl7Segment = new LchSegment
            {
                PrimaryKeyValueLch = new PersonLocation
                {
                    PointOfCare = new HierarchicDesignator
                    {
                        NamespaceId = "1"
                    }
                },
                SegmentActionCode = "2",
                SegmentUniqueKey  = new EntityIdentifier
                {
                    EntityId = "3"
                },
                LocationCharacteristicId = new CodedWithExceptions
                {
                    Identifier = "4"
                },
                LocationCharacteristicValueLch = new CodedWithExceptions
                {
                    Identifier = "5"
                }
            };

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

            Assert.Equal(expected, actual);
        }
        public void FromDelimitedString_WithAllProperties_ReturnsCorrectlyInitializedFields()
        {
            ISegment expected = new LchSegment
            {
                PrimaryKeyValueLch = new PersonLocation
                {
                    PointOfCare = new HierarchicDesignator
                    {
                        NamespaceId = "1"
                    }
                },
                SegmentActionCode = "2",
                SegmentUniqueKey  = new EntityIdentifier
                {
                    EntityId = "3"
                },
                LocationCharacteristicId = new CodedWithExceptions
                {
                    Identifier = "4"
                },
                LocationCharacteristicValueLch = new CodedWithExceptions
                {
                    Identifier = "5"
                }
            };

            ISegment actual = new LchSegment();

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

            expected.Should().BeEquivalentTo(actual);
        }
 public void FromDelimitedString_WithIncorrectSegmentId_ThrowsArgumentException()
 {
     Assert.Throws <ArgumentException>(() =>
     {
         ISegment hl7Segment = new LchSegment();
         hl7Segment.FromDelimitedString("LCA|^~&|3|4|5|6");
     });
 }