update mock calls

This commit is contained in:
julian 2023-02-23 14:08:07 -06:00
parent a57cd88696
commit fd0400e7f7
4 changed files with 49 additions and 0 deletions

View file

@ -3,6 +3,7 @@ import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:mockito/annotations.dart';
import 'package:mockito/mockito.dart';
import 'package:stackwallet/models/balance.dart';
import 'package:stackwallet/pages_desktop_specific/my_stack_view/coin_wallets_table.dart';
import 'package:stackwallet/providers/providers.dart';
import 'package:stackwallet/services/coins/bitcoin/bitcoin_wallet.dart';
@ -34,6 +35,15 @@ void main() {
when(wallet.walletName).thenAnswer((_) => "some wallet");
when(wallet.walletId).thenAnswer((_) => "Wallet id 1");
when(wallet.balance).thenAnswer(
(_) => Balance(
coin: Coin.bitcoin,
total: 0,
spendable: 0,
blockedTotal: 0,
pendingSpendable: 0,
),
);
final manager = Manager(wallet);

View file

@ -4,6 +4,7 @@ import 'package:flutter_test/flutter_test.dart';
import 'package:mockingjay/mockingjay.dart' as mockingjay;
import 'package:mockito/annotations.dart';
import 'package:mockito/mockito.dart' as mockito;
import 'package:stackwallet/models/balance.dart';
import 'package:stackwallet/providers/providers.dart';
import 'package:stackwallet/services/coins/bitcoin/bitcoin_wallet.dart';
import 'package:stackwallet/services/coins/coin_service.dart';
@ -29,6 +30,15 @@ void main() {
mockito
.when(wallet.walletName)
.thenAnswer((realInvocation) => "wallet name");
mockito.when(wallet.balance).thenAnswer(
(_) => Balance(
coin: Coin.bitcoin,
total: 0,
spendable: 0,
blockedTotal: 0,
pendingSpendable: 0,
),
);
final wallets = MockWallets();
final locale = MockLocaleService();
@ -89,6 +99,15 @@ void main() {
mockito
.when(wallet.walletName)
.thenAnswer((realInvocation) => "wallet name");
mockito.when(wallet.balance).thenAnswer(
(_) => Balance(
coin: Coin.bitcoin,
total: 0,
spendable: 0,
blockedTotal: 0,
pendingSpendable: 0,
),
);
final wallets = MockWallets();
final manager = Manager(wallet);

View file

@ -3,6 +3,7 @@ import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:mockito/annotations.dart';
import 'package:mockito/mockito.dart';
import 'package:stackwallet/models/balance.dart';
import 'package:stackwallet/providers/providers.dart';
import 'package:stackwallet/services/coins/bitcoin/bitcoin_wallet.dart';
import 'package:stackwallet/services/coins/coin_service.dart';
@ -35,6 +36,15 @@ void main() {
when(wallet.coin).thenAnswer((_) => Coin.bitcoin);
when(wallet.walletName).thenAnswer((_) => "some wallet");
when(wallet.walletId).thenAnswer((_) => "some-wallet-id");
when(wallet.balance).thenAnswer(
(_) => Balance(
coin: Coin.bitcoin,
total: 0,
spendable: 0,
blockedTotal: 0,
pendingSpendable: 0,
),
);
final manager = Manager(wallet);
when(wallets.getManagerProvider("some-wallet-id")).thenAnswer(

View file

@ -3,6 +3,7 @@ import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:mockito/annotations.dart';
import 'package:mockito/mockito.dart';
import 'package:stackwallet/models/balance.dart';
import 'package:stackwallet/providers/providers.dart';
import 'package:stackwallet/services/coins/bitcoin/bitcoin_wallet.dart';
import 'package:stackwallet/services/coins/coin_service.dart';
@ -35,6 +36,15 @@ void main() {
when(wallet.coin).thenAnswer((_) => Coin.bitcoin);
when(wallet.walletName).thenAnswer((_) => "some wallet");
when(wallet.walletId).thenAnswer((_) => "some-wallet-id");
when(wallet.balance).thenAnswer(
(_) => Balance(
coin: Coin.bitcoin,
total: 0,
spendable: 0,
blockedTotal: 0,
pendingSpendable: 0,
),
);
final manager = Manager(wallet);
when(wallets.getManagerProvider("some-wallet-id")).thenAnswer(