Skip to content

Commit

Permalink
Added tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gmpassos committed Jul 13, 2020
1 parent f4c85f2 commit 83e5bbd
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions test/swiss_knife_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -883,6 +883,27 @@ void main() {
expect(isListValuesAllEquals([3, 3, 3, 2, 3]), equals(false));
expect(isListValuesAllEquals([3, 3, 3, 3, 3], 2), equals(false));
});

test('isEmptyObject', () {

expect(isEmptyObject(null), isTrue);
expect(isEmptyObject([]), isTrue);
expect(isEmptyObject({}), isTrue);
expect(isEmptyObject(Set()), isTrue);
expect(isEmptyObject(''), isTrue);

expect(isEmptyObject([1]), isFalse);
expect(isEmptyObject([1,2]), isFalse);

expect(isEmptyObject({'a':1}), isFalse);
expect(isEmptyObject({'a':1,'b':2}), isFalse);

expect(isEmptyObject(Set.from([1])), isFalse);
expect(isEmptyObject(Set.from([1,2])), isFalse);

expect(isEmptyObject('1'), isFalse);
expect(isEmptyObject('12'), isFalse);
});
});

group('Date', () {
Expand Down

0 comments on commit 83e5bbd

Please sign in to comment.