com.jrefinery.date.junit
Class SerialDateTests

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by com.jrefinery.date.junit.SerialDateTests
All Implemented Interfaces:
junit.framework.Test

public class SerialDateTests
extends junit.framework.TestCase


Field Summary
protected  SerialDate Nov_9_2001
           
 
Constructor Summary
SerialDateTests(java.lang.String name)
           
 
Method Summary
protected  void setUp()
           
static junit.framework.Test suite()
           
 void testIsLeapYear2000()
          2000 is a leap year.
 void testIsNotLeapYear1900()
          1900 is not a leap year.
 void testLeapYearCount1899()
          The number of leap years from 1900 up-to-and-including 1899 is 0.
 void testLeapYearCount1903()
          The number of leap years from 1900 up-to-and-including 1903 is 0.
 void testLeapYearCount1904()
          The number of leap years from 1900 up-to-and-including 1904 is 1.
 void testLeapYearCount1999()
          The number of leap years from 1900 up-to-and-including 1999 is 24.
 void testLeapYearCount2000()
          The number of leap years from 1900 up-to-and-including 2000 is 25.
 void testMondayFollowingFriday9Nov2001()
          Monday following Friday 9 November 2001 should be 12 November.
 void testMondayNearest22Jan1970()
          The Monday nearest to 22nd January 1970 falls on the 19th.
 void testMondayNearestFriday9Nov2001()
          Monday nearest Friday 9 November 2001 should be 12 November.
 void testMondayPrecedingFriday9Nov2001()
          Monday preceding Friday 9 November 2001 should be 5 November.
 void testMonthCodeToStringCode()
           
 void testStringToMonthCode()
          Test the conversion of a string to a month.
 void testStringToWeekday()
          Test the conversion of a string to a weekday.
 void testWeekdayCodeToString()
          Test that the conversion of days to strings returns the right result.
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, tearDown, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

Nov_9_2001

protected SerialDate Nov_9_2001
Constructor Detail

SerialDateTests

public SerialDateTests(java.lang.String name)
Method Detail

suite

public static junit.framework.Test suite()

setUp

protected void setUp()
Overrides:
setUp in class junit.framework.TestCase

testMondayPrecedingFriday9Nov2001

public void testMondayPrecedingFriday9Nov2001()
Monday preceding Friday 9 November 2001 should be 5 November.


testMondayFollowingFriday9Nov2001

public void testMondayFollowingFriday9Nov2001()
Monday following Friday 9 November 2001 should be 12 November.


testMondayNearestFriday9Nov2001

public void testMondayNearestFriday9Nov2001()
Monday nearest Friday 9 November 2001 should be 12 November.


testMondayNearest22Jan1970

public void testMondayNearest22Jan1970()
The Monday nearest to 22nd January 1970 falls on the 19th.


testWeekdayCodeToString

public void testWeekdayCodeToString()
Test that the conversion of days to strings returns the right result. Actually, this result depends on the Locale so this test needs to be modified.


testStringToWeekday

public void testStringToWeekday()
Test the conversion of a string to a weekday. Note that this test will fail if the default locale doesn't use English weekday names...devise a better test!


testStringToMonthCode

public void testStringToMonthCode()
Test the conversion of a string to a month. Note that this test will fail if the default locale doesn't use English month names...devise a better test!


testMonthCodeToStringCode

public void testMonthCodeToStringCode()

testIsNotLeapYear1900

public void testIsNotLeapYear1900()
1900 is not a leap year.


testIsLeapYear2000

public void testIsLeapYear2000()
2000 is a leap year.


testLeapYearCount1899

public void testLeapYearCount1899()
The number of leap years from 1900 up-to-and-including 1899 is 0.


testLeapYearCount1903

public void testLeapYearCount1903()
The number of leap years from 1900 up-to-and-including 1903 is 0.


testLeapYearCount1904

public void testLeapYearCount1904()
The number of leap years from 1900 up-to-and-including 1904 is 1.


testLeapYearCount1999

public void testLeapYearCount1999()
The number of leap years from 1900 up-to-and-including 1999 is 24.


testLeapYearCount2000

public void testLeapYearCount2000()
The number of leap years from 1900 up-to-and-including 2000 is 25.



Copyright © 2003 MBARI.

The Monterey Bay Aquarium Research Institute (MBARI) provides this documentation and code "as is", with no warranty, express or implied, of its quality or consistency. It is provided without support and without obligation on the part of MBARI to assist in its use, correction, modification, or enhancement.