Ejemplo n.º 1
0
 public void FromDelimitedString_WithIncorrectSegmentId_ThrowsArgumentException()
 {
     Assert.Throws <ArgumentException>(() =>
     {
         ISegment hl7Segment = new PkgSegment();
         hl7Segment.FromDelimitedString("PKA|^~&|3|4|5|6");
     });
 }
Ejemplo n.º 2
0
        public void FromDelimitedString_WithAllProperties_ReturnsCorrectlyInitializedFields()
        {
            ISegment expected = new PkgSegment
            {
                SetIdPkg       = 1,
                PackagingUnits = new CodedWithExceptions
                {
                    Identifier = "2"
                },
                DefaultOrderUnitOfMeasureIndicator = new CodedWithNoExceptions
                {
                    Identifier = "3"
                },
                PackageQuantity = 4,
                Price           = new CompositePrice
                {
                    Price = new Money
                    {
                        Quantity = 5
                    }
                },
                FutureItemPrice = new CompositePrice
                {
                    Price = new Money
                    {
                        Quantity = 6
                    }
                },
                FutureItemPriceEffectiveDate = new DateTime(2020, 7, 7, 0, 0, 7),
                GlobalTradeItemNumber        = new CodedWithExceptions
                {
                    Identifier = "8"
                },
                ContractPrice = new Money
                {
                    Quantity = 9
                },
                QuantityOfEach      = 10,
                VendorCatalogNumber = new EntityIdentifier
                {
                    EntityId = "11"
                }
            };

            ISegment actual = new PkgSegment();

            actual.FromDelimitedString("PKG|1|2|3|4|5|6|20200707000007|8|9|10|11");

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