コード例 #1
0
        public void ToDelimitedString_WithAllProperties_ReturnsCorrectlySequencedFields()
        {
            IType hl7Type = new OccurrenceSpanCodeAndDate
            {
                OccurrenceSpanCode = new CodedWithNoExceptions
                {
                    Identifier = "1"
                },
                OccurrenceSpanStartDate = new DateTime(2020, 2, 2, 2, 22, 0),
                OccurrenceSpanStopDate  = new DateTime(2020, 3, 3, 3, 33, 28)
            };

            string expected = "1^20200202022200^20200303033328";
            string actual   = hl7Type.ToDelimitedString();

            Assert.Equal(expected, actual);
        }
コード例 #2
0
        public void FromDelimitedString_WithAllProperties_ReturnsCorrectlyInitializedFields()
        {
            IType expected = new OccurrenceSpanCodeAndDate
            {
                OccurrenceSpanCode = new CodedWithNoExceptions
                {
                    IsSubcomponent = true,
                    Identifier     = "1"
                },
                OccurrenceSpanStartDate = new DateTime(2020, 2, 2, 2, 22, 0),
                OccurrenceSpanStopDate  = new DateTime(2020, 3, 3, 3, 33, 28)
            };

            IType actual = new OccurrenceSpanCodeAndDate();

            actual.FromDelimitedString("1^20200202022200^20200303033328");

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