Comments (2)
i find a the soultion :)
just replace this import
import 'package:mockito/mockito.dart';
to this
import 'package:mocktail/mocktail.dart';
**so the testing i correct some error this is new one **
class MockAuthRepo extends Mock implements AuthRepositories {
@override
Future<Either<Failure, BaseModel>> testCase({required ApiRequest apiRequest}) async {
return await Future.value(right(AppModel.otpVerify));
}
}
void main() {
late MockAuthRepo mockAuthRepo;
late PhoneVerifyUseCase useCase;
OtpPageModel otpPageModel = OtpPageModel(phoneNumber: '0939048067');
ApiRequest apiRequest = ApiRequest(
method: ApiMethod.post,
endPoint: EndPoints.login,
model: AppModel.loginModel,
body: otpPageModel.toJson(),
);
setUp(() {
mockAuthRepo = MockAuthRepo();
useCase= PhoneVerifyUseCase(authRepositories: mockAuthRepo);
});
test('should get trivia for the number from the repository', () async{
// Setup
when(() => mockAuthRepo.phoneVerify(apiRequest: apiRequest))
.thenAnswer((_) async => right(AppModel.loginModel));
// Action
final result = await useCase(apiRequest: apiRequest);
// Verification
expect(result, Right(AppModel.loginModel));
});
}
and the repo is
abstract class AuthRepositories{
Future<Either<Failure,BaseModel>> phoneVerify({required ApiRequest apiRequest});
Future<Either<Failure,BaseModel>> otpVerify({required ApiRequest apiRequest});
Future<Either<Failure,BaseModel>> getAppOptions({required ApiRequest apiRequest});
}
and the use case is
`
class PhoneVerifyUseCase{
AuthRepositories authRepositories ;
PhoneVerifyUseCase({required this.authRepositories});
Future<Either<Failure,BaseModel>>call({required ApiRequest apiRequest})async{
return await authRepositories.phoneVerify(apiRequest: apiRequest);
}
}`
from flutter_native_splash.
How is this related to the flutter_native_splash
package?
from flutter_native_splash.
Related Issues (20)
- _TypeError (type 'Null' is not a subtype of type 'Map<dynamic, dynamic>') dart flutter HOT 3
- migrate `js` to `web` package HOT 1
- Android applications will have a white screen when cold starting from the home widget, and splash will not be displayed. HOT 1
- android:forceDarkAllowed requires API level 29 (current min is 19)
- Splash screen is taking too much time HOT 1
- hi HOT 1
- [Android] app icon not showing on Android 12 HOT 7
- the splash screen doesn't show in android devices below android 12 but in android 12 it's work fine HOT 1
- Incomplete removal of flutter_native_splash HOT 4
- Splash screen not shown properly on android HOT 1
- Logo is not displaying for the first time after installing APK. Display at successive times. - Android HOT 1
- using an asset from a package cause splash screen generation to fail HOT 3
- Image_background not working HOT 1
- When uploading an App to AppStore connect I get "Asset validation failed" HOT 1
- background_image is not working HOT 3
- Splash screen image is cropped on Android 13 HOT 1
- smooth transition from native splash sceen to an animated page - how to do? HOT 3
- flutter_amazonpaymentservices is working fine in debug mode, but when it's released, it shows a technical error. HOT 1
- Branding safearea in iOS HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flutter_native_splash.