Branch Coverage

lib/Catan/Game/Trade.pm
Criterion Covered Total %
branch 19 26 73.0


line true false branch
12 0 144 unless $bank and $bank->isa('Catan::Game::Bank') and $details and ref $details eq 'HASH' and keys %$details and $players and ref $players eq 'ARRAY' and scalar @$players
24 0 168 unless scalar @players == 1
35 121 23 if (@players == 1) { }
46 98 97 if ($r->amount < 0) { }
97 0 elsif ($r->amount > 0) { }
56 0 121 unless $resource_production or $allowed == $requested
62 1 22 unless @players == 2
68 39 46 $_->isa(ref $r) ? :
69 1 38 unless $r->amount + $total2 == 0
75 140 0 if $self->can_afford
102 0 472 unless $player_number and exists $self->{$player_number}
110 136 0 if ($self->can_afford)
135 2 902 unless $player->resources->{$_->code} + $_->quantity >= 0