Пример #1
0
        public void ToDelimitedString_WithAllProperties_ReturnsCorrectlySequencedFields()
        {
            ISegment hl7Segment = new McpSegment
            {
                SetIdMcp = 1,
                ProducersServiceTestObservationId = new CodedWithExceptions
                {
                    Identifier = "2"
                },
                UniversalServicePriceRangeLowValue = new Money
                {
                    Quantity = 3
                },
                UniversalServicePriceRangeHighValue = new Money
                {
                    Quantity = 4
                },
                ReasonForUniversalServiceCostRange = "5"
            };

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

            Assert.Equal(expected, actual);
        }
Пример #2
0
        public void FromDelimitedString_WithAllProperties_ReturnsCorrectlyInitializedFields()
        {
            ISegment expected = new McpSegment
            {
                SetIdMcp = 1,
                ProducersServiceTestObservationId = new CodedWithExceptions
                {
                    Identifier = "2"
                },
                UniversalServicePriceRangeLowValue = new Money
                {
                    Quantity = 3
                },
                UniversalServicePriceRangeHighValue = new Money
                {
                    Quantity = 4
                },
                ReasonForUniversalServiceCostRange = "5"
            };

            ISegment actual = new McpSegment();

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

            expected.Should().BeEquivalentTo(actual);
        }
Пример #3
0
 public void FromDelimitedString_WithIncorrectSegmentId_ThrowsArgumentException()
 {
     Assert.Throws <ArgumentException>(() =>
     {
         ISegment hl7Segment = new McpSegment();
         hl7Segment.FromDelimitedString("MCA|^~&|3|4|5|6");
     });
 }