Skip to content

Commit

Permalink
updated
Browse files Browse the repository at this point in the history
  • Loading branch information
MarsadMaqsood committed May 14, 2023
1 parent 3a3e802 commit 2789b5c
Showing 1 changed file with 37 additions and 16 deletions.
53 changes: 37 additions & 16 deletions test/updater_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,43 @@ void main() {
final log = <MethodCall>[];

setUp(() {
packageChannel.setMockMethodCallHandler((MethodCall methodCall) async {
log.add(methodCall);
switch (methodCall.method) {
case 'getAll':
return <String, dynamic>{
'appName': 'updater',
'buildNumber': '1',
'packageName': 'io.flutter.plugins.updaterexample',
'version': '1.0',
'installerStore': null,
};
default:
assert(false);
return null;
}
});
TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger
.setMockMethodCallHandler(
packageChannel,
(MethodCall methodCall) async {
log.add(methodCall);
switch (methodCall.method) {
case 'getAll':
return <String, dynamic>{
'appName': 'updater',
'buildNumber': '1',
'packageName': 'io.flutter.plugins.updaterexample',
'version': '1.0',
'installerStore': null,
};
default:
assert(false);
return null;
}
},
);

// packageChannel.setMockMethodCallHandler((MethodCall methodCall) async {
// log.add(methodCall);
// switch (methodCall.method) {
// case 'getAll':
// return <String, dynamic>{
// 'appName': 'updater',
// 'buildNumber': '1',
// 'packageName': 'io.flutter.plugins.updaterexample',
// 'version': '1.0',
// 'installerStore': null,
// };
// default:
// assert(false);
// return null;
// }
// });
});

test('Should get app version', () async {
Expand Down

0 comments on commit 2789b5c

Please sign in to comment.