mirror of
https://github.com/hmalik144/easy_cc_flutter.git
synced 2025-12-10 03:05:34 +00:00
Unit tests added
This commit is contained in:
341
test/unit_test/repository_test.mocks.dart
Normal file
341
test/unit_test/repository_test.mocks.dart
Normal file
@@ -0,0 +1,341 @@
|
|||||||
|
// Mocks generated by Mockito 5.3.2 from annotations
|
||||||
|
// in easy_cc_flutter/test/unit_test/repository_test.dart.
|
||||||
|
// Do not manually edit this file.
|
||||||
|
|
||||||
|
// ignore_for_file: no_leading_underscores_for_library_prefixes
|
||||||
|
import 'dart:async' as _i8;
|
||||||
|
|
||||||
|
import 'package:dio/dio.dart' as _i5;
|
||||||
|
import 'package:easy_cc_flutter/data/network/backupCurrencyApi.dart' as _i6;
|
||||||
|
import 'package:easy_cc_flutter/data/network/currencyApi.dart' as _i4;
|
||||||
|
import 'package:easy_cc_flutter/data/prefs/CurrencyPair.dart' as _i2;
|
||||||
|
import 'package:easy_cc_flutter/data/prefs/PreferenceProvider.dart' as _i7;
|
||||||
|
import 'package:mockito/mockito.dart' as _i1;
|
||||||
|
import 'package:retrofit/retrofit.dart' as _i3;
|
||||||
|
|
||||||
|
// ignore_for_file: type=lint
|
||||||
|
// ignore_for_file: avoid_redundant_argument_values
|
||||||
|
// ignore_for_file: avoid_setters_without_getters
|
||||||
|
// ignore_for_file: comment_references
|
||||||
|
// ignore_for_file: implementation_imports
|
||||||
|
// ignore_for_file: invalid_use_of_visible_for_testing_member
|
||||||
|
// ignore_for_file: prefer_const_constructors
|
||||||
|
// ignore_for_file: unnecessary_parenthesis
|
||||||
|
// ignore_for_file: camel_case_types
|
||||||
|
// ignore_for_file: subtype_of_sealed_class
|
||||||
|
|
||||||
|
class _FakeCurrencyPair_0 extends _i1.SmartFake implements _i2.CurrencyPair {
|
||||||
|
_FakeCurrencyPair_0(
|
||||||
|
Object parent,
|
||||||
|
Invocation parentInvocation,
|
||||||
|
) : super(
|
||||||
|
parent,
|
||||||
|
parentInvocation,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
class _FakeHttpResponse_1<T> extends _i1.SmartFake
|
||||||
|
implements _i3.HttpResponse<T> {
|
||||||
|
_FakeHttpResponse_1(
|
||||||
|
Object parent,
|
||||||
|
Invocation parentInvocation,
|
||||||
|
) : super(
|
||||||
|
parent,
|
||||||
|
parentInvocation,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
class _FakeResponseObject_2 extends _i1.SmartFake
|
||||||
|
implements _i4.ResponseObject {
|
||||||
|
_FakeResponseObject_2(
|
||||||
|
Object parent,
|
||||||
|
Invocation parentInvocation,
|
||||||
|
) : super(
|
||||||
|
parent,
|
||||||
|
parentInvocation,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
class _FakeResponse_3<T> extends _i1.SmartFake implements _i5.Response<T> {
|
||||||
|
_FakeResponse_3(
|
||||||
|
Object parent,
|
||||||
|
Invocation parentInvocation,
|
||||||
|
) : super(
|
||||||
|
parent,
|
||||||
|
parentInvocation,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
class _FakeCurrencyResponse_4 extends _i1.SmartFake
|
||||||
|
implements _i6.CurrencyResponse {
|
||||||
|
_FakeCurrencyResponse_4(
|
||||||
|
Object parent,
|
||||||
|
Invocation parentInvocation,
|
||||||
|
) : super(
|
||||||
|
parent,
|
||||||
|
parentInvocation,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
class _FakeRequestOptions_5 extends _i1.SmartFake
|
||||||
|
implements _i5.RequestOptions {
|
||||||
|
_FakeRequestOptions_5(
|
||||||
|
Object parent,
|
||||||
|
Invocation parentInvocation,
|
||||||
|
) : super(
|
||||||
|
parent,
|
||||||
|
parentInvocation,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// A class which mocks [PreferenceProvider].
|
||||||
|
///
|
||||||
|
/// See the documentation for Mockito's code generation for more information.
|
||||||
|
class MockPreferenceProvider extends _i1.Mock
|
||||||
|
implements _i7.PreferenceProvider {
|
||||||
|
MockPreferenceProvider() {
|
||||||
|
_i1.throwOnMissingStub(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
_i8.Future<void> init() => (super.noSuchMethod(
|
||||||
|
Invocation.method(
|
||||||
|
#init,
|
||||||
|
[],
|
||||||
|
),
|
||||||
|
returnValue: _i8.Future<void>.value(),
|
||||||
|
returnValueForMissingStub: _i8.Future<void>.value(),
|
||||||
|
) as _i8.Future<void>);
|
||||||
|
@override
|
||||||
|
_i8.Future<void> saveConversionPair(
|
||||||
|
String? s1,
|
||||||
|
String? s2,
|
||||||
|
) =>
|
||||||
|
(super.noSuchMethod(
|
||||||
|
Invocation.method(
|
||||||
|
#saveConversionPair,
|
||||||
|
[
|
||||||
|
s1,
|
||||||
|
s2,
|
||||||
|
],
|
||||||
|
),
|
||||||
|
returnValue: _i8.Future<void>.value(),
|
||||||
|
returnValueForMissingStub: _i8.Future<void>.value(),
|
||||||
|
) as _i8.Future<void>);
|
||||||
|
@override
|
||||||
|
_i2.CurrencyPair getConversionPair() => (super.noSuchMethod(
|
||||||
|
Invocation.method(
|
||||||
|
#getConversionPair,
|
||||||
|
[],
|
||||||
|
),
|
||||||
|
returnValue: _FakeCurrencyPair_0(
|
||||||
|
this,
|
||||||
|
Invocation.method(
|
||||||
|
#getConversionPair,
|
||||||
|
[],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
) as _i2.CurrencyPair);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// A class which mocks [CurrencyApi].
|
||||||
|
///
|
||||||
|
/// See the documentation for Mockito's code generation for more information.
|
||||||
|
class MockCurrencyApi extends _i1.Mock implements _i4.CurrencyApi {
|
||||||
|
MockCurrencyApi() {
|
||||||
|
_i1.throwOnMissingStub(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
_i8.Future<_i3.HttpResponse<_i4.ResponseObject>> getConversion(
|
||||||
|
String? apiKey,
|
||||||
|
String? currency,
|
||||||
|
) =>
|
||||||
|
(super.noSuchMethod(
|
||||||
|
Invocation.method(
|
||||||
|
#getConversion,
|
||||||
|
[
|
||||||
|
apiKey,
|
||||||
|
currency,
|
||||||
|
],
|
||||||
|
),
|
||||||
|
returnValue: _i8.Future<_i3.HttpResponse<_i4.ResponseObject>>.value(
|
||||||
|
_FakeHttpResponse_1<_i4.ResponseObject>(
|
||||||
|
this,
|
||||||
|
Invocation.method(
|
||||||
|
#getConversion,
|
||||||
|
[
|
||||||
|
apiKey,
|
||||||
|
currency,
|
||||||
|
],
|
||||||
|
),
|
||||||
|
)),
|
||||||
|
) as _i8.Future<_i3.HttpResponse<_i4.ResponseObject>>);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// A class which mocks [BackupCurrencyApi].
|
||||||
|
///
|
||||||
|
/// See the documentation for Mockito's code generation for more information.
|
||||||
|
class MockBackupCurrencyApi extends _i1.Mock implements _i6.BackupCurrencyApi {
|
||||||
|
MockBackupCurrencyApi() {
|
||||||
|
_i1.throwOnMissingStub(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
_i8.Future<_i3.HttpResponse<_i6.CurrencyResponse>> getCurrencyRate(
|
||||||
|
String? currencyFrom,
|
||||||
|
String? currencyTo,
|
||||||
|
) =>
|
||||||
|
(super.noSuchMethod(
|
||||||
|
Invocation.method(
|
||||||
|
#getCurrencyRate,
|
||||||
|
[
|
||||||
|
currencyFrom,
|
||||||
|
currencyTo,
|
||||||
|
],
|
||||||
|
),
|
||||||
|
returnValue: _i8.Future<_i3.HttpResponse<_i6.CurrencyResponse>>.value(
|
||||||
|
_FakeHttpResponse_1<_i6.CurrencyResponse>(
|
||||||
|
this,
|
||||||
|
Invocation.method(
|
||||||
|
#getCurrencyRate,
|
||||||
|
[
|
||||||
|
currencyFrom,
|
||||||
|
currencyTo,
|
||||||
|
],
|
||||||
|
),
|
||||||
|
)),
|
||||||
|
) as _i8.Future<_i3.HttpResponse<_i6.CurrencyResponse>>);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// A class which mocks [HttpResponse].
|
||||||
|
///
|
||||||
|
/// See the documentation for Mockito's code generation for more information.
|
||||||
|
class MockHttpResponse extends _i1.Mock
|
||||||
|
implements _i3.HttpResponse<_i4.ResponseObject> {
|
||||||
|
@override
|
||||||
|
_i4.ResponseObject get data => (super.noSuchMethod(
|
||||||
|
Invocation.getter(#data),
|
||||||
|
returnValue: _FakeResponseObject_2(
|
||||||
|
this,
|
||||||
|
Invocation.getter(#data),
|
||||||
|
),
|
||||||
|
returnValueForMissingStub: _FakeResponseObject_2(
|
||||||
|
this,
|
||||||
|
Invocation.getter(#data),
|
||||||
|
),
|
||||||
|
) as _i4.ResponseObject);
|
||||||
|
@override
|
||||||
|
_i5.Response<dynamic> get response => (super.noSuchMethod(
|
||||||
|
Invocation.getter(#response),
|
||||||
|
returnValue: _FakeResponse_3<dynamic>(
|
||||||
|
this,
|
||||||
|
Invocation.getter(#response),
|
||||||
|
),
|
||||||
|
returnValueForMissingStub: _FakeResponse_3<dynamic>(
|
||||||
|
this,
|
||||||
|
Invocation.getter(#response),
|
||||||
|
),
|
||||||
|
) as _i5.Response<dynamic>);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// A class which mocks [HttpResponse].
|
||||||
|
///
|
||||||
|
/// See the documentation for Mockito's code generation for more information.
|
||||||
|
class MockCurrencyResponse extends _i1.Mock
|
||||||
|
implements _i3.HttpResponse<_i6.CurrencyResponse> {
|
||||||
|
@override
|
||||||
|
_i6.CurrencyResponse get data => (super.noSuchMethod(
|
||||||
|
Invocation.getter(#data),
|
||||||
|
returnValue: _FakeCurrencyResponse_4(
|
||||||
|
this,
|
||||||
|
Invocation.getter(#data),
|
||||||
|
),
|
||||||
|
returnValueForMissingStub: _FakeCurrencyResponse_4(
|
||||||
|
this,
|
||||||
|
Invocation.getter(#data),
|
||||||
|
),
|
||||||
|
) as _i6.CurrencyResponse);
|
||||||
|
@override
|
||||||
|
_i5.Response<dynamic> get response => (super.noSuchMethod(
|
||||||
|
Invocation.getter(#response),
|
||||||
|
returnValue: _FakeResponse_3<dynamic>(
|
||||||
|
this,
|
||||||
|
Invocation.getter(#response),
|
||||||
|
),
|
||||||
|
returnValueForMissingStub: _FakeResponse_3<dynamic>(
|
||||||
|
this,
|
||||||
|
Invocation.getter(#response),
|
||||||
|
),
|
||||||
|
) as _i5.Response<dynamic>);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// A class which mocks [DioError].
|
||||||
|
///
|
||||||
|
/// See the documentation for Mockito's code generation for more information.
|
||||||
|
class MockDioError extends _i1.Mock implements _i5.DioError {
|
||||||
|
@override
|
||||||
|
_i5.RequestOptions get requestOptions => (super.noSuchMethod(
|
||||||
|
Invocation.getter(#requestOptions),
|
||||||
|
returnValue: _FakeRequestOptions_5(
|
||||||
|
this,
|
||||||
|
Invocation.getter(#requestOptions),
|
||||||
|
),
|
||||||
|
returnValueForMissingStub: _FakeRequestOptions_5(
|
||||||
|
this,
|
||||||
|
Invocation.getter(#requestOptions),
|
||||||
|
),
|
||||||
|
) as _i5.RequestOptions);
|
||||||
|
@override
|
||||||
|
set requestOptions(_i5.RequestOptions? _requestOptions) => super.noSuchMethod(
|
||||||
|
Invocation.setter(
|
||||||
|
#requestOptions,
|
||||||
|
_requestOptions,
|
||||||
|
),
|
||||||
|
returnValueForMissingStub: null,
|
||||||
|
);
|
||||||
|
@override
|
||||||
|
set response(_i5.Response<dynamic>? _response) => super.noSuchMethod(
|
||||||
|
Invocation.setter(
|
||||||
|
#response,
|
||||||
|
_response,
|
||||||
|
),
|
||||||
|
returnValueForMissingStub: null,
|
||||||
|
);
|
||||||
|
@override
|
||||||
|
_i5.DioErrorType get type => (super.noSuchMethod(
|
||||||
|
Invocation.getter(#type),
|
||||||
|
returnValue: _i5.DioErrorType.connectTimeout,
|
||||||
|
returnValueForMissingStub: _i5.DioErrorType.connectTimeout,
|
||||||
|
) as _i5.DioErrorType);
|
||||||
|
@override
|
||||||
|
set type(_i5.DioErrorType? _type) => super.noSuchMethod(
|
||||||
|
Invocation.setter(
|
||||||
|
#type,
|
||||||
|
_type,
|
||||||
|
),
|
||||||
|
returnValueForMissingStub: null,
|
||||||
|
);
|
||||||
|
@override
|
||||||
|
set error(dynamic _error) => super.noSuchMethod(
|
||||||
|
Invocation.setter(
|
||||||
|
#error,
|
||||||
|
_error,
|
||||||
|
),
|
||||||
|
returnValueForMissingStub: null,
|
||||||
|
);
|
||||||
|
@override
|
||||||
|
set stackTrace(StackTrace? stack) => super.noSuchMethod(
|
||||||
|
Invocation.setter(
|
||||||
|
#stackTrace,
|
||||||
|
stack,
|
||||||
|
),
|
||||||
|
returnValueForMissingStub: null,
|
||||||
|
);
|
||||||
|
@override
|
||||||
|
String get message => (super.noSuchMethod(
|
||||||
|
Invocation.getter(#message),
|
||||||
|
returnValue: '',
|
||||||
|
returnValueForMissingStub: '',
|
||||||
|
) as String);
|
||||||
|
}
|
||||||
117
test/unit_test/viewmodel_test.mocks.dart
Normal file
117
test/unit_test/viewmodel_test.mocks.dart
Normal file
@@ -0,0 +1,117 @@
|
|||||||
|
// Mocks generated by Mockito 5.3.2 from annotations
|
||||||
|
// in easy_cc_flutter/test/unit_test/viewmodel_test.dart.
|
||||||
|
// Do not manually edit this file.
|
||||||
|
|
||||||
|
// ignore_for_file: no_leading_underscores_for_library_prefixes
|
||||||
|
import 'dart:async' as _i5;
|
||||||
|
|
||||||
|
import 'package:easy_cc_flutter/data/model/Currency.dart' as _i3;
|
||||||
|
import 'package:easy_cc_flutter/data/prefs/CurrencyPair.dart' as _i2;
|
||||||
|
import 'package:easy_cc_flutter/data/repository/RepositoryImpl.dart' as _i4;
|
||||||
|
import 'package:mockito/mockito.dart' as _i1;
|
||||||
|
import 'package:retrofit/retrofit.dart' as _i6;
|
||||||
|
|
||||||
|
// ignore_for_file: type=lint
|
||||||
|
// ignore_for_file: avoid_redundant_argument_values
|
||||||
|
// ignore_for_file: avoid_setters_without_getters
|
||||||
|
// ignore_for_file: comment_references
|
||||||
|
// ignore_for_file: implementation_imports
|
||||||
|
// ignore_for_file: invalid_use_of_visible_for_testing_member
|
||||||
|
// ignore_for_file: prefer_const_constructors
|
||||||
|
// ignore_for_file: unnecessary_parenthesis
|
||||||
|
// ignore_for_file: camel_case_types
|
||||||
|
// ignore_for_file: subtype_of_sealed_class
|
||||||
|
|
||||||
|
class _FakeCurrencyPair_0 extends _i1.SmartFake implements _i2.CurrencyPair {
|
||||||
|
_FakeCurrencyPair_0(
|
||||||
|
Object parent,
|
||||||
|
Invocation parentInvocation,
|
||||||
|
) : super(
|
||||||
|
parent,
|
||||||
|
parentInvocation,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
class _FakeCurrency_1 extends _i1.SmartFake implements _i3.Currency {
|
||||||
|
_FakeCurrency_1(
|
||||||
|
Object parent,
|
||||||
|
Invocation parentInvocation,
|
||||||
|
) : super(
|
||||||
|
parent,
|
||||||
|
parentInvocation,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// A class which mocks [RepositoryImpl].
|
||||||
|
///
|
||||||
|
/// See the documentation for Mockito's code generation for more information.
|
||||||
|
class MockRepositoryImpl extends _i1.Mock implements _i4.RepositoryImpl {
|
||||||
|
MockRepositoryImpl() {
|
||||||
|
_i1.throwOnMissingStub(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
_i2.CurrencyPair getConversionPair() => (super.noSuchMethod(
|
||||||
|
Invocation.method(
|
||||||
|
#getConversionPair,
|
||||||
|
[],
|
||||||
|
),
|
||||||
|
returnValue: _FakeCurrencyPair_0(
|
||||||
|
this,
|
||||||
|
Invocation.method(
|
||||||
|
#getConversionPair,
|
||||||
|
[],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
) as _i2.CurrencyPair);
|
||||||
|
@override
|
||||||
|
_i5.Future<void> setConversionPair(
|
||||||
|
String? fromCurrency,
|
||||||
|
String? toCurrency,
|
||||||
|
) =>
|
||||||
|
(super.noSuchMethod(
|
||||||
|
Invocation.method(
|
||||||
|
#setConversionPair,
|
||||||
|
[
|
||||||
|
fromCurrency,
|
||||||
|
toCurrency,
|
||||||
|
],
|
||||||
|
),
|
||||||
|
returnValue: _i5.Future<void>.value(),
|
||||||
|
returnValueForMissingStub: _i5.Future<void>.value(),
|
||||||
|
) as _i5.Future<void>);
|
||||||
|
@override
|
||||||
|
_i5.Future<_i3.Currency> getConversationRateFromApi(
|
||||||
|
String? fromCurrency,
|
||||||
|
String? toCurrency,
|
||||||
|
) =>
|
||||||
|
(super.noSuchMethod(
|
||||||
|
Invocation.method(
|
||||||
|
#getConversationRateFromApi,
|
||||||
|
[
|
||||||
|
fromCurrency,
|
||||||
|
toCurrency,
|
||||||
|
],
|
||||||
|
),
|
||||||
|
returnValue: _i5.Future<_i3.Currency>.value(_FakeCurrency_1(
|
||||||
|
this,
|
||||||
|
Invocation.method(
|
||||||
|
#getConversationRateFromApi,
|
||||||
|
[
|
||||||
|
fromCurrency,
|
||||||
|
toCurrency,
|
||||||
|
],
|
||||||
|
),
|
||||||
|
)),
|
||||||
|
) as _i5.Future<_i3.Currency>);
|
||||||
|
@override
|
||||||
|
_i5.Future<T> getDataFromApiCall<T>(
|
||||||
|
_i5.Future<_i6.HttpResponse<T>>? apiCall) =>
|
||||||
|
(super.noSuchMethod(
|
||||||
|
Invocation.method(
|
||||||
|
#getDataFromApiCall,
|
||||||
|
[apiCall],
|
||||||
|
),
|
||||||
|
returnValue: _i5.Future<T>.value(null),
|
||||||
|
) as _i5.Future<T>);
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user