From 0703c4116503440fe93b4db5b8347f1df800fff7 Mon Sep 17 00:00:00 2001 From: Frank Dillon Date: Wed, 16 Aug 2006 13:52:19 +0000 Subject: [PATCH] added tests for newByHashref constructor --- t/Asset/Asset.t | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/t/Asset/Asset.t b/t/Asset/Asset.t index 973f78bd7..b2f7ae329 100644 --- a/t/Asset/Asset.t +++ b/t/Asset/Asset.t @@ -17,7 +17,7 @@ use WebGUI::Session; use WebGUI::Asset; use WebGUI::Asset::Wobject::Navigation; -use Test::More tests => 13; # increment this value for each test you create +use Test::More tests => 15; # increment this value for each test you create my $session = WebGUI::Test->session; @@ -33,6 +33,15 @@ my $asset = WebGUI::Asset->new($session, $assetId, 'WebGUI::Asset::Wobject::Navi is (ref $asset, 'WebGUI::Asset::Wobject::Navigation','new constructor explicit - ref check'); is ($asset->getId, $assetId, 'new constructor explicit - returns correct asset'); +# - new by hashref properties +$asset = undef; +$asset = WebGUI::Asset->newByPropertyHashRef($session, { + className=>"WebGUI::Asset::Wobject::Navigation", + assetId=>$assetId + }); +is (ref $asset, 'WebGUI::Asset::Wobject::Navigation', 'new constructor newByHashref - ref check'); +is ($asset->getId, $assetId, 'new constructor newByHashref - returns correct asset'); + # - implicit class $asset = undef; $asset = WebGUI::Asset::Wobject::Navigation->new($session, $assetId); @@ -74,6 +83,3 @@ my $rootAsset = WebGUI::Asset->getRoot($session); isa_ok($rootAsset, 'WebGUI::Asset'); is($rootAsset->getId, 'PBasset000000000000001', 'Root Asset ID check'); -# TODO -# Test the newByPropertiesHashRef Constructor -#