Exemple #1
0
        public void ToDelimitedString_WithAllProperties_ReturnsCorrectlySequencedFields()
        {
            IType hl7Type = new CompositeIdWithCheckDigit
            {
                IdNumber   = 1,
                CheckDigit = "2",
                CodeIdentifyingTheCheckDigitSchemeEmployed = "3",
                AssigningAuthority = new HierarchicDesignator
                {
                    NamespaceId = "4"
                }
            };

            string expected = "1^2^3^4";
            string actual   = hl7Type.ToDelimitedString();

            Assert.Equal(expected, actual);
        }
Exemple #2
0
        public void FromDelimitedString_WithAllProperties_ReturnsCorrectlyInitializedFields()
        {
            IType expected = new CompositeIdWithCheckDigit
            {
                IdNumber   = 1,
                CheckDigit = "2",
                CodeIdentifyingTheCheckDigitSchemeEmployed = "3",
                AssigningAuthority = new HierarchicDesignator
                {
                    IsSubcomponent = true,
                    NamespaceId    = "4"
                }
            };

            IType actual = new CompositeIdWithCheckDigit();

            actual.FromDelimitedString("1^2^3^4");

            expected.Should().BeEquivalentTo(actual);
        }