LibAC-dart/test/time_test.dart

24 lines
604 B
Dart

import 'package:libac_dart/utils/TimeUtils.dart';
import 'package:test/expect.dart';
import 'package:test/scaffolding.dart';
void main() {
test("Parse time notation", () {
Time time = Time.fromNotation("4h9s");
expect(time.toString(), "4h9s");
expect(time.hours, 4);
expect(time.minutes, 0);
expect(time.seconds, 9);
});
test("Add time", () {
// Depends on first test working!
Time time = Time.fromNotation("4h9s");
time.add(Time(hours: 0, minutes: 80, seconds: 1));
expect(time.hours, 5);
expect(time.minutes, 20);
expect(time.seconds, 10);
});
}