Exemplo n.º 1
0
        public void ToDelimitedString_WithAllProperties_ReturnsCorrectlySequencedFields()
        {
            ISegment hl7Segment = new DpsSegment
            {
                DiagnosisCodeMcp = new CodedWithExceptions
                {
                    Identifier = "1"
                },
                ProcedureCode = new CodedWithExceptions[]
                {
                    new CodedWithExceptions
                    {
                        Identifier = "2"
                    }
                },
                EffectiveDateTime  = new DateTime(2020, 3, 3, 0, 0, 3),
                ExpirationDateTime = new DateTime(2020, 4, 4, 0, 0, 4),
                TypeOfLimitation   = new CodedWithNoExceptions
                {
                    Identifier = "5"
                }
            };

            string expected = "DPS|1|2|20200303000003|20200404000004|5";
            string actual   = hl7Segment.ToDelimitedString();

            Assert.Equal(expected, actual);
        }
Exemplo n.º 2
0
        public void FromDelimitedString_WithAllProperties_ReturnsCorrectlyInitializedFields()
        {
            ISegment expected = new DpsSegment
            {
                DiagnosisCodeMcp = new CodedWithExceptions
                {
                    Identifier = "1"
                },
                ProcedureCode = new CodedWithExceptions[]
                {
                    new CodedWithExceptions
                    {
                        Identifier = "2"
                    }
                },
                EffectiveDateTime  = new DateTime(2020, 3, 3, 0, 0, 3),
                ExpirationDateTime = new DateTime(2020, 4, 4, 0, 0, 4),
                TypeOfLimitation   = new CodedWithNoExceptions
                {
                    Identifier = "5"
                }
            };

            ISegment actual = new DpsSegment();

            actual.FromDelimitedString("DPS|1|2|20200303000003|20200404000004|5");

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