APISonar


org.nakedobjects.application.valueholder.Time.Time

> org > nakedobjects > application > valueholder > Time > Time
org APIs nakedobjects APIs application APIs valueholder APIs Time APIs Time APIs

Example 1
public void testDefaultTime() throws InterruptedException {
        Time t1 = new Time();
        assertEquals("temp", t1.dateValue(), new Time().dateValue());
    }
Example 2
public void testGetValue() {
        Time t2 = new Time(0, 0);
        assertEquals("new zero value time", 0, t2.longValue());

        t2 = new Time();
        t2.setValue(0, 0);
        assertEquals("set to zero", 0, t2.longValue());

        Time t3 = new Time(0, 1);
        assertEquals(t2.longValue() + 60, t3.longValue());

        assertEquals(10 * 3600 + 40 * 60, t.longValue());
    }
Example 3
public void testSetTime() {
        Time t2 = new Time();
        t2.setValue(10, 40);
        assertEquals("Set with values", t.dateValue(), t2.dateValue());
        Time t3 = new Time();
        t3.setValue(10, 40);
        assertEquals("Set with values", t.dateValue(), t3.dateValue());
    }
Example 4
protected void setUp() throws Exception {
        super.setUp();

        t = new Time(10, 40);
    }
Example 5
public void testTimeConstructors() {
        assertEquals("Two identically created objects", t.dateValue(), new Time(10, 40).dateValue());
        assertEquals("One object created from another", t.dateValue(), new Time(t).dateValue());
    }
Example 6
public Booking() {
        reference = new TextString();
        status = new TextString();
        date = new Date();
        time = new Time();
    }