Tests for an operation addRequestConfigurations

These tests currently fail; will write code next.
This commit is contained in:
Bradley M. Kuhn 2015-12-13 13:28:38 -08:00
parent f0f6c6978c
commit 63af394ca6

View file

@ -172,6 +172,24 @@ is_deeply({ $tShirt0RequestTypeId => {} },
$sp->addRequestConfigurations('t-shirt-0'), $sp->addRequestConfigurations('t-shirt-0'),
"addRequestConfigurations: existing requestType with no configuration yields same"); "addRequestConfigurations: existing requestType with no configuration yields same");
my @sizeList = qw/LadiesS LadiesM LadiesL LadiesXL MenS MenM MenL MenXL Men2XL/;
my $tShirt0Data;
lives_ok { $tShirt0Data = $sp->addRequestConfigurations('t-shirt-0') }
"addRequestConfigurations: existing requestType with configuration runs.";
is( keys %{$tShirt0Data}, ($tShirt0RequestTypeId),
"addRequestConfigurations: reuses same requestTypeId on add of configurations");
my $cnt;
foreach my $size (@sizeList) {
ok( (defined $tShirt0Data->{$tShirt0RequestTypeId}{$size} and
looks_like_number($tShirt0Data->{$tShirt0RequestTypeId}{$size}) and
$tShirt0Data->{$tShirt0RequestTypeId}{$size} > 0),
sprintf "addRequestConfigurations: item %d added correctly", $cnt++);
}
=back =back
=item getRequestConfigurations =item getRequestConfigurations