Skip to content

Commit d96ae7a

Browse files
authored
Merge pull request #100 from Akshatji800/services_unit_tests
Adds date_converter and file_size_helper unit tests
2 parents dfa00a8 + f1b0833 commit d96ae7a

File tree

3 files changed

+25
-1
lines changed

3 files changed

+25
-1
lines changed

android/app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
2626

2727
android {
2828
compileSdkVersion 33
29-
29+
3030
defaultConfig {
3131
multiDexEnabled true
3232
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).

test/date_converter_unit_test.dart

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import 'package:flood_mobile/Services/date_converter.dart';
2+
import 'package:flutter_test/flutter_test.dart';
3+
4+
void main() {
5+
test(
6+
"Test Date Converting Function",
7+
() {
8+
final date = dateConverter(timestamp: 1659201146);
9+
expect(date, '30 / 7 / 2022');
10+
},
11+
);
12+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import 'package:flood_mobile/Services/file_size_helper.dart';
2+
import 'package:flutter_test/flutter_test.dart';
3+
4+
void main() {
5+
test(
6+
"Test File Size Calculating Function",
7+
() {
8+
final size = filesize(1156498920);
9+
expect(size, '1.08 GB');
10+
},
11+
);
12+
}

0 commit comments

Comments
 (0)