コード例 #1
0
 public void FromDelimitedString_WithIncorrectSegmentId_ThrowsArgumentException()
 {
     Assert.Throws <ArgumentException>(() =>
     {
         ISegment hl7Segment = new OdtSegment();
         hl7Segment.FromDelimitedString("ODA|^~&|3|4|5|6");
     });
 }
コード例 #2
0
        public void ToDelimitedString_WithAllProperties_ReturnsCorrectlySequencedFields()
        {
            ISegment hl7Segment = new OdtSegment
            {
                TrayType = new CodedWithExceptions
                {
                    Identifier = "1"
                },
                ServicePeriod = new CodedWithExceptions[]
                {
                    new CodedWithExceptions
                    {
                        Identifier = "2"
                    }
                },
                TextInstruction = "3"
            };

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

            Assert.Equal(expected, actual);
        }
コード例 #3
0
        public void FromDelimitedString_WithAllProperties_ReturnsCorrectlyInitializedFields()
        {
            ISegment expected = new OdtSegment
            {
                TrayType = new CodedWithExceptions
                {
                    Identifier = "1"
                },
                ServicePeriod = new CodedWithExceptions[]
                {
                    new CodedWithExceptions
                    {
                        Identifier = "2"
                    }
                },
                TextInstruction = "3"
            };

            ISegment actual = new OdtSegment();

            actual.FromDelimitedString("ODT|1|2|3");

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