mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2024-12-23 03:49:22 +00:00
update mocks
This commit is contained in:
parent
a8396977ef
commit
3d5f6a8d12
3 changed files with 7 additions and 249 deletions
|
@ -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<T> extends _i1.Fake
|
||||
implements _i2.ExchangeResponse<T> {}
|
||||
|
||||
/// 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<List<_i6.Currency>>> getAvailableCurrencies(
|
||||
{bool? fixedRate, bool? active}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(#getAvailableCurrencies, [],
|
||||
{#fixedRate: fixedRate, #active: active}),
|
||||
returnValue: Future<_i2.ExchangeResponse<List<_i6.Currency>>>.value(
|
||||
_FakeExchangeResponse_0<List<_i6.Currency>>())) as _i5
|
||||
.Future<_i2.ExchangeResponse<List<_i6.Currency>>>);
|
||||
@override
|
||||
_i5.Future<_i2.ExchangeResponse<List<_i6.Currency>>> getPairedCurrencies(
|
||||
{String? ticker, bool? fixedRate}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(#getPairedCurrencies, [],
|
||||
{#ticker: ticker, #fixedRate: fixedRate}),
|
||||
returnValue: Future<_i2.ExchangeResponse<List<_i6.Currency>>>.value(
|
||||
_FakeExchangeResponse_0<List<_i6.Currency>>())) as _i5
|
||||
.Future<_i2.ExchangeResponse<List<_i6.Currency>>>);
|
||||
@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<List<_i11.FixedRateMarket>>>
|
||||
getAvailableFixedRateMarkets({String? apiKey}) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#getAvailableFixedRateMarkets, [], {#apiKey: apiKey}),
|
||||
returnValue:
|
||||
Future<_i2.ExchangeResponse<List<_i11.FixedRateMarket>>>.value(
|
||||
_FakeExchangeResponse_0<List<_i11.FixedRateMarket>>())) as _i5
|
||||
.Future<_i2.ExchangeResponse<List<_i11.FixedRateMarket>>>);
|
||||
@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<List<_i14.Pair>>>
|
||||
getAvailableFloatingRatePairs({bool? includePartners = false}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(#getAvailableFloatingRatePairs, [],
|
||||
{#includePartners: includePartners}),
|
||||
returnValue: Future<_i2.ExchangeResponse<List<_i14.Pair>>>.value(
|
||||
_FakeExchangeResponse_0<List<_i14.Pair>>())) as _i5
|
||||
.Future<_i2.ExchangeResponse<List<_i14.Pair>>>);
|
||||
}
|
|
@ -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,
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue