File tree Expand file tree Collapse file tree 1 file changed +77
-0
lines changed Expand file tree Collapse file tree 1 file changed +77
-0
lines changed Original file line number Diff line number Diff line change
1
+ import 'package:flutter_news_app/config/flavor_config.dart' ;
2
+ import 'package:flutter_test/flutter_test.dart' ;
3
+
4
+ void main () {
5
+ const tBaseUrlNewsEndpoint = 'testBaseUrlNewsEndpoint' ;
6
+ final values = FlavorValues (
7
+ baseUrlNewsEndpoint: tBaseUrlNewsEndpoint,
8
+ );
9
+
10
+ test (
11
+ 'Should return true while call the function isProduction with flavor production' ,
12
+ () async {
13
+ // arrange
14
+ FlavorConfig (
15
+ flavor: Flavor .production,
16
+ values: values,
17
+ );
18
+
19
+ // act
20
+ final result = FlavorConfig .isProduction ();
21
+
22
+ // assert
23
+ expect (result, true );
24
+ },
25
+ );
26
+
27
+ test (
28
+ 'Should return false while call the function isProduction with flavor development' ,
29
+ () async {
30
+ // arrange
31
+ FlavorConfig (
32
+ flavor: Flavor .development,
33
+ values: values,
34
+ );
35
+
36
+ // act
37
+ final result = FlavorConfig .isProduction ();
38
+
39
+ // assert
40
+ expect (result, false );
41
+ },
42
+ );
43
+
44
+ test (
45
+ 'Should return false while call the function isDevelopment with flavor production' ,
46
+ () async {
47
+ // arrange
48
+ FlavorConfig (
49
+ flavor: Flavor .production,
50
+ values: values,
51
+ );
52
+
53
+ // act
54
+ final result = FlavorConfig .isDevelopment ();
55
+
56
+ // assert
57
+ expect (result, false );
58
+ },
59
+ );
60
+
61
+ test (
62
+ 'Should return true while call the function isProduction with flavor development' ,
63
+ () async {
64
+ // arrange
65
+ FlavorConfig (
66
+ flavor: Flavor .development,
67
+ values: values,
68
+ );
69
+
70
+ // act
71
+ final result = FlavorConfig .isDevelopment ();
72
+
73
+ // assert
74
+ expect (result, true );
75
+ },
76
+ );
77
+ }
You can’t perform that action at this time.
0 commit comments