use strict; use vars qw($CARD_NUMBER_PC $PASSWORD_PC); do '../config.pl'; use Test::More qw/no_plan/; unless ( $CARD_NUMBER_PC && $PASSWORD_PC ) { print "skipping test\n"; exit; } use_ok('Finance::Bank::PC'); ok(my $bank = Finance::Bank::PC->new({ card_number=> $CARD_NUMBER_PC, password => $PASSWORD_PC}), 'create object'); # functional test: end-to-end ok(my $accounts = $bank->accounts(), 'accounts()'); ok(scalar @$accounts > 0, 'we have accounts'); ok(my $account = $accounts->[0], 'get first account'); ok(defined $account->{name}, 'account name is defined'); is($account->{name}, 'no fee bank account', 'verify account name'); ok(defined $account->{number}, 'verify account number'); ok(defined $account->{account_id}, 'verify account id'); ok(my $details = $bank->details($account->{name}), "details($account->{name})"); ok(scalar @$details > 0, 'we have account details');