update tests and generated files

This commit is contained in:
julian 2022-10-02 18:55:35 -06:00
parent 649ebd1987
commit f2eaba178c
4 changed files with 291 additions and 112 deletions

View file

@ -0,0 +1,104 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'trade.dart';
// **************************************************************************
// TypeAdapterGenerator
// **************************************************************************
class TradeAdapter extends TypeAdapter<Trade> {
@override
final int typeId = 22;
@override
Trade read(BinaryReader reader) {
final numOfFields = reader.readByte();
final fields = <int, dynamic>{
for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
};
return Trade(
uuid: fields[0] as String,
tradeId: fields[1] as String,
rateType: fields[2] as String,
direction: fields[3] as String,
timestamp: fields[4] as DateTime,
updatedAt: fields[5] as DateTime,
payInCurrency: fields[6] as String,
payInAmount: fields[7] as String,
payInAddress: fields[8] as String,
payInNetwork: fields[9] as String,
payInExtraId: fields[10] as String,
payInTxid: fields[11] as String,
payOutCurrency: fields[12] as String,
payOutAmount: fields[13] as String,
payOutAddress: fields[14] as String,
payOutNetwork: fields[15] as String,
payOutExtraId: fields[16] as String,
payOutTxid: fields[17] as String,
refundAddress: fields[18] as String,
refundExtraId: fields[19] as String,
status: fields[20] as String,
exchangeName: fields[21] as String,
);
}
@override
void write(BinaryWriter writer, Trade obj) {
writer
..writeByte(22)
..writeByte(0)
..write(obj.uuid)
..writeByte(1)
..write(obj.tradeId)
..writeByte(2)
..write(obj.rateType)
..writeByte(3)
..write(obj.direction)
..writeByte(4)
..write(obj.timestamp)
..writeByte(5)
..write(obj.updatedAt)
..writeByte(6)
..write(obj.payInCurrency)
..writeByte(7)
..write(obj.payInAmount)
..writeByte(8)
..write(obj.payInAddress)
..writeByte(9)
..write(obj.payInNetwork)
..writeByte(10)
..write(obj.payInExtraId)
..writeByte(11)
..write(obj.payInTxid)
..writeByte(12)
..write(obj.payOutCurrency)
..writeByte(13)
..write(obj.payOutAmount)
..writeByte(14)
..write(obj.payOutAddress)
..writeByte(15)
..write(obj.payOutNetwork)
..writeByte(16)
..write(obj.payOutExtraId)
..writeByte(17)
..write(obj.payOutTxid)
..writeByte(18)
..write(obj.refundAddress)
..writeByte(19)
..write(obj.refundExtraId)
..writeByte(20)
..write(obj.status)
..writeByte(21)
..write(obj.exchangeName);
}
@override
int get hashCode => typeId.hashCode;
@override
bool operator ==(Object other) =>
identical(this, other) ||
other is TradeAdapter &&
runtimeType == other.runtimeType &&
typeId == other.typeId;
}

View file

