-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit b5ae485
Showing
8 changed files
with
111 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Files and directories created by pub | ||
.dart_tool/ | ||
.packages | ||
# Remove the following pattern if you wish to check in your lock file | ||
pubspec.lock | ||
|
||
# Conventional directory for build outputs | ||
build/ | ||
|
||
# Directory created by dartdoc | ||
doc/api/ | ||
|
||
.flutter-plugins |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
## 1.0.0 | ||
|
||
- Initial version, created by Stagehand |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
A library for Dart developers. | ||
|
||
Created from templates made available by Stagehand under a BSD-style | ||
[license](https://github.com/dart-lang/stagehand/blob/master/LICENSE). | ||
|
||
## Usage | ||
|
||
A simple usage example: | ||
|
||
```dart | ||
import 'package:google_sign_in_mocks/google_sign_in_mocks.dart'; | ||
main() { | ||
final googleSignIn = MockGoogleSignIn(); | ||
final signinAccount = await googleSignIn.signIn(); | ||
final signinAuthentication = await signinAccount.authentication; | ||
} | ||
``` | ||
|
||
## Features and bugs | ||
|
||
Please file feature requests and bugs at the [issue tracker][tracker]. | ||
|
||
[tracker]: http://example.com/issues/replaceme |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Defines a default set of lint rules enforced for | ||
# projects at Google. For details and rationale, | ||
# see https://github.com/dart-lang/pedantic#enabled-lints. | ||
include: package:pedantic/analysis_options.yaml | ||
|
||
# For lint rules and documentation, see http://dart-lang.github.io/linter/lints. | ||
# Uncomment to specify additional rules. | ||
# linter: | ||
# rules: | ||
# - camel_case_types | ||
|
||
analyzer: | ||
# exclude: | ||
# - path/to/excluded/files/** |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/// Support for doing something awesome. | ||
/// | ||
/// More dartdocs go here. | ||
library google_sign_in_mocks; | ||
|
||
export 'src/google_sign_in_mocks_base.dart'; | ||
|
||
// TODO: Export any libraries intended for clients of this package. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import 'package:google_sign_in/google_sign_in.dart'; | ||
import 'package:mockito/mockito.dart'; | ||
|
||
class MockGoogleSignIn extends Mock implements GoogleSignIn { | ||
@override | ||
Future<GoogleSignInAccount> signIn() { | ||
return Future.value(MockGoogleSignInAccount()); | ||
} | ||
} | ||
|
||
class MockGoogleSignInAccount extends Mock implements GoogleSignInAccount { | ||
@override | ||
Future<GoogleSignInAuthentication> get authentication => | ||
Future.value(MockGoogleSignInAuthentication()); | ||
} | ||
|
||
class MockGoogleSignInAuthentication extends Mock | ||
implements GoogleSignInAuthentication {} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: google_sign_in_mocks | ||
description: A starting point for Dart libraries or applications. | ||
# version: 1.0.0 | ||
# homepage: https://www.example.com | ||
# author: Anh Tuan Nguyen <atn832@gmail.com> | ||
|
||
environment: | ||
sdk: '>=2.2.0 <3.0.0' | ||
|
||
dependencies: | ||
flutter: | ||
sdk: flutter | ||
google_sign_in: ^4.0.11 | ||
mockito: ^4.1.0 | ||
|
||
dev_dependencies: | ||
flutter_test: | ||
sdk: flutter | ||
pedantic: ^1.0.0 | ||
test: ^1.0.0 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import 'package:google_sign_in_mocks/google_sign_in_mocks.dart'; | ||
import 'package:test/test.dart'; | ||
|
||
void main() { | ||
test('Basic test', () async { | ||
final googleSignIn = MockGoogleSignIn(); | ||
final signinAccount = await googleSignIn.signIn(); | ||
final signinAuthentication = await signinAccount.authentication; | ||
expect(signinAuthentication, isNotNull); | ||
}); | ||
} |