@@ -13,13 +13,13 @@ void main() {
13
13
group ('CameraInitializedEvent tests' , () {
14
14
test ('Constructor should initialize all properties' , () {
15
15
final event = CameraInitializedEvent (
16
- 1 , 1024 , 640 , ExposureMode .auto, FocusMode .auto , true , true );
16
+ 1 , 1024 , 640 , ExposureMode .auto, FocusMode .continuous , true , true );
17
17
18
18
expect (event.cameraId, 1 );
19
19
expect (event.previewWidth, 1024 );
20
20
expect (event.previewHeight, 640 );
21
21
expect (event.exposureMode, ExposureMode .auto);
22
- expect (event.focusMode, FocusMode .auto );
22
+ expect (event.focusMode, FocusMode .continuous );
23
23
expect (event.exposurePointSupported, true );
24
24
expect (event.focusPointSupported, true );
25
25
});
@@ -30,7 +30,7 @@ void main() {
30
30
'previewWidth' : 1024.0 ,
31
31
'previewHeight' : 640.0 ,
32
32
'exposureMode' : 'auto' ,
33
- 'focusMode' : 'auto ' ,
33
+ 'focusMode' : 'continuous ' ,
34
34
'exposurePointSupported' : true ,
35
35
'focusPointSupported' : true
36
36
});
@@ -39,14 +39,14 @@ void main() {
39
39
expect (event.previewWidth, 1024 );
40
40
expect (event.previewHeight, 640 );
41
41
expect (event.exposureMode, ExposureMode .auto);
42
- expect (event.focusMode, FocusMode .auto );
42
+ expect (event.focusMode, FocusMode .continuous );
43
43
expect (event.exposurePointSupported, true );
44
44
expect (event.focusPointSupported, true );
45
45
});
46
46
47
47
test ('toJson should return a map with all fields' , () {
48
48
final event = CameraInitializedEvent (
49
- 1 , 1024 , 640 , ExposureMode .auto, FocusMode .auto , true , true );
49
+ 1 , 1024 , 640 , ExposureMode .auto, FocusMode .continuous , true , true );
50
50
51
51
final jsonMap = event.toJson ();
52
52
@@ -55,87 +55,87 @@ void main() {
55
55
expect (jsonMap['previewWidth' ], 1024 );
56
56
expect (jsonMap['previewHeight' ], 640 );
57
57
expect (jsonMap['exposureMode' ], 'auto' );
58
- expect (jsonMap['focusMode' ], 'auto ' );
58
+ expect (jsonMap['focusMode' ], 'continuous ' );
59
59
expect (jsonMap['exposurePointSupported' ], true );
60
60
expect (jsonMap['focusPointSupported' ], true );
61
61
});
62
62
63
63
test ('equals should return true if objects are the same' , () {
64
64
final firstEvent = CameraInitializedEvent (
65
- 1 , 1024 , 640 , ExposureMode .auto, FocusMode .auto , true , true );
65
+ 1 , 1024 , 640 , ExposureMode .auto, FocusMode .continuous , true , true );
66
66
final secondEvent = CameraInitializedEvent (
67
- 1 , 1024 , 640 , ExposureMode .auto, FocusMode .auto , true , true );
67
+ 1 , 1024 , 640 , ExposureMode .auto, FocusMode .continuous , true , true );
68
68
69
69
expect (firstEvent == secondEvent, true );
70
70
});
71
71
72
72
test ('equals should return false if cameraId is different' , () {
73
73
final firstEvent = CameraInitializedEvent (
74
- 1 , 1024 , 640 , ExposureMode .auto, FocusMode .auto , true , true );
74
+ 1 , 1024 , 640 , ExposureMode .auto, FocusMode .continuous , true , true );
75
75
final secondEvent = CameraInitializedEvent (
76
- 2 , 1024 , 640 , ExposureMode .auto, FocusMode .auto , true , true );
76
+ 2 , 1024 , 640 , ExposureMode .auto, FocusMode .continuous , true , true );
77
77
78
78
expect (firstEvent == secondEvent, false );
79
79
});
80
80
81
81
test ('equals should return false if previewWidth is different' , () {
82
82
final firstEvent = CameraInitializedEvent (
83
- 1 , 1024 , 640 , ExposureMode .auto, FocusMode .auto , true , true );
83
+ 1 , 1024 , 640 , ExposureMode .auto, FocusMode .continuous , true , true );
84
84
final secondEvent = CameraInitializedEvent (
85
- 1 , 2048 , 640 , ExposureMode .auto, FocusMode .auto , true , true );
85
+ 1 , 2048 , 640 , ExposureMode .auto, FocusMode .continuous , true , true );
86
86
87
87
expect (firstEvent == secondEvent, false );
88
88
});
89
89
90
90
test ('equals should return false if previewHeight is different' , () {
91
91
final firstEvent = CameraInitializedEvent (
92
- 1 , 1024 , 640 , ExposureMode .auto, FocusMode .auto , true , true );
92
+ 1 , 1024 , 640 , ExposureMode .auto, FocusMode .continuous , true , true );
93
93
final secondEvent = CameraInitializedEvent (
94
- 1 , 1024 , 980 , ExposureMode .auto, FocusMode .auto , true , true );
94
+ 1 , 1024 , 980 , ExposureMode .auto, FocusMode .continuous , true , true );
95
95
96
96
expect (firstEvent == secondEvent, false );
97
97
});
98
98
99
99
test ('equals should return false if exposureMode is different' , () {
100
100
final firstEvent = CameraInitializedEvent (
101
- 1 , 1024 , 640 , ExposureMode .auto, FocusMode .auto , true , true );
101
+ 1 , 1024 , 640 , ExposureMode .auto, FocusMode .continuous , true , true );
102
102
final secondEvent = CameraInitializedEvent (
103
- 1 , 1024 , 640 , ExposureMode .locked, FocusMode .auto , true , true );
103
+ 1 , 1024 , 640 , ExposureMode .locked, FocusMode .continuous , true , true );
104
104
105
105
expect (firstEvent == secondEvent, false );
106
106
});
107
107
108
108
test ('equals should return false if exposurePointSupported is different' ,
109
109
() {
110
110
final firstEvent = CameraInitializedEvent (
111
- 1 , 1024 , 640 , ExposureMode .auto, FocusMode .auto , true , true );
111
+ 1 , 1024 , 640 , ExposureMode .auto, FocusMode .continuous , true , true );
112
112
final secondEvent = CameraInitializedEvent (
113
- 1 , 1024 , 640 , ExposureMode .auto, FocusMode .auto , false , true );
113
+ 1 , 1024 , 640 , ExposureMode .auto, FocusMode .continuous , false , true );
114
114
115
115
expect (firstEvent == secondEvent, false );
116
116
});
117
117
118
118
test ('equals should return false if focusMode is different' , () {
119
119
final firstEvent = CameraInitializedEvent (
120
- 1 , 1024 , 640 , ExposureMode .auto, FocusMode .auto , true , true );
120
+ 1 , 1024 , 640 , ExposureMode .auto, FocusMode .continuous , true , true );
121
121
final secondEvent = CameraInitializedEvent (
122
- 1 , 1024 , 640 , ExposureMode .auto, FocusMode .locked , true , true );
122
+ 1 , 1024 , 640 , ExposureMode .auto, FocusMode .auto , true , true );
123
123
124
124
expect (firstEvent == secondEvent, false );
125
125
});
126
126
127
127
test ('equals should return false if focusPointSupported is different' , () {
128
128
final firstEvent = CameraInitializedEvent (
129
- 1 , 1024 , 640 , ExposureMode .auto, FocusMode .auto , true , true );
129
+ 1 , 1024 , 640 , ExposureMode .auto, FocusMode .continuous , true , true );
130
130
final secondEvent = CameraInitializedEvent (
131
- 1 , 1024 , 640 , ExposureMode .auto, FocusMode .auto , true , false );
131
+ 1 , 1024 , 640 , ExposureMode .auto, FocusMode .continuous , true , false );
132
132
133
133
expect (firstEvent == secondEvent, false );
134
134
});
135
135
136
136
test ('hashCode should match hashCode of all properties' , () {
137
137
final event = CameraInitializedEvent (
138
- 1 , 1024 , 640 , ExposureMode .auto, FocusMode .auto , true , true );
138
+ 1 , 1024 , 640 , ExposureMode .auto, FocusMode .continuous , true , true );
139
139
final expectedHashCode = event.cameraId.hashCode ^
140
140
event.previewWidth.hashCode ^
141
141
event.previewHeight.hashCode ^
0 commit comments