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.
This commit is contained in:
Colin Kuskie 2008-03-02 16:47:00 +00:00
parent 4b17be6e54
commit 0774bf771c
2 changed files with 24 additions and 2 deletions

View file

@ -119,7 +119,7 @@ sub getId {
=head2 new ( addressBook, addressId ) =head2 new ( addressBook, addressId )
Constructor. Instanciates an address based upon addressId. Constructor. Instanciates an existing address from the database based upon addressId.
=head3 addressBook =head3 addressBook

View file

@ -31,7 +31,7 @@ my $session = WebGUI::Test->session;
#---------------------------------------------------------------------------- #----------------------------------------------------------------------------
# Tests # Tests
my $tests = 8; my $tests = 10;
plan tests => 1 + $tests; plan tests => 1 + $tests;
#---------------------------------------------------------------------------- #----------------------------------------------------------------------------
@ -98,12 +98,34 @@ cmp_deeply(
$address = WebGUI::Shop::Address->create($book, {}); $address = WebGUI::Shop::Address->create($book, {});
isa_ok($address, 'WebGUI::Shop::Address', 'create returns an Address object with an empty hashref'); isa_ok($address, 'WebGUI::Shop::Address', 'create returns an Address object with an empty hashref');
#######################################################################
#
# addressBook
#
#######################################################################
cmp_deeply( cmp_deeply(
$address->addressBook, $address->addressBook,
$book, $book,
'The address has a reference back to the book used to create it' '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 # new