public void ElementWithoutValueShallRenturnNull()
        {
            var xml = @"<effectiveTime/>";

            var element = XElement.Parse(xml);
            var result  = new FhirDateTimeParser().FromXml(element);

            result.Should().BeNull();
        }
        public void ValueWithoutYearShallReturnNull()
        {
            var xml = @"<effectiveTime value=""201""/>";

            var element = XElement.Parse(xml);
            var result  = new FhirDateTimeParser().FromXml(element);

            result.Should().BeNull();
        }
        public void ShallReturnYearMonthDay()
        {
            var xml = @"<effectiveTime value=""20130815""/>";

            var element = XElement.Parse(xml);
            var result  = new FhirDateTimeParser().FromXml(element);

            result.Should().NotBeNull();

            var dateTime = result.ToDateTime();

            dateTime?.Kind.Should().Be(DateTimeKind.Utc);
            dateTime?.Year.Should().Be(2013);
            dateTime?.Month.Should().Be(08);
            dateTime?.Day.Should().Be(15);
        }
        public void ShallReturnYearMonthDayHourMinuteSecond()
        {
            var xml = @"<effectiveTime value=""20130815103015.222-0800""/>";

            var element = XElement.Parse(xml);
            var result  = new FhirDateTimeParser().FromXml(element);

            result.Should().NotBeNull();

            var dateTime = result.ToDateTime();

            dateTime?.Kind.Should().Be(DateTimeKind.Utc);
            dateTime?.Year.Should().Be(2013);
            dateTime?.Month.Should().Be(08);
            dateTime?.Day.Should().Be(15);
            dateTime?.Hour.Should().Be(18);
            dateTime?.Minute.Should().Be(30);
            dateTime?.Second.Should().Be(15);
            dateTime?.Millisecond.Should().Be(222);
        }
        public void NullXmlShallRenturnNull()
        {
            var result = new FhirDateTimeParser().FromXml(null);

            result.Should().BeNull();
        }