Exemplo n.º 1
0
 public void FromDelimitedString_WithIncorrectSegmentId_ThrowsArgumentException()
 {
     Assert.Throws <ArgumentException>(() =>
     {
         ISegment hl7Segment = new Tq2Segment();
         hl7Segment.FromDelimitedString("TQA|^~&|3|4|5|6");
     });
 }
Exemplo n.º 2
0
        public void FromDelimitedString_WithAllProperties_ReturnsCorrectlyInitializedFields()
        {
            ISegment expected = new Tq2Segment
            {
                SetIdTq2            = 1,
                SequenceResultsFlag = "2",
                RelatedPlacerNumber = new EntityIdentifier[]
                {
                    new EntityIdentifier
                    {
                        EntityId = "3"
                    }
                },
                RelatedFillerNumber = new EntityIdentifier[]
                {
                    new EntityIdentifier
                    {
                        EntityId = "4"
                    }
                },
                RelatedPlacerGroupNumber = new EntityIdentifier[]
                {
                    new EntityIdentifier
                    {
                        EntityId = "5"
                    }
                },
                SequenceConditionCode         = "6",
                CyclicEntryExitIndicator      = "7",
                SequenceConditionTimeInterval = new CompositeQuantityWithUnits
                {
                    Quantity = 8
                },
                CyclicGroupMaximumNumberOfRepeats = 9,
                SpecialServiceRequestRelationship = "10"
            };

            ISegment actual = new Tq2Segment();

            actual.FromDelimitedString("TQ2|1|2|3|4|5|6|7|8|9|10");

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