Exemplo n.º 1
0
        public void FromDelimitedString_WithAllProperties_ReturnsCorrectlyInitializedFields()
        {
            ISegment expected = new Rq1Segment
            {
                AnticipatedPrice       = "1",
                ManufacturerIdentifier = new CodedWithExceptions
                {
                    Identifier = "2"
                },
                ManufacturersCatalog = "3",
                VendorId             = new CodedWithExceptions
                {
                    Identifier = "4"
                },
                VendorCatalog     = "5",
                Taxable           = "6",
                SubstituteAllowed = "7"
            };

            ISegment actual = new Rq1Segment();

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

            expected.Should().BeEquivalentTo(actual);
        }
Exemplo n.º 2
0
 public void FromDelimitedString_WithIncorrectSegmentId_ThrowsArgumentException()
 {
     Assert.Throws <ArgumentException>(() =>
     {
         ISegment hl7Segment = new Rq1Segment();
         hl7Segment.FromDelimitedString("RQA|^~&|3|4|5|6");
     });
 }
Exemplo n.º 3
0
        public void ToDelimitedString_WithAllProperties_ReturnsCorrectlySequencedFields()
        {
            ISegment hl7Segment = new Rq1Segment
            {
                AnticipatedPrice       = "1",
                ManufacturerIdentifier = new CodedWithExceptions
                {
                    Identifier = "2"
                },
                ManufacturersCatalog = "3",
                VendorId             = new CodedWithExceptions
                {
                    Identifier = "4"
                },
                VendorCatalog     = "5",
                Taxable           = "6",
                SubstituteAllowed = "7"
            };

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

            Assert.Equal(expected, actual);
        }