Retrofit classes implemented with interceptor and base features

This commit is contained in:
2022-09-29 22:41:22 +01:00
parent d5a906d998
commit 057c6284ce
11 changed files with 53 additions and 18 deletions

View File

@@ -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));