2024-05-24 14:36:51 -07:00
|
|
|
import 'package:libac_dart/utils/TimeUtils.dart';
|
|
|
|
import 'package:test/expect.dart';
|
|
|
|
import 'package:test/scaffolding.dart';
|
2024-05-23 17:25:14 -07:00
|
|
|
|
|
|
|
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);
|
|
|
|
});
|
|
|
|
}
|