mirror of
https://github.com/hmalik144/easy_cc_flutter.git
synced 2025-12-10 03:05:34 +00:00
Retrofit classes implemented with interceptor and base features
This commit is contained in:
@@ -73,7 +73,7 @@ void main() {
|
||||
|
||||
// When
|
||||
when(mockResponse.data).thenReturn(responseObject);
|
||||
when(currencyApi.getConversion(dotenv.env['apiKey']!, currency))
|
||||
when(currencyApi.getConversion(currency))
|
||||
.thenAnswer((_) async => mockResponse);
|
||||
|
||||
// Then
|
||||
@@ -91,7 +91,7 @@ void main() {
|
||||
String currency = "AUD_GBP";
|
||||
|
||||
// When
|
||||
when(currencyApi.getConversion(dotenv.env['apiKey']!, currency))
|
||||
when(currencyApi.getConversion(currency))
|
||||
.thenAnswer((_) async => Future.error(MockDioError()));
|
||||
when(mockResponse.data).thenReturn(currencyResponse);
|
||||
when(backupCurrencyApi.getCurrencyRate("AUD", "GBP"))
|
||||
@@ -110,7 +110,7 @@ void main() {
|
||||
|
||||
// When
|
||||
when(backUpError.error).thenReturn("Error message");
|
||||
when(currencyApi.getConversion(dotenv.env['apiKey']!, currency))
|
||||
when(currencyApi.getConversion(currency))
|
||||
.thenAnswer((_) async => Future.error(MockDioError()));
|
||||
when(backupCurrencyApi.getCurrencyRate("AUD", "GBP"))
|
||||
.thenAnswer((_) async => Future.error(backUpError));
|
||||
|
||||
Reference in New Issue
Block a user