public void FromDelimitedString_WithIncorrectSegmentId_ThrowsArgumentException()
 {
     Assert.Throws <ArgumentException>(() =>
     {
         ISegment hl7Segment = new Om3Segment();
         hl7Segment.FromDelimitedString("OMA|^~&|3|4|5|6");
     });
 }
        public void FromDelimitedString_WithAllProperties_ReturnsCorrectlyInitializedFields()
        {
            ISegment expected = new Om3Segment
            {
                SequenceNumberTestObservationMasterFile = 1,
                PreferredCodingSystem = new CodedWithExceptions
                {
                    Identifier = "2"
                },
                ValidCodedAnswers = new CodedWithExceptions[]
                {
                    new CodedWithExceptions
                    {
                        Identifier = "3"
                    }
                },
                NormalTextCodesForCategoricalObservations = new CodedWithExceptions[]
                {
                    new CodedWithExceptions
                    {
                        Identifier = "4"
                    }
                },
                AbnormalTextCodesForCategoricalObservations = new CodedWithExceptions[]
                {
                    new CodedWithExceptions
                    {
                        Identifier = "5"
                    }
                },
                CriticalTextCodesForCategoricalObservations = new CodedWithExceptions[]
                {
                    new CodedWithExceptions
                    {
                        Identifier = "6"
                    }
                },
                ValueType = "7"
            };

            ISegment actual = new Om3Segment();

            actual.FromDelimitedString("OM3|1|2|3|4|5|6|7");

            expected.Should().BeEquivalentTo(actual);
        }