コード例 #1
0
        public void ToDelimitedString_WithAllProperties_ReturnsCorrectlySequencedFields()
        {
            ISegment hl7Segment = new PsgSegment
            {
                ProviderProductServiceGroupNumber = new EntityIdentifier
                {
                    EntityId = "1"
                },
                PayerProductServiceGroupNumber = new EntityIdentifier
                {
                    EntityId = "2"
                },
                ProductServiceGroupSequenceNumber = 3,
                AdjudicateAsGroup = "4",
                ProductServiceGroupBilledAmount = new CompositePrice
                {
                    Price = new Money
                    {
                        Quantity = 5
                    }
                },
                ProductServiceGroupDescription = "6"
            };

            string expected = "PSG|1|2|3|4|5|6";
            string actual   = hl7Segment.ToDelimitedString();

            Assert.Equal(expected, actual);
        }
コード例 #2
0
        public void FromDelimitedString_WithAllProperties_ReturnsCorrectlyInitializedFields()
        {
            ISegment expected = new PsgSegment
            {
                ProviderProductServiceGroupNumber = new EntityIdentifier
                {
                    EntityId = "1"
                },
                PayerProductServiceGroupNumber = new EntityIdentifier
                {
                    EntityId = "2"
                },
                ProductServiceGroupSequenceNumber = 3,
                AdjudicateAsGroup = "4",
                ProductServiceGroupBilledAmount = new CompositePrice
                {
                    Price = new Money
                    {
                        Quantity = 5
                    }
                },
                ProductServiceGroupDescription = "6"
            };

            ISegment actual = new PsgSegment();

            actual.FromDelimitedString("PSG|1|2|3|4|5|6");

            expected.Should().BeEquivalentTo(actual);
        }
コード例 #3
0
 public void FromDelimitedString_WithIncorrectSegmentId_ThrowsArgumentException()
 {
     Assert.Throws <ArgumentException>(() =>
     {
         ISegment hl7Segment = new PsgSegment();
         hl7Segment.FromDelimitedString("PSA|^~&|3|4|5|6");
     });
 }