value-dt-test-YYYY-MM-DD--H-MM

Jump to: navigation, search

One of several value class pattern date and time value test cases. Marked up with the test-fixture poshformat.

author
Tantek Çelik

Contents

testing

The value-dt-test-YYYY-MM-DD--H-MM test demonstrate the concatenation of two html elements to create one datetime value:

  • YYYY-MM-DD
  • H:MM

in an hCalendar event.

markup pattern

Here is the markup pattern fragment (escaped, and with abstract not real values) that is being tested:

<span class="dtstart">
 <span class="value">YYYY-MM-DD</span> 
 at
 <span class="value">H:MM</span>
</span>

and variant with intermediate spans

<span class="dtstart">
 <span>
  <span class="value">YYYY-MM-DD</span> 
  at
  <span>
   <span class="value">H:MM</span>
  </span>
 </span>
</span>

Similarly with dtend.


test

hCalendar test in actual markup on the page (view or edit source to see actual hCalendar markup)

When
2009-06-26 at 7:00 to 2009-06-26 at 8:00
Where
Somewhere in San Francisco, CA, USA
What
wake up for microformats.org 4th birthday!
Web
no URL


When
2009-06-26 at 8:05 to 2009-06-26 at 9:06
Where
Elsewhere in San Francisco, CA, USA
What
get ready for microformats.org 4th birthday!
Web
no URL

expected iCalendar output

Here is the expected iCalendar output, omitting optional "X-" properties, and implementation specific "PRODID" property:

BEGIN:VCALENDAR
VERSION:2.0
METHOD:PUBLISH
CALSCALE:GREGORIAN
BEGIN:VEVENT
LOCATION;LANGUAGE=en;CHARSET=utf-8:Somewhere in San Francisco\, CA\, USA
SUMMARY;LANGUAGE=en;CHARSET=utf-8:wake up for microformats.org 4th birthday!
DTSTART;VALUE=DATE-TIME:20090626T070000
DTEND;VALUE=DATE-TIME:20090626T080000
END:VEVENT
 
BEGIN:VEVENT
LOCATION;LANGUAGE=en;CHARSET=utf-8:Elsewhere in San Francisco\, CA\, USA
SUMMARY;LANGUAGE=en;CHARSET=utf-8:get ready for microformats.org 4th birthday!
DTSTART;VALUE=DATE-TIME:20090626T080500
DTEND;VALUE=DATE-TIME:20090626T090600
END:VEVENT
 
END:VCALENDAR

The key lines that an hCalendar to iCalendar converter must match in order to pass this test:

DTSTART;VALUE=DATE-TIME:20090626T070000
DTEND;VALUE=DATE-TIME:20090626T080000

and

DTSTART;VALUE=DATE-TIME:20090626T080500
DTEND;VALUE=DATE-TIME:20090626T090600

Acceptable variant:

DTSTART:20090626T070000
DTEND:20090626T080000

and

DTSTART:20090626T080500
DTEND:20090626T090600

Asserts

A set of programming tests for xUnit testing frameworks
Test Result Comment
vevent[0].dtstart IsEqualToISODate("2009-06-26T07:00") With the value class pattern the results should contain a time
vevent[0].dtend IsEqualToISODate("2009-06-26T08:00") With the value class pattern the results should contain a time
vevent[1].dtstart IsEqualToISODate("2009-06-26T08:05") With the value class pattern the results should contain a time
vevent[1].dtend IsEqualToISODate("2009-06-26T09:06") With the value class pattern the results should contain a time

results

  • 2012-01-04: Wrote based on value-dt-test-YYYY-MM-DD--HH-MM
    • test cases fail in both X2V 0.9.7 (fails to 0-pad hour, insert T), and Operator 0.9.6.5 (doesn't see time). Tantek 00:42, 5 January 2012 (UTC)

derivation

This test was derived from value-dt-test-YYYY-MM-DD--HH-MM.

see also

value-dt-test-YYYY-MM-DD--H-MM was last modified: Tuesday, June 5th, 2012

Views