Last active
May 27, 2020 14:21
-
-
Save enriquesaid/016348c4061d5bee9f5daad532524d5b to your computer and use it in GitHub Desktop.
flutter main file test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter_app/main.dart'; | |
import 'package:flutter_test/flutter_test.dart'; | |
import 'package:mockito/mockito.dart'; | |
class FakeFunctions { | |
void runApp(dynamic widget) {} | |
} | |
class FunctionsMock extends Mock implements FakeFunctions {} | |
void main() { | |
test('App bootstrap method', () async { | |
var functionMock = FunctionsMock(); | |
var app = App(); | |
await app.bootstrap(functionMock.runApp); | |
verify(functionMock.runApp(any)); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment