Sha256: bf105f4d3b70b4b98732594bfb07d7eff0744102b1913d913798be6e88299b19

Contents?: true

Size: 1.53 KB

Versions: 60

Compression:

Stored size: 1.53 KB

Contents

import "package:test/test.dart";
import "package:gigasecond/gigasecond.dart";

void main() {
  group("Gigasecond", () {
    test("tells a gigasecond anniversary since midnight", () {
      final birthDate = new DateTime.utc(2015, DateTime.SEPTEMBER, 14);
      final expectedDate = new DateTime.utc(2047, DateTime.MAY, 23, 1, 46, 40);
      final gigasecond = new Gigasecond(birthDate);

      expect(gigasecond.date(), equals(expectedDate));
    });

    test("tells the anniversary is next day when you are born at night", () {
      final birthDate = new DateTime.utc(2015, DateTime.SEPTEMBER, 14, 23, 59, 59);
      final expectedDate = new DateTime.utc(2047, DateTime.MAY, 24, 1, 46, 39);
      final gigasecond = new Gigasecond(birthDate);

      expect(gigasecond.date(), equals(expectedDate));
    }, skip: true);

    test("even works before 1970 (beginning of Unix epoch)", () {
      final birthDate = new DateTime.utc(1959, DateTime.JULY, 19, 5, 13, 45);
      final expectedDate = new DateTime.utc(1991, DateTime.MARCH, 27, 7, 0, 25);
      final gigasecond = new Gigasecond(birthDate);

      expect(gigasecond.date(), equals(expectedDate));
    }, skip: true);

    test("make sure calling \"date\" doesn\"t mutate value", () {
      final birthDate = new DateTime.utc(1959, DateTime.JULY, 19, 5, 13, 45);
      final expectedDate = new DateTime.utc(1991, DateTime.MARCH, 27, 7, 0, 25);
      final gigasecond = new Gigasecond(birthDate);

      gigasecond.date();
      expect(gigasecond.date(), equals(expectedDate));
    }, skip: true);
  });
}

Version data entries

60 entries across 60 versions & 1 rubygems

Version Path
trackler-2.2.1.45 tracks/dart/exercises/gigasecond/test/gigasecond_test.dart
trackler-2.2.1.44 tracks/dart/exercises/gigasecond/test/gigasecond_test.dart
trackler-2.2.1.43 tracks/dart/exercises/gigasecond/test/gigasecond_test.dart
trackler-2.2.1.42 tracks/dart/exercises/gigasecond/test/gigasecond_test.dart
trackler-2.2.1.41 tracks/dart/exercises/gigasecond/test/gigasecond_test.dart
trackler-2.2.1.40 tracks/dart/exercises/gigasecond/test/gigasecond_test.dart
trackler-2.2.1.39 tracks/dart/exercises/gigasecond/test/gigasecond_test.dart
trackler-2.2.1.38 tracks/dart/exercises/gigasecond/test/gigasecond_test.dart
trackler-2.2.1.37 tracks/dart/exercises/gigasecond/test/gigasecond_test.dart
trackler-2.2.1.36 tracks/dart/exercises/gigasecond/test/gigasecond_test.dart
trackler-2.2.1.35 tracks/dart/exercises/gigasecond/test/gigasecond_test.dart
trackler-2.2.1.34 tracks/dart/exercises/gigasecond/test/gigasecond_test.dart
trackler-2.2.1.33 tracks/dart/exercises/gigasecond/test/gigasecond_test.dart
trackler-2.2.1.32 tracks/dart/exercises/gigasecond/test/gigasecond_test.dart
trackler-2.2.1.31 tracks/dart/exercises/gigasecond/test/gigasecond_test.dart
trackler-2.2.1.30 tracks/dart/exercises/gigasecond/test/gigasecond_test.dart
trackler-2.2.1.29 tracks/dart/exercises/gigasecond/test/gigasecond_test.dart
trackler-2.2.1.28 tracks/dart/exercises/gigasecond/test/gigasecond_test.dart
trackler-2.2.1.27 tracks/dart/exercises/gigasecond/test/gigasecond_test.dart
trackler-2.2.1.26 tracks/dart/exercises/gigasecond/test/gigasecond_test.dart