@@ -13,7 +13,7 @@ void main() {
1313 group ('CameraInitializedEvent tests' , () {
1414 test ('Constructor should initialize all properties' , () {
1515 final event = CameraInitializedEvent (
16- 1 , 1024 , 640 , ExposureMode .auto, FocusMode .auto, true , true );
16+ 1 , 1024 , 640 , ExposureMode .auto, true , FocusMode .auto, true );
1717
1818 expect (event.cameraId, 1 );
1919 expect (event.previewWidth, 1024 );
@@ -30,23 +30,23 @@ void main() {
3030 'previewWidth' : 1024.0 ,
3131 'previewHeight' : 640.0 ,
3232 'exposureMode' : 'auto' ,
33- 'focusMode' : 'auto' ,
3433 'exposurePointSupported' : true ,
34+ 'focusMode' : 'auto' ,
3535 'focusPointSupported' : true
3636 });
3737
3838 expect (event.cameraId, 1 );
3939 expect (event.previewWidth, 1024 );
4040 expect (event.previewHeight, 640 );
4141 expect (event.exposureMode, ExposureMode .auto);
42- expect (event.focusMode, FocusMode .auto);
4342 expect (event.exposurePointSupported, true );
43+ expect (event.focusMode, FocusMode .auto);
4444 expect (event.focusPointSupported, true );
4545 });
4646
4747 test ('toJson should return a map with all fields' , () {
4848 final event = CameraInitializedEvent (
49- 1 , 1024 , 640 , ExposureMode .auto, FocusMode .auto, true , true );
49+ 1 , 1024 , 640 , ExposureMode .auto, true , FocusMode .auto, true );
5050
5151 final jsonMap = event.toJson ();
5252
@@ -55,93 +55,93 @@ void main() {
5555 expect (jsonMap['previewWidth' ], 1024 );
5656 expect (jsonMap['previewHeight' ], 640 );
5757 expect (jsonMap['exposureMode' ], 'auto' );
58- expect (jsonMap['focusMode' ], 'auto' );
5958 expect (jsonMap['exposurePointSupported' ], true );
59+ expect (jsonMap['focusMode' ], 'auto' );
6060 expect (jsonMap['focusPointSupported' ], true );
6161 });
6262
6363 test ('equals should return true if objects are the same' , () {
6464 final firstEvent = CameraInitializedEvent (
65- 1 , 1024 , 640 , ExposureMode .auto, FocusMode .auto, true , true );
65+ 1 , 1024 , 640 , ExposureMode .auto, true , FocusMode .auto, true );
6666 final secondEvent = CameraInitializedEvent (
67- 1 , 1024 , 640 , ExposureMode .auto, FocusMode .auto, true , true );
67+ 1 , 1024 , 640 , ExposureMode .auto, true , FocusMode .auto, true );
6868
6969 expect (firstEvent == secondEvent, true );
7070 });
7171
7272 test ('equals should return false if cameraId is different' , () {
7373 final firstEvent = CameraInitializedEvent (
74- 1 , 1024 , 640 , ExposureMode .auto, FocusMode .auto, true , true );
74+ 1 , 1024 , 640 , ExposureMode .auto, true , FocusMode .auto, true );
7575 final secondEvent = CameraInitializedEvent (
76- 2 , 1024 , 640 , ExposureMode .auto, FocusMode .auto, true , true );
76+ 2 , 1024 , 640 , ExposureMode .auto, true , FocusMode .auto, true );
7777
7878 expect (firstEvent == secondEvent, false );
7979 });
8080
8181 test ('equals should return false if previewWidth is different' , () {
8282 final firstEvent = CameraInitializedEvent (
83- 1 , 1024 , 640 , ExposureMode .auto, FocusMode .auto, true , true );
83+ 1 , 1024 , 640 , ExposureMode .auto, true , FocusMode .auto, true );
8484 final secondEvent = CameraInitializedEvent (
85- 1 , 2048 , 640 , ExposureMode .auto, FocusMode .auto, true , true );
85+ 1 , 2048 , 640 , ExposureMode .auto, true , FocusMode .auto, true );
8686
8787 expect (firstEvent == secondEvent, false );
8888 });
8989
9090 test ('equals should return false if previewHeight is different' , () {
9191 final firstEvent = CameraInitializedEvent (
92- 1 , 1024 , 640 , ExposureMode .auto, FocusMode .auto, true , true );
92+ 1 , 1024 , 640 , ExposureMode .auto, true , FocusMode .auto, true );
9393 final secondEvent = CameraInitializedEvent (
94- 1 , 1024 , 980 , ExposureMode .auto, FocusMode .auto, true , true );
94+ 1 , 1024 , 980 , ExposureMode .auto, true , FocusMode .auto, true );
9595
9696 expect (firstEvent == secondEvent, false );
9797 });
9898
9999 test ('equals should return false if exposureMode is different' , () {
100100 final firstEvent = CameraInitializedEvent (
101- 1 , 1024 , 640 , ExposureMode .auto, FocusMode .auto, true , true );
101+ 1 , 1024 , 640 , ExposureMode .auto, true , FocusMode .auto, true );
102102 final secondEvent = CameraInitializedEvent (
103- 1 , 1024 , 640 , ExposureMode .locked, FocusMode .auto, true , true );
103+ 1 , 1024 , 640 , ExposureMode .locked, true , FocusMode .auto, true );
104104
105105 expect (firstEvent == secondEvent, false );
106106 });
107107
108108 test ('equals should return false if exposurePointSupported is different' ,
109109 () {
110110 final firstEvent = CameraInitializedEvent (
111- 1 , 1024 , 640 , ExposureMode .auto, FocusMode .auto, true , true );
111+ 1 , 1024 , 640 , ExposureMode .auto, true , FocusMode .auto, true );
112112 final secondEvent = CameraInitializedEvent (
113- 1 , 1024 , 640 , ExposureMode .auto, FocusMode .auto, false , true );
113+ 1 , 1024 , 640 , ExposureMode .auto, false , FocusMode .auto, true );
114114
115115 expect (firstEvent == secondEvent, false );
116116 });
117117
118118 test ('equals should return false if focusMode is different' , () {
119119 final firstEvent = CameraInitializedEvent (
120- 1 , 1024 , 640 , ExposureMode .auto, FocusMode .auto, true , true );
120+ 1 , 1024 , 640 , ExposureMode .auto, true , FocusMode .auto, true );
121121 final secondEvent = CameraInitializedEvent (
122- 1 , 1024 , 640 , ExposureMode .auto, FocusMode .locked, true , true );
122+ 1 , 1024 , 640 , ExposureMode .auto, true , FocusMode .locked, true );
123123
124124 expect (firstEvent == secondEvent, false );
125125 });
126126
127127 test ('equals should return false if focusPointSupported is different' , () {
128128 final firstEvent = CameraInitializedEvent (
129- 1 , 1024 , 640 , ExposureMode .auto, FocusMode .auto, true , true );
129+ 1 , 1024 , 640 , ExposureMode .auto, true , FocusMode .auto, true );
130130 final secondEvent = CameraInitializedEvent (
131- 1 , 1024 , 640 , ExposureMode .auto, FocusMode .auto, true , false );
131+ 1 , 1024 , 640 , ExposureMode .auto, true , FocusMode .auto, false );
132132
133133 expect (firstEvent == secondEvent, false );
134134 });
135135
136136 test ('hashCode should match hashCode of all properties' , () {
137137 final event = CameraInitializedEvent (
138- 1 , 1024 , 640 , ExposureMode .auto, FocusMode .auto, true , true );
138+ 1 , 1024 , 640 , ExposureMode .auto, true , FocusMode .auto, true );
139139 final expectedHashCode = event.cameraId.hashCode ^
140140 event.previewWidth.hashCode ^
141141 event.previewHeight.hashCode ^
142142 event.exposureMode.hashCode ^
143- event.focusMode.hashCode ^
144143 event.exposurePointSupported.hashCode ^
144+ event.focusMode.hashCode ^
145145 event.focusPointSupported.hashCode;
146146
147147 expect (event.hashCode, expectedHashCode);
0 commit comments