From 63701071db557a350ef1ab0b1c682ff6f9f49c38 Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Wed, 8 Oct 2008 23:26:32 +0000 Subject: [PATCH] add another FlatRate calculate test --- t/Shop/ShipDriver/FlatRate.t | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/t/Shop/ShipDriver/FlatRate.t b/t/Shop/ShipDriver/FlatRate.t index 22eb69bc9..8d6c57946 100644 --- a/t/Shop/ShipDriver/FlatRate.t +++ b/t/Shop/ShipDriver/FlatRate.t @@ -31,7 +31,7 @@ my $session = WebGUI::Test->session; #---------------------------------------------------------------------------- # Tests -my $tests = 12; +my $tests = 13; plan tests => 1 + $tests; #---------------------------------------------------------------------------- @@ -291,15 +291,18 @@ $options = { flatFee => 1.00, percentageOfPrice => 0, pricePerWeight => 100, - pricePerItem => 0, + pricePerItem => 10, }; $driver = WebGUI::Shop::ShipDriver::FlatRate->create($session, $options); my $cart = WebGUI::Shop::Cart->newBySession($session); -$car->addToCart($car->getCollateral('variantsJSON', 'variantId', $crappyCar)); -is($driver->calculate($cart), 1501, 'calculate by weight and flat fee work'); +$car->addToCart($car->getCollateral('variantsJSON', 'variantId', $crappyCar)); +is($driver->calculate($cart), 1511, 'calculate by weight, perItem and flat fee work'); + +$car->addToCart($car->getCollateral('variantsJSON', 'variantId', $reallyNiceCar)); +is($driver->calculate($cart), 4521, 'calculate by weight, perItem and flat fee work for two items'); }