value-dt-test-YYYY-DDD--HH-MM-SS

From Microformats Wiki
Jump to navigation Jump to search

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

author
Tantek Çelik


testing

The value-dt-test-YYYY-DDD--HH-MM-SS test demonstrate the concatenation of two html elements to create one datetime value. The date contains a year number and the number of days.

  • YYYY-DDD
  • HH:MM:SS

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-DDD</span> 
  at <span class="value">HH:MM:SS</span>
</span>


test

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

serendipitous meet-up between Scott Beale and Tantek at Four Barrel Coffee on 2009-276 at 17:09:34

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
SUMMARY;LANGUAGE=en:serendipitous meet-up between Scott Beale and Tantek
LOCATION:Four Barrel Coffee
DTSTART;VALUE=DATE-TIME:20091003T170934
END:VEVENT
END:VCALENDAR

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

DTSTART;VALUE=DATE-TIME:20091003T170934

Acceptable variant:

DTSTART:20091003T170934

Asserts

A set of programming tests for xUnit testing frameworks
Test Result Comment
vevent[0].dtstart IsEqualToISODate("2009-10-03T17:09:34") With the value class pattern the results should contain a time

results

derivation

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

see also