From 0774bf771c3e1b8ec6ba89f25b8038f9cb6a3cee Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Sun, 2 Mar 2008 16:47:00 +0000 Subject: [PATCH] Add a few more tests, and some POD to make sure that new is known to be different from create as an instanciator versus a constructor. --- lib/WebGUI/Shop/Address.pm | 2 +- t/Shop/Address.pm | 24 +++++++++++++++++++++++- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/lib/WebGUI/Shop/Address.pm b/lib/WebGUI/Shop/Address.pm index 020d8d063..6ed8377bf 100644 --- a/lib/WebGUI/Shop/Address.pm +++ b/lib/WebGUI/Shop/Address.pm @@ -119,7 +119,7 @@ sub getId { =head2 new ( addressBook, addressId ) -Constructor. Instanciates an address based upon addressId. +Constructor. Instanciates an existing address from the database based upon addressId. =head3 addressBook diff --git a/t/Shop/Address.pm b/t/Shop/Address.pm index e94d50caf..803b2e91e 100644 --- a/t/Shop/Address.pm +++ b/t/Shop/Address.pm @@ -31,7 +31,7 @@ my $session = WebGUI::Test->session; #---------------------------------------------------------------------------- # Tests -my $tests = 8; +my $tests = 10; plan tests => 1 + $tests; #---------------------------------------------------------------------------- @@ -98,12 +98,34 @@ cmp_deeply( $address = WebGUI::Shop::Address->create($book, {}); isa_ok($address, 'WebGUI::Shop::Address', 'create returns an Address object with an empty hashref'); +####################################################################### +# +# addressBook +# +####################################################################### + cmp_deeply( $address->addressBook, $book, 'The address has a reference back to the book used to create it' ); +####################################################################### +# +# getId +# +####################################################################### + +ok( $session->id->valid($address->getId), 'Address has a valid GUID'); + +####################################################################### +# +# get +# +####################################################################### + +ok( $session->id->valid($address->getId), 'Address has a valid GUID'); + ####################################################################### # # new