From 771b4aeb1eef7dd7231f58498d285dd75cf556b8 Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Wed, 13 Aug 2008 23:47:26 +0000 Subject: [PATCH] get and update tests --- t/Shop/Vendor.t | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/t/Shop/Vendor.t b/t/Shop/Vendor.t index 0c2daf041..1f405b497 100644 --- a/t/Shop/Vendor.t +++ b/t/Shop/Vendor.t @@ -31,7 +31,7 @@ my $session = WebGUI::Test->session; #---------------------------------------------------------------------------- # Tests -my $tests = 17; +my $tests = 23; plan tests => 1 + $tests; #---------------------------------------------------------------------------- @@ -134,6 +134,26 @@ my $dateCreated = WebGUI::DateTime->new($session, $fence->get('dateCreated')); my $deltaDC = $dateCreated - $now; cmp_ok( $deltaDC->seconds, '<=', 2, 'dateCreated is set properly'); +####################################################################### +# +# get, update +# +####################################################################### + +ok($session->id->valid($fence->get('vendorId')), 'get: vendorId is a valid guid'); +is($fence->getId, $fence->get('vendorId'), 'get: getId is an alias for get vendorId'); +is($fence->get('userId'), $fenceUser->userId, 'get: userId'); +is($fence->get('name'), undef, 'get: by default, no name is set'); + +$fence->update({name => 'Bogs Diamond'}); +is($fence->get('name'), 'Bogs Diamond', 'get: get name'); +is($fence->get('userId'), $fenceUser->userId, 'get: updating name did not affect userId'); + +my $newProps = { + name => 'Warden Norton', + url => 'http://www.shawshank.com', +}; + } #----------------------------------------------------------------------------