Skip to content

Commit 4f1abf3

Browse files
author
FELIPE EDUARDO MORSCHEL
committed
Adding three more tests returning it to DateTime
1 parent 525ec5b commit 4f1abf3

File tree

1 file changed

+26
-3
lines changed

1 file changed

+26
-3
lines changed

test/time_test.dart

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -623,13 +623,36 @@ void main() {
623623
);
624624
},
625625
);
626-
test(
627-
'returns it when is after min and before max',
626+
group(
627+
'returns it',
628628
() {
629629
final it = DateTime(2022, DateTime.september, 1);
630630
final min = DateTime(2022, DateTime.august, 1);
631631
final max = DateTime(2022, DateTime.september, 30);
632-
expect(it.clamp(min: min, max: max), equals(it));
632+
test(
633+
'when both min and max are null',
634+
() {
635+
expect(it.clamp(), equals(it));
636+
},
637+
);
638+
test(
639+
'when is longer than min and max is null',
640+
() {
641+
expect(it.clamp(min: min), equals(it));
642+
},
643+
);
644+
test(
645+
'when is shorter than max and min is null',
646+
() {
647+
expect(it.clamp(max: max), equals(it));
648+
},
649+
);
650+
test(
651+
'when is longer than min and shorter than max',
652+
() {
653+
expect(it.clamp(min: min, max: max), equals(it));
654+
},
655+
);
633656
},
634657
);
635658
test(

0 commit comments

Comments
 (0)