Beispiel #1
0
        public void ToDelimitedString_WithAllProperties_ReturnsCorrectlySequencedFields()
        {
            ISegment hl7Segment = new OdsSegment
            {
                Type          = "1",
                ServicePeriod = new CodedWithExceptions[]
                {
                    new CodedWithExceptions
                    {
                        Identifier = "2"
                    }
                },
                DietSupplementOrPreferenceCode = new CodedWithExceptions[]
                {
                    new CodedWithExceptions
                    {
                        Identifier = "3"
                    }
                },
                TextInstruction = new string[]
                {
                    "4"
                }
            };

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

            Assert.Equal(expected, actual);
        }
Beispiel #2
0
        public void FromDelimitedString_WithAllProperties_ReturnsCorrectlyInitializedFields()
        {
            ISegment expected = new OdsSegment
            {
                Type          = "1",
                ServicePeriod = new CodedWithExceptions[]
                {
                    new CodedWithExceptions
                    {
                        Identifier = "2"
                    }
                },
                DietSupplementOrPreferenceCode = new CodedWithExceptions[]
                {
                    new CodedWithExceptions
                    {
                        Identifier = "3"
                    }
                },
                TextInstruction = new string[]
                {
                    "4"
                }
            };

            ISegment actual = new OdsSegment();

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

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