public void ToDelimitedString_WithAllProperties_ReturnsCorrectlySequencedFields() { ISegment hl7Segment = new PssSegment { ProviderProductServiceSectionNumber = new EntityIdentifier { EntityId = "1" }, PayerProductServiceSectionNumber = new EntityIdentifier { EntityId = "2" }, ProductServiceSectionSequenceNumber = 3, BilledAmount = new CompositePrice { Price = new Money { Quantity = 4 } }, SectionDescriptionOrHeading = "5" }; string expected = "PSS|1|2|3|4|5"; string actual = hl7Segment.ToDelimitedString(); Assert.Equal(expected, actual); }
public void FromDelimitedString_WithAllProperties_ReturnsCorrectlyInitializedFields() { ISegment expected = new PssSegment { ProviderProductServiceSectionNumber = new EntityIdentifier { EntityId = "1" }, PayerProductServiceSectionNumber = new EntityIdentifier { EntityId = "2" }, ProductServiceSectionSequenceNumber = 3, BilledAmount = new CompositePrice { Price = new Money { Quantity = 4 } }, SectionDescriptionOrHeading = "5" }; ISegment actual = new PssSegment(); actual.FromDelimitedString("PSS|1|2|3|4|5"); expected.Should().BeEquivalentTo(actual); }
public void FromDelimitedString_WithIncorrectSegmentId_ThrowsArgumentException() { Assert.Throws <ArgumentException>(() => { ISegment hl7Segment = new PssSegment(); hl7Segment.FromDelimitedString("PSA|^~&|3|4|5|6"); }); }