@ -92,7 +92,7 @@ void main() {
test( test(
"updateTo after updateFrom where amounts are null and getMinimalExchangeAmount succeeds", "updateTo after updateFrom where amounts are null and getMinimalExchangeAmount succeeds",
() async { () async {
final cn = MockChangeNow(); final cn = MockChangeNowAPI();
final state = EstimatedRateExchangeFormState(); final state = EstimatedRateExchangeFormState();
state.cnTesting = cn; state.cnTesting = cn;
@ -119,7 +119,7 @@ void main() {
test( test(
"updateTo after updateFrom where amounts are null and getMinimalExchangeAmount fails", "updateTo after updateFrom where amounts are null and getMinimalExchangeAmount fails",
() async { () async {
final cn = MockChangeNow(); final cn = MockChangeNowAPI();
final state = EstimatedRateExchangeFormState(); final state = EstimatedRateExchangeFormState();
state.cnTesting = cn; state.cnTesting = cn;
@ -146,7 +146,7 @@ void main() {
test( test(
"updateTo after updateFrom and setFromAmountAndCalculateToAmount where fromAmount is less than the minimum required exchange amount", "updateTo after updateFrom and setFromAmountAndCalculateToAmount where fromAmount is less than the minimum required exchange amount",
() async { () async {
final cn = MockChangeNow(); final cn = MockChangeNowAPI();
final state = EstimatedRateExchangeFormState(); final state = EstimatedRateExchangeFormState();
state.cnTesting = cn; state.cnTesting = cn;
@ -174,7 +174,7 @@ void main() {
test( test(
"updateTo after updateFrom and setFromAmountAndCalculateToAmount where fromAmount is greater than the minimum required exchange amount", "updateTo after updateFrom and setFromAmountAndCalculateToAmount where fromAmount is greater than the minimum required exchange amount",
() async { () async {
final cn = MockChangeNow(); final cn = MockChangeNowAPI();
final state = EstimatedRateExchangeFormState(); final state = EstimatedRateExchangeFormState();
state.cnTesting = cn; state.cnTesting = cn;

View file

@ -8,19 +8,20 @@ import 'package:decimal/decimal.dart' as _i7;
import 'package:http/http.dart' as _i4; import 'package:http/http.dart' as _i4;
import 'package:mockito/mockito.dart' as _i1; import 'package:mockito/mockito.dart' as _i1;
import 'package:stackwallet/models/exchange/change_now/available_floating_rate_pair.dart' import 'package:stackwallet/models/exchange/change_now/available_floating_rate_pair.dart'
as _i13; as _i14;
import 'package:stackwallet/models/exchange/change_now/cn_exchange_estimate.dart' import 'package:stackwallet/models/exchange/change_now/cn_exchange_estimate.dart'
as _i9;
import 'package:stackwallet/models/exchange/change_now/estimated_exchange_amount.dart'
as _i8;
import 'package:stackwallet/models/exchange/change_now/exchange_transaction.dart'
as _i11;
import 'package:stackwallet/models/exchange/change_now/exchange_transaction_status.dart'
as _i12;
import 'package:stackwallet/models/exchange/change_now/fixed_rate_market.dart'
as _i10; as _i10;
import 'package:stackwallet/models/exchange/change_now/estimated_exchange_amount.dart'
as _i9;
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/change_now/fixed_rate_market.dart'
as _i11;
import 'package:stackwallet/models/exchange/response_objects/currency.dart' import 'package:stackwallet/models/exchange/response_objects/currency.dart'
as _i6; as _i6;
import 'package:stackwallet/models/exchange/response_objects/range.dart' as _i8;
import 'package:stackwallet/services/exchange/change_now/change_now_api.dart' import 'package:stackwallet/services/exchange/change_now/change_now_api.dart'
as _i3; as _i3;
import 'package:stackwallet/services/exchange/exchange_response.dart' as _i2; import 'package:stackwallet/services/exchange/exchange_response.dart' as _i2;
@ -35,14 +36,14 @@ import 'package:stackwallet/services/exchange/exchange_response.dart' as _i2;
// ignore_for_file: unnecessary_parenthesis // ignore_for_file: unnecessary_parenthesis
// ignore_for_file: camel_case_types // ignore_for_file: camel_case_types
class _FakeChangeNowResponse_0<T> extends _i1.Fake class _FakeExchangeResponse_0<T> extends _i1.Fake
implements _i2.ExchangeResponse<T> {} implements _i2.ExchangeResponse<T> {}
/// A class which mocks [ChangeNow]. /// A class which mocks [ChangeNowAPI].
/// ///
/// See the documentation for Mockito's code generation for more information. /// See the documentation for Mockito's code generation for more information.
class MockChangeNow extends _i1.Mock implements _i3.ChangeNowAPI { class MockChangeNowAPI extends _i1.Mock implements _i3.ChangeNowAPI {
MockChangeNow() { MockChangeNowAPI() {
_i1.throwOnMissingStub(this); _i1.throwOnMissingStub(this);
} }
@ -57,7 +58,7 @@ class MockChangeNow extends _i1.Mock implements _i3.ChangeNowAPI {
Invocation.method(#getAvailableCurrencies, [], Invocation.method(#getAvailableCurrencies, [],
{#fixedRate: fixedRate, #active: active}), {#fixedRate: fixedRate, #active: active}),
returnValue: Future<_i2.ExchangeResponse<List<_i6.Currency>>>.value( returnValue: Future<_i2.ExchangeResponse<List<_i6.Currency>>>.value(
_FakeChangeNowResponse_0<List<_i6.Currency>>())) as _i5 _FakeExchangeResponse_0<List<_i6.Currency>>())) as _i5
.Future<_i2.ExchangeResponse<List<_i6.Currency>>>); .Future<_i2.ExchangeResponse<List<_i6.Currency>>>);
@override @override
_i5.Future<_i2.ExchangeResponse<List<_i6.Currency>>> getPairedCurrencies( _i5.Future<_i2.ExchangeResponse<List<_i6.Currency>>> getPairedCurrencies(
@ -66,7 +67,7 @@ class MockChangeNow extends _i1.Mock implements _i3.ChangeNowAPI {
Invocation.method(#getPairedCurrencies, [], Invocation.method(#getPairedCurrencies, [],
{#ticker: ticker, #fixedRate: fixedRate}), {#ticker: ticker, #fixedRate: fixedRate}),
returnValue: Future<_i2.ExchangeResponse<List<_i6.Currency>>>.value( returnValue: Future<_i2.ExchangeResponse<List<_i6.Currency>>>.value(
_FakeChangeNowResponse_0<List<_i6.Currency>>())) as _i5 _FakeExchangeResponse_0<List<_i6.Currency>>())) as _i5
.Future<_i2.ExchangeResponse<List<_i6.Currency>>>); .Future<_i2.ExchangeResponse<List<_i6.Currency>>>);
@override @override
_i5.Future<_i2.ExchangeResponse<_i7.Decimal>> getMinimalExchangeAmount( _i5.Future<_i2.ExchangeResponse<_i7.Decimal>> getMinimalExchangeAmount(
@ -78,10 +79,26 @@ class MockChangeNow extends _i1.Mock implements _i3.ChangeNowAPI {
#apiKey: apiKey #apiKey: apiKey
}), }),
returnValue: Future<_i2.ExchangeResponse<_i7.Decimal>>.value( returnValue: Future<_i2.ExchangeResponse<_i7.Decimal>>.value(
_FakeChangeNowResponse_0<_i7.Decimal>())) _FakeExchangeResponse_0<_i7.Decimal>()))
as _i5.Future<_i2.ExchangeResponse<_i7.Decimal>>); as _i5.Future<_i2.ExchangeResponse<_i7.Decimal>>);
@override @override
_i5.Future<_i2.ExchangeResponse<_i8.EstimatedExchangeAmount>> _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.EstimatedExchangeAmount>>
getEstimatedExchangeAmount( getEstimatedExchangeAmount(
{String? fromTicker, {String? fromTicker,
String? toTicker, String? toTicker,
@ -96,19 +113,40 @@ class MockChangeNow extends _i1.Mock implements _i3.ChangeNowAPI {
}), }),
returnValue: Future< returnValue: Future<
_i2.ExchangeResponse< _i2.ExchangeResponse<
_i8.EstimatedExchangeAmount>>.value( _i9.EstimatedExchangeAmount>>.value(
_FakeChangeNowResponse_0<_i8.EstimatedExchangeAmount>())) _FakeExchangeResponse_0<_i9.EstimatedExchangeAmount>()))
as _i5.Future<_i2.ExchangeResponse<_i8.EstimatedExchangeAmount>>); as _i5.Future<_i2.ExchangeResponse<_i9.EstimatedExchangeAmount>>);
@override @override
_i5.Future<_i2.ExchangeResponse<_i9.CNExchangeEstimate>> _i5.Future<_i2.ExchangeResponse<_i9.EstimatedExchangeAmount>>
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.EstimatedExchangeAmount>>.value(
_FakeExchangeResponse_0<_i9.EstimatedExchangeAmount>()))
as _i5.Future<_i2.ExchangeResponse<_i9.EstimatedExchangeAmount>>);
@override
_i5.Future<_i2.ExchangeResponse<_i10.CNExchangeEstimate>>
getEstimatedExchangeAmountV2( getEstimatedExchangeAmountV2(
{String? fromTicker, {String? fromTicker,
String? toTicker, String? toTicker,
_i9.CNEstimateType? fromOrTo, _i10.CNEstimateType? fromOrTo,
_i7.Decimal? amount, _i7.Decimal? amount,
String? fromNetwork, String? fromNetwork,
String? toNetwork, String? toNetwork,
_i9.CNFlowType? flow = _i9.CNFlowType.standard, _i10.CNFlowType? flow = _i10.CNFlowType.standard,
String? apiKey}) => String? apiKey}) =>
(super.noSuchMethod( (super.noSuchMethod(
Invocation.method(#getEstimatedExchangeAmountV2, [], { Invocation.method(#getEstimatedExchangeAmountV2, [], {
@ -122,20 +160,20 @@ class MockChangeNow extends _i1.Mock implements _i3.ChangeNowAPI {
#apiKey: apiKey #apiKey: apiKey
}), }),
returnValue: Future< returnValue: Future<
_i2.ExchangeResponse<_i9.CNExchangeEstimate>>.value( _i2.ExchangeResponse<_i10.CNExchangeEstimate>>.value(
_FakeChangeNowResponse_0<_i9.CNExchangeEstimate>())) _FakeExchangeResponse_0<_i10.CNExchangeEstimate>()))
as _i5.Future<_i2.ExchangeResponse<_i9.CNExchangeEstimate>>); as _i5.Future<_i2.ExchangeResponse<_i10.CNExchangeEstimate>>);
@override @override
_i5.Future<_i2.ExchangeResponse<List<_i10.FixedRateMarket>>> _i5.Future<_i2.ExchangeResponse<List<_i11.FixedRateMarket>>>
getAvailableFixedRateMarkets({String? apiKey}) => (super.noSuchMethod( getAvailableFixedRateMarkets({String? apiKey}) => (super.noSuchMethod(
Invocation.method( Invocation.method(
#getAvailableFixedRateMarkets, [], {#apiKey: apiKey}), #getAvailableFixedRateMarkets, [], {#apiKey: apiKey}),
returnValue: returnValue:
Future<_i2.ExchangeResponse<List<_i10.FixedRateMarket>>>.value( Future<_i2.ExchangeResponse<List<_i11.FixedRateMarket>>>.value(
_FakeChangeNowResponse_0<List<_i10.FixedRateMarket>>())) _FakeExchangeResponse_0<List<_i11.FixedRateMarket>>())) as _i5
as _i5.Future<_i2.ExchangeResponse<List<_i10.FixedRateMarket>>>); .Future<_i2.ExchangeResponse<List<_i11.FixedRateMarket>>>);
@override @override
_i5.Future<_i2.ExchangeResponse<_i11.ExchangeTransaction>> _i5.Future<_i2.ExchangeResponse<_i12.ExchangeTransaction>>
createStandardExchangeTransaction( createStandardExchangeTransaction(
{String? fromTicker, {String? fromTicker,
String? toTicker, String? toTicker,
@ -161,11 +199,11 @@ class MockChangeNow extends _i1.Mock implements _i3.ChangeNowAPI {
#apiKey: apiKey #apiKey: apiKey
}), }),
returnValue: Future< returnValue: Future<
_i2.ExchangeResponse<_i11.ExchangeTransaction>>.value( _i2.ExchangeResponse<_i12.ExchangeTransaction>>.value(
_FakeChangeNowResponse_0<_i11.ExchangeTransaction>())) _FakeExchangeResponse_0<_i12.ExchangeTransaction>()))
as _i5.Future<_i2.ExchangeResponse<_i11.ExchangeTransaction>>); as _i5.Future<_i2.ExchangeResponse<_i12.ExchangeTransaction>>);
@override @override
_i5.Future<_i2.ExchangeResponse<_i11.ExchangeTransaction>> _i5.Future<_i2.ExchangeResponse<_i12.ExchangeTransaction>>
createFixedRateExchangeTransaction( createFixedRateExchangeTransaction(
{String? fromTicker, {String? fromTicker,
String? toTicker, String? toTicker,
@ -193,26 +231,26 @@ class MockChangeNow extends _i1.Mock implements _i3.ChangeNowAPI {
#apiKey: apiKey #apiKey: apiKey
}), }),
returnValue: Future< returnValue: Future<
_i2.ExchangeResponse<_i11.ExchangeTransaction>>.value( _i2.ExchangeResponse<_i12.ExchangeTransaction>>.value(
_FakeChangeNowResponse_0<_i11.ExchangeTransaction>())) _FakeExchangeResponse_0<_i12.ExchangeTransaction>()))
as _i5.Future<_i2.ExchangeResponse<_i11.ExchangeTransaction>>); as _i5.Future<_i2.ExchangeResponse<_i12.ExchangeTransaction>>);
@override @override
_i5.Future<_i2.ExchangeResponse<_i12.ExchangeTransactionStatus>> _i5.Future<_i2.ExchangeResponse<_i13.ExchangeTransactionStatus>>
getTransactionStatus({String? id, String? apiKey}) => (super.noSuchMethod( getTransactionStatus({String? id, String? apiKey}) => (super.noSuchMethod(
Invocation.method( Invocation.method(
#getTransactionStatus, [], {#id: id, #apiKey: apiKey}), #getTransactionStatus, [], {#id: id, #apiKey: apiKey}),
returnValue: returnValue:
Future<_i2.ExchangeResponse<_i12.ExchangeTransactionStatus>>.value( Future<_i2.ExchangeResponse<_i13.ExchangeTransactionStatus>>.value(
_FakeChangeNowResponse_0<_i12.ExchangeTransactionStatus>())) as _i5 _FakeExchangeResponse_0<_i13.ExchangeTransactionStatus>())) as _i5
.Future<_i2.ExchangeResponse<_i12.ExchangeTransactionStatus>>); .Future<_i2.ExchangeResponse<_i13.ExchangeTransactionStatus>>);
@override @override
_i5.Future<_i2.ExchangeResponse<List<_i13.AvailableFloatingRatePair>>> _i5.Future<_i2.ExchangeResponse<List<_i14.AvailableFloatingRatePair>>>
getAvailableFloatingRatePairs({bool? includePartners = false}) => (super getAvailableFloatingRatePairs({bool? includePartners = false}) => (super
.noSuchMethod( .noSuchMethod(
Invocation.method(#getAvailableFloatingRatePairs, [], Invocation.method(#getAvailableFloatingRatePairs, [],
{#includePartners: includePartners}), {#includePartners: includePartners}),
returnValue: returnValue:
Future<_i2.ExchangeResponse<List<_i13.AvailableFloatingRatePair>>>.value( Future<_i2.ExchangeResponse<List<_i14.AvailableFloatingRatePair>>>.value(
_FakeChangeNowResponse_0<List<_i13.AvailableFloatingRatePair>>())) as _i5 _FakeExchangeResponse_0<List<_i14.AvailableFloatingRatePair>>())) as _i5
.Future<_i2.ExchangeResponse<List<_i13.AvailableFloatingRatePair>>>); .Future<_i2.ExchangeResponse<List<_i14.AvailableFloatingRatePair>>>);
} }

View file

@ -9,19 +9,23 @@ import 'package:decimal/decimal.dart' as _i15;
import 'package:http/http.dart' as _i13; import 'package:http/http.dart' as _i13;
import 'package:mockito/mockito.dart' as _i1; import 'package:mockito/mockito.dart' as _i1;
import 'package:stackwallet/models/exchange/change_now/available_floating_rate_pair.dart' import 'package:stackwallet/models/exchange/change_now/available_floating_rate_pair.dart'
as _i20; as _i22;
import 'package:stackwallet/models/exchange/change_now/cn_exchange_estimate.dart' import 'package:stackwallet/models/exchange/change_now/cn_exchange_estimate.dart'
as _i17;
import 'package:stackwallet/models/exchange/change_now/estimated_exchange_amount.dart'
as _i16;
import 'package:stackwallet/models/exchange/change_now/exchange_transaction.dart'
as _i10;
import 'package:stackwallet/models/exchange/change_now/exchange_transaction_status.dart'
as _i19;
import 'package:stackwallet/models/exchange/change_now/fixed_rate_market.dart'
as _i18; as _i18;
import 'package:stackwallet/models/exchange/change_now/estimated_exchange_amount.dart'
as _i17;
import 'package:stackwallet/models/exchange/change_now/exchange_transaction.dart'
as _i20;
import 'package:stackwallet/models/exchange/change_now/exchange_transaction_status.dart'
as _i21;
import 'package:stackwallet/models/exchange/change_now/fixed_rate_market.dart'
as _i19;
import 'package:stackwallet/models/exchange/response_objects/currency.dart' import 'package:stackwallet/models/exchange/response_objects/currency.dart'
as _i14; as _i14;
import 'package:stackwallet/models/exchange/response_objects/range.dart'
as _i16;
import 'package:stackwallet/models/exchange/response_objects/trade.dart'
as _i10;
import 'package:stackwallet/pages/exchange_view/sub_widgets/exchange_rate_sheet.dart' import 'package:stackwallet/pages/exchange_view/sub_widgets/exchange_rate_sheet.dart'
as _i5; as _i5;
import 'package:stackwallet/services/exchange/change_now/change_now_api.dart' import 'package:stackwallet/services/exchange/change_now/change_now_api.dart'
@ -43,7 +47,7 @@ import 'package:stackwallet/utilities/prefs.dart' as _i3;
// ignore_for_file: unnecessary_parenthesis // ignore_for_file: unnecessary_parenthesis
// ignore_for_file: camel_case_types // ignore_for_file: camel_case_types
class _FakeChangeNowResponse_0<T> extends _i1.Fake class _FakeExchangeResponse_0<T> extends _i1.Fake
implements _i2.ExchangeResponse<T> {} implements _i2.ExchangeResponse<T> {}
/// A class which mocks [Prefs]. /// A class which mocks [Prefs].
@ -246,33 +250,28 @@ class MockTradesService extends _i1.Mock implements _i9.TradesService {
} }
@override @override
List<_i10.ExchangeTransaction> get trades => List<_i10.Trade> get trades => (super.noSuchMethod(Invocation.getter(#trades),
(super.noSuchMethod(Invocation.getter(#trades), returnValue: <_i10.Trade>[]) as List<_i10.Trade>);
returnValue: <_i10.ExchangeTransaction>[])
as List<_i10.ExchangeTransaction>);
@override @override
bool get hasListeners => bool get hasListeners =>
(super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false)
as bool); as bool);
@override @override
_i7.Future<void> add( _i7.Future<void> add({_i10.Trade? trade, bool? shouldNotifyListeners}) =>
{_i10.ExchangeTransaction? trade, bool? shouldNotifyListeners}) =>
(super.noSuchMethod( (super.noSuchMethod(
Invocation.method(#add, [], Invocation.method(#add, [],
{#trade: trade, #shouldNotifyListeners: shouldNotifyListeners}), {#trade: trade, #shouldNotifyListeners: shouldNotifyListeners}),
returnValue: Future<void>.value(), returnValue: Future<void>.value(),
returnValueForMissingStub: Future<void>.value()) as _i7.Future<void>); returnValueForMissingStub: Future<void>.value()) as _i7.Future<void>);
@override @override
_i7.Future<void> edit( _i7.Future<void> edit({_i10.Trade? trade, bool? shouldNotifyListeners}) =>
{_i10.ExchangeTransaction? trade, bool? shouldNotifyListeners}) =>
(super.noSuchMethod( (super.noSuchMethod(
Invocation.method(#edit, [], Invocation.method(#edit, [],
{#trade: trade, #shouldNotifyListeners: shouldNotifyListeners}), {#trade: trade, #shouldNotifyListeners: shouldNotifyListeners}),
returnValue: Future<void>.value(), returnValue: Future<void>.value(),
returnValueForMissingStub: Future<void>.value()) as _i7.Future<void>); returnValueForMissingStub: Future<void>.value()) as _i7.Future<void>);
@override @override
_i7.Future<void> delete( _i7.Future<void> delete({_i10.Trade? trade, bool? shouldNotifyListeners}) =>
{_i10.ExchangeTransaction? trade, bool? shouldNotifyListeners}) =>
(super.noSuchMethod( (super.noSuchMethod(
Invocation.method(#delete, [], Invocation.method(#delete, [],
{#trade: trade, #shouldNotifyListeners: shouldNotifyListeners}), {#trade: trade, #shouldNotifyListeners: shouldNotifyListeners}),
@ -348,11 +347,11 @@ class MockTradeNotesService extends _i1.Mock implements _i11.TradeNotesService {
returnValueForMissingStub: null); returnValueForMissingStub: null);
} }
/// A class which mocks [ChangeNow]. /// A class which mocks [ChangeNowAPI].
/// ///
/// See the documentation for Mockito's code generation for more information. /// See the documentation for Mockito's code generation for more information.
class MockChangeNow extends _i1.Mock implements _i12.ChangeNowAPI { class MockChangeNowAPI extends _i1.Mock implements _i12.ChangeNowAPI {
MockChangeNow() { MockChangeNowAPI() {
_i1.throwOnMissingStub(this); _i1.throwOnMissingStub(this);
} }
@ -367,7 +366,7 @@ class MockChangeNow extends _i1.Mock implements _i12.ChangeNowAPI {
Invocation.method(#getAvailableCurrencies, [], Invocation.method(#getAvailableCurrencies, [],
{#fixedRate: fixedRate, #active: active}), {#fixedRate: fixedRate, #active: active}),
returnValue: Future<_i2.ExchangeResponse<List<_i14.Currency>>>.value( returnValue: Future<_i2.ExchangeResponse<List<_i14.Currency>>>.value(
_FakeChangeNowResponse_0<List<_i14.Currency>>())) as _i7 _FakeExchangeResponse_0<List<_i14.Currency>>())) as _i7
.Future<_i2.ExchangeResponse<List<_i14.Currency>>>); .Future<_i2.ExchangeResponse<List<_i14.Currency>>>);
@override @override
_i7.Future<_i2.ExchangeResponse<List<_i14.Currency>>> getPairedCurrencies( _i7.Future<_i2.ExchangeResponse<List<_i14.Currency>>> getPairedCurrencies(
@ -376,7 +375,7 @@ class MockChangeNow extends _i1.Mock implements _i12.ChangeNowAPI {
Invocation.method(#getPairedCurrencies, [], Invocation.method(#getPairedCurrencies, [],
{#ticker: ticker, #fixedRate: fixedRate}), {#ticker: ticker, #fixedRate: fixedRate}),
returnValue: Future<_i2.ExchangeResponse<List<_i14.Currency>>>.value( returnValue: Future<_i2.ExchangeResponse<List<_i14.Currency>>>.value(
_FakeChangeNowResponse_0<List<_i14.Currency>>())) as _i7 _FakeExchangeResponse_0<List<_i14.Currency>>())) as _i7
.Future<_i2.ExchangeResponse<List<_i14.Currency>>>); .Future<_i2.ExchangeResponse<List<_i14.Currency>>>);
@override @override
_i7.Future<_i2.ExchangeResponse<_i15.Decimal>> getMinimalExchangeAmount( _i7.Future<_i2.ExchangeResponse<_i15.Decimal>> getMinimalExchangeAmount(
@ -388,10 +387,26 @@ class MockChangeNow extends _i1.Mock implements _i12.ChangeNowAPI {
#apiKey: apiKey #apiKey: apiKey
}), }),
returnValue: Future<_i2.ExchangeResponse<_i15.Decimal>>.value( returnValue: Future<_i2.ExchangeResponse<_i15.Decimal>>.value(
_FakeChangeNowResponse_0<_i15.Decimal>())) _FakeExchangeResponse_0<_i15.Decimal>()))
as _i7.Future<_i2.ExchangeResponse<_i15.Decimal>>); as _i7.Future<_i2.ExchangeResponse<_i15.Decimal>>);
@override @override
_i7.Future<_i2.ExchangeResponse<_i16.EstimatedExchangeAmount>> _i7.Future<_i2.ExchangeResponse<_i16.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<_i16.Range>>.value(
_FakeExchangeResponse_0<_i16.Range>()))
as _i7.Future<_i2.ExchangeResponse<_i16.Range>>);
@override
_i7.Future<_i2.ExchangeResponse<_i17.EstimatedExchangeAmount>>
getEstimatedExchangeAmount( getEstimatedExchangeAmount(
{String? fromTicker, {String? fromTicker,
String? toTicker, String? toTicker,
@ -406,20 +421,42 @@ class MockChangeNow extends _i1.Mock implements _i12.ChangeNowAPI {
}), }),
returnValue: Future< returnValue: Future<
_i2.ExchangeResponse< _i2.ExchangeResponse<
_i16.EstimatedExchangeAmount>>.value( _i17.EstimatedExchangeAmount>>.value(
_FakeChangeNowResponse_0<_i16.EstimatedExchangeAmount>())) _FakeExchangeResponse_0<_i17.EstimatedExchangeAmount>()))
as _i7 as _i7
.Future<_i2.ExchangeResponse<_i16.EstimatedExchangeAmount>>); .Future<_i2.ExchangeResponse<_i17.EstimatedExchangeAmount>>);
@override @override
_i7.Future<_i2.ExchangeResponse<_i17.CNExchangeEstimate>> _i7.Future<_i2.ExchangeResponse<_i17.EstimatedExchangeAmount>>
getEstimatedExchangeAmountFixedRate(
{String? fromTicker,
String? toTicker,
_i15.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<
_i17.EstimatedExchangeAmount>>.value(
_FakeExchangeResponse_0<_i17.EstimatedExchangeAmount>()))
as _i7
.Future<_i2.ExchangeResponse<_i17.EstimatedExchangeAmount>>);
@override
_i7.Future<_i2.ExchangeResponse<_i18.CNExchangeEstimate>>
getEstimatedExchangeAmountV2( getEstimatedExchangeAmountV2(
{String? fromTicker, {String? fromTicker,
String? toTicker, String? toTicker,
_i17.CNEstimateType? fromOrTo, _i18.CNEstimateType? fromOrTo,
_i15.Decimal? amount, _i15.Decimal? amount,
String? fromNetwork, String? fromNetwork,
String? toNetwork, String? toNetwork,
_i17.CNFlowType? flow = _i17.CNFlowType.standard, _i18.CNFlowType? flow = _i18.CNFlowType.standard,
String? apiKey}) => String? apiKey}) =>
(super.noSuchMethod( (super.noSuchMethod(
Invocation.method(#getEstimatedExchangeAmountV2, [], { Invocation.method(#getEstimatedExchangeAmountV2, [], {
@ -433,20 +470,20 @@ class MockChangeNow extends _i1.Mock implements _i12.ChangeNowAPI {
#apiKey: apiKey #apiKey: apiKey
}), }),
returnValue: Future< returnValue: Future<
_i2.ExchangeResponse<_i17.CNExchangeEstimate>>.value( _i2.ExchangeResponse<_i18.CNExchangeEstimate>>.value(
_FakeChangeNowResponse_0<_i17.CNExchangeEstimate>())) _FakeExchangeResponse_0<_i18.CNExchangeEstimate>()))
as _i7.Future<_i2.ExchangeResponse<_i17.CNExchangeEstimate>>); as _i7.Future<_i2.ExchangeResponse<_i18.CNExchangeEstimate>>);
@override @override
_i7.Future<_i2.ExchangeResponse<List<_i18.FixedRateMarket>>> _i7.Future<_i2.ExchangeResponse<List<_i19.FixedRateMarket>>>
getAvailableFixedRateMarkets({String? apiKey}) => (super.noSuchMethod( getAvailableFixedRateMarkets({String? apiKey}) => (super.noSuchMethod(
Invocation.method( Invocation.method(
#getAvailableFixedRateMarkets, [], {#apiKey: apiKey}), #getAvailableFixedRateMarkets, [], {#apiKey: apiKey}),
returnValue: returnValue:
Future<_i2.ExchangeResponse<List<_i18.FixedRateMarket>>>.value( Future<_i2.ExchangeResponse<List<_i19.FixedRateMarket>>>.value(
_FakeChangeNowResponse_0<List<_i18.FixedRateMarket>>())) _FakeExchangeResponse_0<List<_i19.FixedRateMarket>>())) as _i7
as _i7.Future<_i2.ExchangeResponse<List<_i18.FixedRateMarket>>>); .Future<_i2.ExchangeResponse<List<_i19.FixedRateMarket>>>);
@override @override
_i7.Future<_i2.ExchangeResponse<_i10.ExchangeTransaction>> _i7.Future<_i2.ExchangeResponse<_i20.ExchangeTransaction>>
createStandardExchangeTransaction( createStandardExchangeTransaction(
{String? fromTicker, {String? fromTicker,
String? toTicker, String? toTicker,
@ -472,11 +509,11 @@ class MockChangeNow extends _i1.Mock implements _i12.ChangeNowAPI {
#apiKey: apiKey #apiKey: apiKey
}), }),
returnValue: Future< returnValue: Future<
_i2.ExchangeResponse<_i10.ExchangeTransaction>>.value( _i2.ExchangeResponse<_i20.ExchangeTransaction>>.value(
_FakeChangeNowResponse_0<_i10.ExchangeTransaction>())) _FakeExchangeResponse_0<_i20.ExchangeTransaction>()))
as _i7.Future<_i2.ExchangeResponse<_i10.ExchangeTransaction>>); as _i7.Future<_i2.ExchangeResponse<_i20.ExchangeTransaction>>);
@override @override
_i7.Future<_i2.ExchangeResponse<_i10.ExchangeTransaction>> _i7.Future<_i2.ExchangeResponse<_i20.ExchangeTransaction>>
createFixedRateExchangeTransaction( createFixedRateExchangeTransaction(
{String? fromTicker, {String? fromTicker,
String? toTicker, String? toTicker,
@ -504,26 +541,26 @@ class MockChangeNow extends _i1.Mock implements _i12.ChangeNowAPI {
#apiKey: apiKey #apiKey: apiKey
}), }),
returnValue: Future< returnValue: Future<
_i2.ExchangeResponse<_i10.ExchangeTransaction>>.value( _i2.ExchangeResponse<_i20.ExchangeTransaction>>.value(
_FakeChangeNowResponse_0<_i10.ExchangeTransaction>())) _FakeExchangeResponse_0<_i20.ExchangeTransaction>()))
as _i7.Future<_i2.ExchangeResponse<_i10.ExchangeTransaction>>); as _i7.Future<_i2.ExchangeResponse<_i20.ExchangeTransaction>>);
@override @override
_i7.Future<_i2.ExchangeResponse<_i19.ExchangeTransactionStatus>> _i7.Future<_i2.ExchangeResponse<_i21.ExchangeTransactionStatus>>
getTransactionStatus({String? id, String? apiKey}) => (super.noSuchMethod( getTransactionStatus({String? id, String? apiKey}) => (super.noSuchMethod(
Invocation.method( Invocation.method(
#getTransactionStatus, [], {#id: id, #apiKey: apiKey}), #getTransactionStatus, [], {#id: id, #apiKey: apiKey}),
returnValue: returnValue:
Future<_i2.ExchangeResponse<_i19.ExchangeTransactionStatus>>.value( Future<_i2.ExchangeResponse<_i21.ExchangeTransactionStatus>>.value(
_FakeChangeNowResponse_0<_i19.ExchangeTransactionStatus>())) as _i7 _FakeExchangeResponse_0<_i21.ExchangeTransactionStatus>())) as _i7
.Future<_i2.ExchangeResponse<_i19.ExchangeTransactionStatus>>); .Future<_i2.ExchangeResponse<_i21.ExchangeTransactionStatus>>);
@override @override
_i7.Future<_i2.ExchangeResponse<List<_i20.AvailableFloatingRatePair>>> _i7.Future<_i2.ExchangeResponse<List<_i22.AvailableFloatingRatePair>>>
getAvailableFloatingRatePairs({bool? includePartners = false}) => (super getAvailableFloatingRatePairs({bool? includePartners = false}) => (super
.noSuchMethod( .noSuchMethod(
Invocation.method(#getAvailableFloatingRatePairs, [], Invocation.method(#getAvailableFloatingRatePairs, [],
{#includePartners: includePartners}), {#includePartners: includePartners}),
returnValue: returnValue:
Future<_i2.ExchangeResponse<List<_i20.AvailableFloatingRatePair>>>.value( Future<_i2.ExchangeResponse<List<_i22.AvailableFloatingRatePair>>>.value(
_FakeChangeNowResponse_0<List<_i20.AvailableFloatingRatePair>>())) as _i7 _FakeExchangeResponse_0<List<_i22.AvailableFloatingRatePair>>())) as _i7
.Future<_i2.ExchangeResponse<List<_i20.AvailableFloatingRatePair>>>); .Future<_i2.ExchangeResponse<List<_i22.AvailableFloatingRatePair>>>);
} }