Sha256: 82ac3f840bf23cf7c5beceda2ad2723728766e0cddcee8caf1e32ba64e1ef571

Contents?: true

Size: 959 Bytes

Versions: 22

Compression:

Stored size: 959 Bytes

Contents

import org.junit.Test
import static org.junit.Assert.assertEquals
import static java.util.Calendar.*

/**
 * Test suite for the Gigasecond exercise.
 * To ignore a test case while you work the problem, simply comment out the method or add the @Ignore annotation.
 */
class GigasecondTest {

  @Test
  void gigasecondFromDate() {
    def gs = new Gigasecond().from(new GregorianCalendar(2011, APRIL, 25).time)
    assertEquals new GregorianCalendar(2043, JANUARY, 1, 0, 46, 40).time, gs
  }

  @Test
  void gigasecondFromDateWithHoursAndMinutes() {
    def gs = new Gigasecond().from(new GregorianCalendar(1959, JULY, 19, 12, 31).time)
    assertEquals new GregorianCalendar(1991, MARCH, 27, 13, 17, 40).time, gs
  }

  @Test
  void gigasecondFromDateWithHoursAndMinutesAndSeconds() {
    def gs = new Gigasecond().from(new GregorianCalendar(1977, JUNE, 13, 2, 15, 45).time)
    assertEquals new GregorianCalendar(2009, FEBRUARY, 19, 3, 2, 25).time, gs
  }

}

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
trackler-2.0.1.0 tracks/groovy/exercises/gigasecond/GigasecondTest.groovy
trackler-2.0.0.10 tracks/groovy/exercises/gigasecond/GigasecondTest.groovy
trackler-2.0.0.9 tracks/groovy/exercises/gigasecond/GigasecondTest.groovy
trackler-2.0.0.8 tracks/groovy/exercises/gigasecond/GigasecondTest.groovy
trackler-2.0.0.7 tracks/groovy/exercises/gigasecond/GigasecondTest.groovy
trackler-2.0.0.6 tracks/groovy/exercises/gigasecond/GigasecondTest.groovy
trackler-2.0.0.5 tracks/groovy/exercises/gigasecond/GigasecondTest.groovy
trackler-2.0.0.4 tracks/groovy/exercises/gigasecond/GigasecondTest.groovy
trackler-2.0.0.3 tracks/groovy/exercises/gigasecond/GigasecondTest.groovy
trackler-2.0.0.2 tracks/groovy/exercises/gigasecond/GigasecondTest.groovy
trackler-2.0.0.1 tracks/groovy/exercises/gigasecond/GigasecondTest.groovy
trackler-2.0.0.0 tracks/groovy/exercises/gigasecond/GigasecondTest.groovy
trackler-1.0.4.1 tracks/groovy/exercises/gigasecond/GigasecondTest.groovy
trackler-1.0.4.0 tracks/groovy/exercises/gigasecond/GigasecondTest.groovy
trackler-1.0.3.0 tracks/groovy/exercises/gigasecond/GigasecondTest.groovy
trackler-1.0.2.1 tracks/groovy/exercises/gigasecond/GigasecondTest.groovy
trackler-1.0.2.0 tracks/groovy/exercises/gigasecond/GigasecondTest.groovy
trackler-1.0.1.2 tracks/groovy/exercises/gigasecond/GigasecondTest.groovy
trackler-1.0.1.1 tracks/groovy/exercises/gigasecond/GigasecondTest.groovy
trackler-1.0.1.0 tracks/groovy/exercises/gigasecond/GigasecondTest.groovy