Skip to content

Commit 7589160

Browse files
authored
Merge pull request #981 from Oknarb258/master
New test cases for contribute_exercise_test.dart
2 parents e0b0aba + c6ab5cf commit 7589160

File tree

4 files changed

+593
-86
lines changed

4 files changed

+593
-86
lines changed

lib/widgets/routines/gym_mode/navigation.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,14 +79,14 @@ class NavigationHeader extends StatelessWidget {
7979
final PageController _controller;
8080
final String _title;
8181
final Map<Exercise, int> exercisePages;
82-
final int ?totalPages;
82+
final int? totalPages;
8383

8484
const NavigationHeader(
8585
this._title,
8686
this._controller, {
87-
this.totalPages,
88-
required this.exercisePages
89-
});
87+
this.totalPages,
88+
required this.exercisePages,
89+
});
9090

9191
Widget getDialog(BuildContext context) {
9292
final TextButton? endWorkoutButton = totalPages != null

test/exercises/contribute_exercise_image_test.mocks.dart

Lines changed: 99 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,10 @@ class MockAddExerciseProvider extends _i1.Mock implements _i6.AddExerciseProvide
7272
_i2.WgerBaseProvider get baseProvider =>
7373
(super.noSuchMethod(
7474
Invocation.getter(#baseProvider),
75-
returnValue: _FakeWgerBaseProvider_0(this, Invocation.getter(#baseProvider)),
75+
returnValue: _FakeWgerBaseProvider_0(
76+
this,
77+
Invocation.getter(#baseProvider),
78+
),
7679
)
7780
as _i2.WgerBaseProvider);
7881

@@ -88,23 +91,35 @@ class MockAddExerciseProvider extends _i1.Mock implements _i6.AddExerciseProvide
8891
String get author =>
8992
(super.noSuchMethod(
9093
Invocation.getter(#author),
91-
returnValue: _i8.dummyValue<String>(this, Invocation.getter(#author)),
94+
returnValue: _i8.dummyValue<String>(
95+
this,
96+
Invocation.getter(#author),
97+
),
9298
)
9399
as String);
94100

95101
@override
96102
List<String> get alternateNamesEn =>
97-
(super.noSuchMethod(Invocation.getter(#alternateNamesEn), returnValue: <String>[])
103+
(super.noSuchMethod(
104+
Invocation.getter(#alternateNamesEn),
105+
returnValue: <String>[],
106+
)
98107
as List<String>);
99108

100109
@override
101110
List<String> get alternateNamesTrans =>
102-
(super.noSuchMethod(Invocation.getter(#alternateNamesTrans), returnValue: <String>[])
111+
(super.noSuchMethod(
112+
Invocation.getter(#alternateNamesTrans),
113+
returnValue: <String>[],
114+
)
103115
as List<String>);
104116

105117
@override
106118
List<_i9.Equipment> get equipment =>
107-
(super.noSuchMethod(Invocation.getter(#equipment), returnValue: <_i9.Equipment>[])
119+
(super.noSuchMethod(
120+
Invocation.getter(#equipment),
121+
returnValue: <_i9.Equipment>[],
122+
)
108123
as List<_i9.Equipment>);
109124

110125
@override
@@ -121,12 +136,18 @@ class MockAddExerciseProvider extends _i1.Mock implements _i6.AddExerciseProvide
121136

122137
@override
123138
List<_i10.Muscle> get primaryMuscles =>
124-
(super.noSuchMethod(Invocation.getter(#primaryMuscles), returnValue: <_i10.Muscle>[])
139+
(super.noSuchMethod(
140+
Invocation.getter(#primaryMuscles),
141+
returnValue: <_i10.Muscle>[],
142+
)
125143
as List<_i10.Muscle>);
126144

127145
@override
128146
List<_i10.Muscle> get secondaryMuscles =>
129-
(super.noSuchMethod(Invocation.getter(#secondaryMuscles), returnValue: <_i10.Muscle>[])
147+
(super.noSuchMethod(
148+
Invocation.getter(#secondaryMuscles),
149+
returnValue: <_i10.Muscle>[],
150+
)
130151
as List<_i10.Muscle>);
131152

132153
@override
@@ -141,8 +162,10 @@ class MockAddExerciseProvider extends _i1.Mock implements _i6.AddExerciseProvide
141162
as _i11.ExerciseSubmissionApi);
142163

143164
@override
144-
set author(String? value) =>
145-
super.noSuchMethod(Invocation.setter(#author, value), returnValueForMissingStub: null);
165+
set author(String? value) => super.noSuchMethod(
166+
Invocation.setter(#author, value),
167+
returnValueForMissingStub: null,
168+
);
146169

147170
@override
148171
set exerciseNameEn(String? value) => super.noSuchMethod(
@@ -157,8 +180,10 @@ class MockAddExerciseProvider extends _i1.Mock implements _i6.AddExerciseProvide
157180
);
158181

159182
@override
160-
set descriptionEn(String? value) =>
161-
super.noSuchMethod(Invocation.setter(#descriptionEn, value), returnValueForMissingStub: null);
183+
set descriptionEn(String? value) => super.noSuchMethod(
184+
Invocation.setter(#descriptionEn, value),
185+
returnValueForMissingStub: null,
186+
);
162187

163188
@override
164189
set descriptionTrans(String? value) => super.noSuchMethod(
@@ -167,8 +192,10 @@ class MockAddExerciseProvider extends _i1.Mock implements _i6.AddExerciseProvide
167192
);
168193

169194
@override
170-
set languageEn(_i12.Language? value) =>
171-
super.noSuchMethod(Invocation.setter(#languageEn, value), returnValueForMissingStub: null);
195+
set languageEn(_i12.Language? value) => super.noSuchMethod(
196+
Invocation.setter(#languageEn, value),
197+
returnValueForMissingStub: null,
198+
);
172199

173200
@override
174201
set languageTranslation(_i12.Language? value) => super.noSuchMethod(
@@ -189,12 +216,16 @@ class MockAddExerciseProvider extends _i1.Mock implements _i6.AddExerciseProvide
189216
);
190217

191218
@override
192-
set category(_i13.ExerciseCategory? value) =>
193-
super.noSuchMethod(Invocation.setter(#category, value), returnValueForMissingStub: null);
219+
set category(_i13.ExerciseCategory? value) => super.noSuchMethod(
220+
Invocation.setter(#category, value),
221+
returnValueForMissingStub: null,
222+
);
194223

195224
@override
196-
set equipment(List<_i9.Equipment>? equipment) =>
197-
super.noSuchMethod(Invocation.setter(#equipment, equipment), returnValueForMissingStub: null);
225+
set equipment(List<_i9.Equipment>? equipment) => super.noSuchMethod(
226+
Invocation.setter(#equipment, equipment),
227+
returnValueForMissingStub: null,
228+
);
198229

199230
@override
200231
set variationConnectToExercise(int? value) => super.noSuchMethod(
@@ -225,8 +256,10 @@ class MockAddExerciseProvider extends _i1.Mock implements _i6.AddExerciseProvide
225256
(super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) as bool);
226257

227258
@override
228-
void clear() =>
229-
super.noSuchMethod(Invocation.method(#clear, []), returnValueForMissingStub: null);
259+
void clear() => super.noSuchMethod(
260+
Invocation.method(#clear, []),
261+
returnValueForMissingStub: null,
262+
);
230263

231264
@override
232265
void addExerciseImages(List<_i7.ExerciseSubmissionImage>? images) => super.noSuchMethod(
@@ -235,8 +268,10 @@ class MockAddExerciseProvider extends _i1.Mock implements _i6.AddExerciseProvide
235268
);
236269

237270
@override
238-
void removeImage(String? path) =>
239-
super.noSuchMethod(Invocation.method(#removeImage, [path]), returnValueForMissingStub: null);
271+
void removeImage(String? path) => super.noSuchMethod(
272+
Invocation.method(#removeImage, [path]),
273+
returnValueForMissingStub: null,
274+
);
240275

241276
@override
242277
_i14.Future<int> postExerciseToServer() =>
@@ -284,12 +319,16 @@ class MockAddExerciseProvider extends _i1.Mock implements _i6.AddExerciseProvide
284319
);
285320

286321
@override
287-
void dispose() =>
288-
super.noSuchMethod(Invocation.method(#dispose, []), returnValueForMissingStub: null);
322+
void dispose() => super.noSuchMethod(
323+
Invocation.method(#dispose, []),
324+
returnValueForMissingStub: null,
325+
);
289326

290327
@override
291-
void notifyListeners() =>
292-
super.noSuchMethod(Invocation.method(#notifyListeners, []), returnValueForMissingStub: null);
328+
void notifyListeners() => super.noSuchMethod(
329+
Invocation.method(#notifyListeners, []),
330+
returnValueForMissingStub: null,
331+
);
293332
}
294333

295334
/// A class which mocks [WgerBaseProvider].
@@ -317,23 +356,34 @@ class MockWgerBaseProvider extends _i1.Mock implements _i2.WgerBaseProvider {
317356
as _i5.Client);
318357

319358
@override
320-
set auth(_i4.AuthProvider? value) =>
321-
super.noSuchMethod(Invocation.setter(#auth, value), returnValueForMissingStub: null);
359+
set auth(_i4.AuthProvider? value) => super.noSuchMethod(
360+
Invocation.setter(#auth, value),
361+
returnValueForMissingStub: null,
362+
);
322363

323364
@override
324-
set client(_i5.Client? value) =>
325-
super.noSuchMethod(Invocation.setter(#client, value), returnValueForMissingStub: null);
365+
set client(_i5.Client? value) => super.noSuchMethod(
366+
Invocation.setter(#client, value),
367+
returnValueForMissingStub: null,
368+
);
326369

327370
@override
328371
Map<String, String> getDefaultHeaders({bool? includeAuth = false}) =>
329372
(super.noSuchMethod(
330-
Invocation.method(#getDefaultHeaders, [], {#includeAuth: includeAuth}),
373+
Invocation.method(#getDefaultHeaders, [], {
374+
#includeAuth: includeAuth,
375+
}),
331376
returnValue: <String, String>{},
332377
)
333378
as Map<String, String>);
334379

335380
@override
336-
Uri makeUrl(String? path, {int? id, String? objectMethod, Map<String, dynamic>? query}) =>
381+
Uri makeUrl(
382+
String? path, {
383+
int? id,
384+
String? objectMethod,
385+
Map<String, dynamic>? query,
386+
}) =>
337387
(super.noSuchMethod(
338388
Invocation.method(
339389
#makeUrl,
@@ -368,18 +418,28 @@ class MockWgerBaseProvider extends _i1.Mock implements _i2.WgerBaseProvider {
368418
as _i14.Future<List<dynamic>>);
369419

370420
@override
371-
_i14.Future<Map<String, dynamic>> post(Map<String, dynamic>? data, Uri? uri) =>
421+
_i14.Future<Map<String, dynamic>> post(
422+
Map<String, dynamic>? data,
423+
Uri? uri,
424+
) =>
372425
(super.noSuchMethod(
373426
Invocation.method(#post, [data, uri]),
374-
returnValue: _i14.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
427+
returnValue: _i14.Future<Map<String, dynamic>>.value(
428+
<String, dynamic>{},
429+
),
375430
)
376431
as _i14.Future<Map<String, dynamic>>);
377432

378433
@override
379-
_i14.Future<Map<String, dynamic>> patch(Map<String, dynamic>? data, Uri? uri) =>
434+
_i14.Future<Map<String, dynamic>> patch(
435+
Map<String, dynamic>? data,
436+
Uri? uri,
437+
) =>
380438
(super.noSuchMethod(
381439
Invocation.method(#patch, [data, uri]),
382-
returnValue: _i14.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
440+
returnValue: _i14.Future<Map<String, dynamic>>.value(
441+
<String, dynamic>{},
442+
),
383443
)
384444
as _i14.Future<Map<String, dynamic>>);
385445

@@ -388,7 +448,10 @@ class MockWgerBaseProvider extends _i1.Mock implements _i2.WgerBaseProvider {
388448
(super.noSuchMethod(
389449
Invocation.method(#deleteRequest, [url, id]),
390450
returnValue: _i14.Future<_i5.Response>.value(
391-
_FakeResponse_5(this, Invocation.method(#deleteRequest, [url, id])),
451+
_FakeResponse_5(
452+
this,
453+
Invocation.method(#deleteRequest, [url, id]),
454+
),
392455
),
393456
)
394457
as _i14.Future<_i5.Response>);

0 commit comments

Comments
 (0)