Ejemplo n.º 1
0
 public void FromDelimitedString_WithIncorrectSegmentId_ThrowsArgumentException()
 {
     Assert.Throws <ArgumentException>(() =>
     {
         ISegment hl7Segment = new RqdSegment();
         hl7Segment.FromDelimitedString("RQA|^~&|3|4|5|6");
     });
 }
Ejemplo n.º 2
0
        public void FromDelimitedString_WithAllProperties_ReturnsCorrectlyInitializedFields()
        {
            ISegment expected = new RqdSegment
            {
                RequisitionLineNumber = 1,
                ItemCodeInternal      = new CodedWithExceptions
                {
                    Identifier = "2"
                },
                ItemCodeExternal = new CodedWithExceptions
                {
                    Identifier = "3"
                },
                HospitalItemCode = new CodedWithExceptions
                {
                    Identifier = "4"
                },
                RequisitionQuantity      = 5,
                RequisitionUnitOfMeasure = new CodedWithExceptions
                {
                    Identifier = "6"
                },
                CostCenterAccountNumber = new ExtendedCompositeIdWithCheckDigit
                {
                    IdNumber = "7"
                },
                ItemNaturalAccountCode = new CodedWithExceptions
                {
                    Identifier = "8"
                },
                DeliverToId = new CodedWithExceptions
                {
                    Identifier = "9"
                },
                DateNeeded = new DateTime(2020, 10, 10)
            };

            ISegment actual = new RqdSegment();

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

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