Exemplo n.º 1
0
        public void FromDelimitedString_WithAllProperties_ReturnsCorrectlyInitializedFields()
        {
            ISegment expected = new FhsSegment
            {
                FileFieldSeparator     = "1",
                FileEncodingCharacters = "2",
                FileSendingApplication = new HierarchicDesignator
                {
                    NamespaceId = "3"
                },
                FileSendingFacility = new HierarchicDesignator
                {
                    NamespaceId = "4"
                },
                FileReceivingApplication = new HierarchicDesignator
                {
                    NamespaceId = "5"
                },
                FileReceivingFacility = new HierarchicDesignator
                {
                    NamespaceId = "6"
                },
                FileCreationDateTime      = new DateTime(2020, 7, 7, 0, 0, 7),
                FileSecurity              = "8",
                FileNameId                = "9",
                FileHeaderComment         = "10",
                FileControlId             = "11",
                ReferenceFileControlId    = "12",
                FileSendingNetworkAddress = new HierarchicDesignator
                {
                    NamespaceId = "13"
                },
                FileReceivingNetworkAddress = new HierarchicDesignator
                {
                    NamespaceId = "14"
                },
                SecurityClassificationTag = new CodedWithExceptions
                {
                    Identifier = "15"
                },
                SecurityHandlingInstructions = new CodedWithExceptions[]
                {
                    new CodedWithExceptions
                    {
                        Identifier = "16"
                    }
                },
                SpecialAccessRestrictionInstructions = new string[]
                {
                    "17"
                }
            };

            ISegment actual = new FhsSegment();

            actual.FromDelimitedString("FHS|1|2|3|4|5|6|20200707000007|8|9|10|11|12|13|14|15|16|17");

            expected.Should().BeEquivalentTo(actual);
        }
Exemplo n.º 2
0
 public void FromDelimitedString_WithIncorrectSegmentId_ThrowsArgumentException()
 {
     Assert.Throws <ArgumentException>(() =>
     {
         ISegment hl7Segment = new FhsSegment();
         hl7Segment.FromDelimitedString("FHA|^~&|3|4|5|6");
     });
 }