test_construct_ISO8601DateTime Subroutine

public subroutine test_construct_ISO8601DateTime()

Arguments

None

Calls

proc~~test_construct_iso8601datetime~~CallsGraph proc~test_construct_iso8601datetime test_construct_ISO8601DateTime assertequal assertequal proc~test_construct_iso8601datetime->assertequal proc~construct_iso8601datetime construct_ISO8601DateTime proc~test_construct_iso8601datetime->proc~construct_iso8601datetime proc~get_day_datetime ISO8601DateTime%get_day_datetime proc~test_construct_iso8601datetime->proc~get_day_datetime proc~get_hour_datetime ISO8601DateTime%get_hour_datetime proc~test_construct_iso8601datetime->proc~get_hour_datetime proc~get_millisecond_datetime ISO8601DateTime%get_millisecond_datetime proc~test_construct_iso8601datetime->proc~get_millisecond_datetime proc~get_minute_datetime ISO8601DateTime%get_minute_datetime proc~test_construct_iso8601datetime->proc~get_minute_datetime proc~get_month_datetime ISO8601DateTime%get_month_datetime proc~test_construct_iso8601datetime->proc~get_month_datetime proc~get_second_datetime ISO8601DateTime%get_second_datetime proc~test_construct_iso8601datetime->proc~get_second_datetime proc~get_timezone_offset_datetime ISO8601DateTime%get_timezone_offset_datetime proc~test_construct_iso8601datetime->proc~get_timezone_offset_datetime proc~get_year_datetime ISO8601DateTime%get_year_datetime proc~test_construct_iso8601datetime->proc~get_year_datetime interface~mapl_assert MAPL_Assert proc~construct_iso8601datetime->interface~mapl_assert proc~mapl_return MAPL_Return proc~construct_iso8601datetime->proc~mapl_return proc~mapl_verify MAPL_Verify proc~construct_iso8601datetime->proc~mapl_verify proc~get_day ISO8601Date%get_day proc~get_day_datetime->proc~get_day proc~get_hour ISO8601Time%get_hour proc~get_hour_datetime->proc~get_hour proc~get_millisecond ISO8601Time%get_millisecond proc~get_millisecond_datetime->proc~get_millisecond proc~get_minute ISO8601Time%get_minute proc~get_minute_datetime->proc~get_minute proc~get_month ISO8601Date%get_month proc~get_month_datetime->proc~get_month proc~get_second ISO8601Time%get_second proc~get_second_datetime->proc~get_second proc~get_timezone_offset ISO8601Time%get_timezone_offset proc~get_timezone_offset_datetime->proc~get_timezone_offset proc~get_year ISO8601Date%get_year proc~get_year_datetime->proc~get_year at at proc~mapl_return->at insert insert proc~mapl_return->insert proc~mapl_throw_exception MAPL_throw_exception proc~mapl_return->proc~mapl_throw_exception proc~mapl_verify->proc~mapl_throw_exception

Source Code

   subroutine test_construct_ISO8601DateTime()
      type(ISO8601DateTime) :: isodatetime
      integer :: year = 2022
      integer :: month = 07
      integer :: day = 07
      integer :: hour = 17
      integer :: minute = 41
      integer :: second = 07
      integer :: millisecond = 513
      integer :: timezone_offset = 0
      character(len=*), parameter :: delimited = '2022-07-07T17:41:07.513Z'
      character(len=*), parameter :: undelimited = '20220707T174107.513Z'
      integer :: status

      isodatetime = construct_ISO8601DateTime(delimited, rc = status)

      @assertEqual(SUCCESS, status)
      @assertEqual(year, isodatetime%get_year())
      @assertEqual(month, isodatetime%get_month())
      @assertEqual(day, isodatetime%get_day())
      @assertEqual(hour, isodatetime%get_hour())
      @assertEqual(minute, isodatetime%get_minute())
      @assertEqual(second, isodatetime%get_second())
      @assertEqual(millisecond, isodatetime%get_millisecond())
      @assertEqual(timezone_offset, isodatetime%get_timezone_offset())

      isodatetime = construct_ISO8601DateTime(undelimited, rc = status)

      @assertEqual(SUCCESS, status)
      @assertEqual(year, isodatetime%get_year())
      @assertEqual(month, isodatetime%get_month())
      @assertEqual(day, isodatetime%get_day())
      @assertEqual(hour, isodatetime%get_hour())
      @assertEqual(minute, isodatetime%get_minute())
      @assertEqual(second, isodatetime%get_second())
      @assertEqual(millisecond, isodatetime%get_millisecond())
      @assertEqual(timezone_offset, isodatetime%get_timezone_offset())

   end subroutine test_construct_ISO8601DateTime