public void ToDelimitedString_WithAllProperties_ReturnsCorrectlySequencedFields() { ISegment hl7Segment = new RcpSegment { QueryPriority = "1", QuantityLimitedRequest = new CompositeQuantityWithUnits { Quantity = 2 }, ResponseModality = new CodedWithNoExceptions { Identifier = "3" }, ExecutionAndDeliveryTime = new DateTime(2020, 4, 4, 0, 0, 4), ModifyIndicator = "5", SortByField = new SortOrder[] { new SortOrder { SortByField = "6" } }, SegmentGroupInclusion = new string[] { "7" } }; string expected = "RCP|1|2|3|20200404000004|5|6|7"; string actual = hl7Segment.ToDelimitedString(); Assert.Equal(expected, actual); }
public void FromDelimitedString_WithAllProperties_ReturnsCorrectlyInitializedFields() { ISegment expected = new RcpSegment { QueryPriority = "1", QuantityLimitedRequest = new CompositeQuantityWithUnits { Quantity = 2 }, ResponseModality = new CodedWithNoExceptions { Identifier = "3" }, ExecutionAndDeliveryTime = new DateTime(2020, 4, 4, 0, 0, 4), ModifyIndicator = "5", SortByField = new SortOrder[] { new SortOrder { SortByField = "6" } }, SegmentGroupInclusion = new string[] { "7" } }; ISegment actual = new RcpSegment(); actual.FromDelimitedString("RCP|1|2|3|20200404000004|5|6|7"); expected.Should().BeEquivalentTo(actual); }
public void FromDelimitedString_WithIncorrectSegmentId_ThrowsArgumentException() { Assert.Throws <ArgumentException>(() => { ISegment hl7Segment = new RcpSegment(); hl7Segment.FromDelimitedString("RCA|^~&|3|4|5|6"); }); }