diff --git a/exercises/gigasecond/README.md b/exercises/gigasecond/README.md index 14f9ba48..60a52dac 100644 --- a/exercises/gigasecond/README.md +++ b/exercises/gigasecond/README.md @@ -1,6 +1,7 @@ # Gigasecond -Calculate the moment when someone has lived for 10^9 seconds. +Given a moment, determine the moment that would be after a gigasecond +has passed. A gigasecond is 10^9 (1,000,000,000) seconds. diff --git a/exercises/gigasecond/pubspec.yaml b/exercises/gigasecond/pubspec.yaml index 90f38024..53935218 100644 --- a/exercises/gigasecond/pubspec.yaml +++ b/exercises/gigasecond/pubspec.yaml @@ -1,4 +1,5 @@ name: 'gigasecond' +version: 2.0.0 environment: sdk: '>=2.0.0 <3.0.0' dev_dependencies: diff --git a/exercises/gigasecond/test/gigasecond_test.dart b/exercises/gigasecond/test/gigasecond_test.dart index 91b1b833..399ffc29 100644 --- a/exercises/gigasecond/test/gigasecond_test.dart +++ b/exercises/gigasecond/test/gigasecond_test.dart @@ -1,48 +1,50 @@ -import 'package:test/test.dart'; import 'package:gigasecond/gigasecond.dart'; +import 'package:test/test.dart'; void main() { group("Gigasecond", gigasecondTests); } void gigasecondTests() { - test("date only specification of time", () { - final DateTime birthDate = new DateTime.utc(2011, DateTime.april, 25); - final DateTime result = add(birthDate); - DateTime expectedDate = new DateTime.utc(2043, DateTime.january, 1, 1, 46, 40); - - expect(result, equals(expectedDate)); - }, skip: false); - - test("second test for date only specification of time", () { - final DateTime birthDate = new DateTime.utc(1977, DateTime.june, 13); - final DateTime result = add(birthDate); - DateTime expectedDate = new DateTime.utc(2009, DateTime.february, 19, 1, 46, 40); - - expect(result, equals(expectedDate)); - }, skip: true); - - test("third test for date only specification of time", () { - final DateTime birthDate = new DateTime.utc(1959, DateTime.july, 19); - final DateTime result = add(birthDate); - DateTime expectedDate = new DateTime.utc(1991, DateTime.march, 27, 1, 46, 40); - - expect(result, equals(expectedDate)); - }, skip: true); - - test("full time specified", () { - final DateTime birthDate = new DateTime.utc(2015, DateTime.january, 24, 22, 00, 00); - final DateTime result = add(birthDate); - DateTime expectedDate = new DateTime.utc(2046, DateTime.october, 2, 23, 46, 40); - - expect(result, equals(expectedDate)); - }, skip: true); - - test("full time with day roll-over", () { - final DateTime birthDate = new DateTime.utc(2015, DateTime.january, 24, 23, 59, 59); - final DateTime result = add(birthDate); - DateTime expectedDate = new DateTime.utc(2046, DateTime.october, 3, 01, 46, 39); - - expect(result, equals(expectedDate)); - }, skip: true); + group('Add one gigasecond to the input. ', () { + test('date only specification of time', () { + final DateTime birthDate = new DateTime.utc(2011, DateTime.april, 25); + final DateTime result = add(birthDate); + DateTime expectedDate = new DateTime.utc(2043, DateTime.january, 1, 1, 46, 40); + + expect(result, equals(expectedDate)); + }, skip: false); + + test('second test for date only specification of time', () { + final DateTime birthDate = new DateTime.utc(1977, DateTime.june, 13); + final DateTime result = add(birthDate); + DateTime expectedDate = new DateTime.utc(2009, DateTime.february, 19, 1, 46, 40); + + expect(result, equals(expectedDate)); + }, skip: true); + + test('third test for date only specification of time', () { + final DateTime birthDate = new DateTime.utc(1959, DateTime.july, 19); + final DateTime result = add(birthDate); + DateTime expectedDate = new DateTime.utc(1991, DateTime.march, 27, 1, 46, 40); + + expect(result, equals(expectedDate)); + }, skip: true); + + test('full time specified', () { + final DateTime birthDate = new DateTime.utc(2015, DateTime.january, 24, 22, 00, 00); + final DateTime result = add(birthDate); + DateTime expectedDate = new DateTime.utc(2046, DateTime.october, 2, 23, 46, 40); + + expect(result, equals(expectedDate)); + }, skip: true); + + test('full time with day roll-over', () { + final DateTime birthDate = new DateTime.utc(2015, DateTime.january, 24, 23, 59, 59); + final DateTime result = add(birthDate); + DateTime expectedDate = new DateTime.utc(2046, DateTime.october, 3, 01, 46, 39); + + expect(result, equals(expectedDate)); + }, skip: true); + }); }