diff --git a/test/models/exchange/estimated_rate_exchange_form_state_test.mocks.dart b/test/models/exchange/estimated_rate_exchange_form_state_test.mocks.dart deleted file mode 100644 index 82a7eceb7..000000000 --- a/test/models/exchange/estimated_rate_exchange_form_state_test.mocks.dart +++ /dev/null @@ -1,249 +0,0 @@ -// Mocks generated by Mockito 5.2.0 from annotations -// in stackwallet/test/models/exchange/estimated_rate_exchange_form_state_test.dart. -// Do not manually edit this file. - -import 'dart:async' as _i5; - -import 'package:decimal/decimal.dart' as _i7; -import 'package:http/http.dart' as _i4; -import 'package:mockito/mockito.dart' as _i1; -import 'package:stackwallet/models/exchange/change_now/cn_exchange_estimate.dart' - as _i10; -import 'package:stackwallet/models/exchange/change_now/exchange_transaction.dart' - as _i12; -import 'package:stackwallet/models/exchange/change_now/exchange_transaction_status.dart' - as _i13; -import 'package:stackwallet/models/exchange/response_objects/currency.dart' - as _i6; -import 'package:stackwallet/models/exchange/response_objects/estimate.dart' - as _i9; -import 'package:stackwallet/models/exchange/response_objects/fixed_rate_market.dart' - as _i11; -import 'package:stackwallet/models/exchange/response_objects/pair.dart' as _i14; -import 'package:stackwallet/models/exchange/response_objects/range.dart' as _i8; -import 'package:stackwallet/services/exchange/change_now/change_now_api.dart' - as _i3; -import 'package:stackwallet/services/exchange/exchange_response.dart' as _i2; - -// 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 - -class _FakeExchangeResponse_0 extends _i1.Fake - implements _i2.ExchangeResponse {} - -/// A class which mocks [ChangeNowAPI]. -/// -/// See the documentation for Mockito's code generation for more information. -class MockChangeNowAPI extends _i1.Mock implements _i3.ChangeNowAPI { - MockChangeNowAPI() { - _i1.throwOnMissingStub(this); - } - - @override - set client(_i4.Client? _client) => - super.noSuchMethod(Invocation.setter(#client, _client), - returnValueForMissingStub: null); - @override - _i5.Future<_i2.ExchangeResponse>> getAvailableCurrencies( - {bool? fixedRate, bool? active}) => - (super.noSuchMethod( - Invocation.method(#getAvailableCurrencies, [], - {#fixedRate: fixedRate, #active: active}), - returnValue: Future<_i2.ExchangeResponse>>.value( - _FakeExchangeResponse_0>())) as _i5 - .Future<_i2.ExchangeResponse>>); - @override - _i5.Future<_i2.ExchangeResponse>> getPairedCurrencies( - {String? ticker, bool? fixedRate}) => - (super.noSuchMethod( - Invocation.method(#getPairedCurrencies, [], - {#ticker: ticker, #fixedRate: fixedRate}), - returnValue: Future<_i2.ExchangeResponse>>.value( - _FakeExchangeResponse_0>())) as _i5 - .Future<_i2.ExchangeResponse>>); - @override - _i5.Future<_i2.ExchangeResponse<_i7.Decimal>> getMinimalExchangeAmount( - {String? fromTicker, String? toTicker, String? apiKey}) => - (super.noSuchMethod( - Invocation.method(#getMinimalExchangeAmount, [], { - #fromTicker: fromTicker, - #toTicker: toTicker, - #apiKey: apiKey - }), - returnValue: Future<_i2.ExchangeResponse<_i7.Decimal>>.value( - _FakeExchangeResponse_0<_i7.Decimal>())) - as _i5.Future<_i2.ExchangeResponse<_i7.Decimal>>); - @override - _i5.Future<_i2.ExchangeResponse<_i8.Range>> getRange( - {String? fromTicker, - String? toTicker, - bool? isFixedRate, - String? apiKey}) => - (super.noSuchMethod( - Invocation.method(#getRange, [], { - #fromTicker: fromTicker, - #toTicker: toTicker, - #isFixedRate: isFixedRate, - #apiKey: apiKey - }), - returnValue: Future<_i2.ExchangeResponse<_i8.Range>>.value( - _FakeExchangeResponse_0<_i8.Range>())) - as _i5.Future<_i2.ExchangeResponse<_i8.Range>>); - @override - _i5.Future<_i2.ExchangeResponse<_i9.Estimate>> getEstimatedExchangeAmount( - {String? fromTicker, - String? toTicker, - _i7.Decimal? fromAmount, - String? apiKey}) => - (super.noSuchMethod( - Invocation.method(#getEstimatedExchangeAmount, [], { - #fromTicker: fromTicker, - #toTicker: toTicker, - #fromAmount: fromAmount, - #apiKey: apiKey - }), - returnValue: Future<_i2.ExchangeResponse<_i9.Estimate>>.value( - _FakeExchangeResponse_0<_i9.Estimate>())) - as _i5.Future<_i2.ExchangeResponse<_i9.Estimate>>); - @override - _i5.Future<_i2.ExchangeResponse<_i9.Estimate>> - getEstimatedExchangeAmountFixedRate( - {String? fromTicker, - String? toTicker, - _i7.Decimal? fromAmount, - bool? reversed, - String? apiKey}) => - (super.noSuchMethod( - Invocation.method(#getEstimatedExchangeAmountFixedRate, [], { - #fromTicker: fromTicker, - #toTicker: toTicker, - #fromAmount: fromAmount, - #reversed: reversed, - #apiKey: apiKey - }), - returnValue: Future<_i2.ExchangeResponse<_i9.Estimate>>.value( - _FakeExchangeResponse_0<_i9.Estimate>())) - as _i5.Future<_i2.ExchangeResponse<_i9.Estimate>>); - @override - _i5.Future<_i2.ExchangeResponse<_i10.CNExchangeEstimate>> - getEstimatedExchangeAmountV2( - {String? fromTicker, - String? toTicker, - _i10.CNEstimateType? fromOrTo, - _i7.Decimal? amount, - String? fromNetwork, - String? toNetwork, - _i10.CNFlowType? flow = _i10.CNFlowType.standard, - String? apiKey}) => - (super.noSuchMethod( - Invocation.method(#getEstimatedExchangeAmountV2, [], { - #fromTicker: fromTicker, - #toTicker: toTicker, - #fromOrTo: fromOrTo, - #amount: amount, - #fromNetwork: fromNetwork, - #toNetwork: toNetwork, - #flow: flow, - #apiKey: apiKey - }), - returnValue: Future< - _i2.ExchangeResponse<_i10.CNExchangeEstimate>>.value( - _FakeExchangeResponse_0<_i10.CNExchangeEstimate>())) - as _i5.Future<_i2.ExchangeResponse<_i10.CNExchangeEstimate>>); - @override - _i5.Future<_i2.ExchangeResponse>> - getAvailableFixedRateMarkets({String? apiKey}) => (super.noSuchMethod( - Invocation.method( - #getAvailableFixedRateMarkets, [], {#apiKey: apiKey}), - returnValue: - Future<_i2.ExchangeResponse>>.value( - _FakeExchangeResponse_0>())) as _i5 - .Future<_i2.ExchangeResponse>>); - @override - _i5.Future<_i2.ExchangeResponse<_i12.ExchangeTransaction>> - createStandardExchangeTransaction( - {String? fromTicker, - String? toTicker, - String? receivingAddress, - _i7.Decimal? amount, - String? extraId = r'', - String? userId = r'', - String? contactEmail = r'', - String? refundAddress = r'', - String? refundExtraId = r'', - String? apiKey}) => - (super.noSuchMethod( - Invocation.method(#createStandardExchangeTransaction, [], { - #fromTicker: fromTicker, - #toTicker: toTicker, - #receivingAddress: receivingAddress, - #amount: amount, - #extraId: extraId, - #userId: userId, - #contactEmail: contactEmail, - #refundAddress: refundAddress, - #refundExtraId: refundExtraId, - #apiKey: apiKey - }), - returnValue: Future< - _i2.ExchangeResponse<_i12.ExchangeTransaction>>.value( - _FakeExchangeResponse_0<_i12.ExchangeTransaction>())) - as _i5.Future<_i2.ExchangeResponse<_i12.ExchangeTransaction>>); - @override - _i5.Future<_i2.ExchangeResponse<_i12.ExchangeTransaction>> - createFixedRateExchangeTransaction( - {String? fromTicker, - String? toTicker, - String? receivingAddress, - _i7.Decimal? amount, - String? rateId, - String? extraId = r'', - String? userId = r'', - String? contactEmail = r'', - String? refundAddress = r'', - String? refundExtraId = r'', - String? apiKey}) => - (super.noSuchMethod( - Invocation.method(#createFixedRateExchangeTransaction, [], { - #fromTicker: fromTicker, - #toTicker: toTicker, - #receivingAddress: receivingAddress, - #amount: amount, - #rateId: rateId, - #extraId: extraId, - #userId: userId, - #contactEmail: contactEmail, - #refundAddress: refundAddress, - #refundExtraId: refundExtraId, - #apiKey: apiKey - }), - returnValue: Future< - _i2.ExchangeResponse<_i12.ExchangeTransaction>>.value( - _FakeExchangeResponse_0<_i12.ExchangeTransaction>())) - as _i5.Future<_i2.ExchangeResponse<_i12.ExchangeTransaction>>); - @override - _i5.Future<_i2.ExchangeResponse<_i13.ExchangeTransactionStatus>> - getTransactionStatus({String? id, String? apiKey}) => (super.noSuchMethod( - Invocation.method( - #getTransactionStatus, [], {#id: id, #apiKey: apiKey}), - returnValue: - Future<_i2.ExchangeResponse<_i13.ExchangeTransactionStatus>>.value( - _FakeExchangeResponse_0<_i13.ExchangeTransactionStatus>())) as _i5 - .Future<_i2.ExchangeResponse<_i13.ExchangeTransactionStatus>>); - @override - _i5.Future<_i2.ExchangeResponse>> - getAvailableFloatingRatePairs({bool? includePartners = false}) => - (super.noSuchMethod( - Invocation.method(#getAvailableFloatingRatePairs, [], - {#includePartners: includePartners}), - returnValue: Future<_i2.ExchangeResponse>>.value( - _FakeExchangeResponse_0>())) as _i5 - .Future<_i2.ExchangeResponse>>); -} diff --git a/test/screen_tests/exchange/exchange_view_test.mocks.dart b/test/screen_tests/exchange/exchange_view_test.mocks.dart index da0972645..6f98b499e 100644 --- a/test/screen_tests/exchange/exchange_view_test.mocks.dart +++ b/test/screen_tests/exchange/exchange_view_test.mocks.dart @@ -427,6 +427,7 @@ class MockChangeNowAPI extends _i1.Mock implements _i12.ChangeNowAPI { String? toTicker, _i15.Decimal? fromAmount, bool? reversed, + bool? useRateId = true, String? apiKey}) => (super.noSuchMethod( Invocation.method(#getEstimatedExchangeAmountFixedRate, [], { @@ -434,6 +435,7 @@ class MockChangeNowAPI extends _i1.Mock implements _i12.ChangeNowAPI { #toTicker: toTicker, #fromAmount: fromAmount, #reversed: reversed, + #useRateId: useRateId, #apiKey: apiKey }), returnValue: Future<_i2.ExchangeResponse<_i17.Estimate>>.value( @@ -512,6 +514,7 @@ class MockChangeNowAPI extends _i1.Mock implements _i12.ChangeNowAPI { String? receivingAddress, _i15.Decimal? amount, String? rateId, + bool? reversed, String? extraId = r'', String? userId = r'', String? contactEmail = r'', @@ -525,6 +528,7 @@ class MockChangeNowAPI extends _i1.Mock implements _i12.ChangeNowAPI { #receivingAddress: receivingAddress, #amount: amount, #rateId: rateId, + #reversed: reversed, #extraId: extraId, #userId: userId, #contactEmail: contactEmail, diff --git a/test/services/change_now/change_now_test.dart b/test/services/change_now/change_now_test.dart index e9e013245..9c8efb1ac 100644 --- a/test/services/change_now/change_now_test.dart +++ b/test/services/change_now/change_now_test.dart @@ -589,6 +589,7 @@ void main() { refundAddress: "", apiKey: "testAPIKEY", rateId: '', + reversed: false, ); expect(result.exception, null); @@ -621,6 +622,7 @@ void main() { refundAddress: "", apiKey: "testAPIKEY", rateId: '', + reversed: false, ); expect( @@ -652,6 +654,7 @@ void main() { "888tNkZrPN6JsEgekjMnABU4TBzc2Dt29EPAvkRxbANsAnjyPbb3iQ1YBRk1UXcdRsiKc9dhwMVgN5S9cQUiyoogDavup3H", apiKey: "testAPIKEY", rateId: '', + reversed: false, ); expect(result.exception!.type, ExchangeExceptionType.generic);