示例#1
0
        public void FromDelimitedString_WithAllProperties_ReturnsCorrectlyInitializedFields()
        {
            IType expected = new PolicyTypeAndAmount
            {
                PolicyType = new CodedWithExceptions
                {
                    IsSubcomponent = true,
                    Identifier     = "1"
                },
                AmountClass = new CodedWithExceptions
                {
                    IsSubcomponent = true,
                    Identifier     = "2"
                },
                MoneyOrPercentageQuantity = 3,
                MoneyOrPercentage         = new MoneyOrPercentage
                {
                    IsSubcomponent             = true,
                    MoneyOrPercentageIndicator = "4"
                }
            };

            IType actual = new PolicyTypeAndAmount();

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

            expected.Should().BeEquivalentTo(actual);
        }
示例#2
0
        public void ToDelimitedString_WithAllProperties_ReturnsCorrectlySequencedFields()
        {
            IType hl7Type = new PolicyTypeAndAmount
            {
                PolicyType = new CodedWithExceptions
                {
                    Identifier = "1"
                },
                AmountClass = new CodedWithExceptions
                {
                    Identifier = "2"
                },
                MoneyOrPercentageQuantity = 3,
                MoneyOrPercentage         = new MoneyOrPercentage
                {
                    MoneyOrPercentageIndicator = "4"
                }
            };

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

            Assert.Equal(expected, actual);
        }