# Before `make install' is performed this script should be runnable with
# `make test'. After `make install' it should work as `perl Spotter.t'

######################### We start with some black magic to print on failure.

# Change 1..1 below to 1..last_test_to_print .
# (It may become useful if the test is moved to ./t subdirectory.)

BEGIN { $| = 1; print "1..2\n"; }
END {print "not ok 1\n" unless $loaded;}
use Carp;

%%GENEX_EXTRALIBS%%
use lib 't';

# use TestDB qw($TEST_USERCANONICALLINK $TEST_USERCANONICALLINK_DESCRIPTION);
use Bio::Genex::UserCanonicalLink;
use Bio::Genex;
$loaded = 1;
my $i = 1;
print "ok ", $i++, "\n";

######################### End of black magic.

# Insert your test code below (better if it prints "ok 13"
# (correspondingly "not ok 13") depending on the success of chunk 13
# of the test code):

# testing a random attribute
my $p = Bio::Genex::UserCanonicalLink->new();
$p->usf_fk(555);
if ($p->usf_fk() == 555){
  print "ok ", $i++, "\n";
} else {
  print "not ok ", $i++, "\n";
}

__END__
# no info in DB yet


# test fetch
$p = Bio::Genex::UserCanonicalLink->new(id=>$TEST_USERCANONICALLINK);
$p->fetch();
if ($p->usf_fk() eq $TEST_USERCANONICALLINK_DESCRIPTION){
  print "ok ", $i++, "\n";
} else {
  print "not ok ", $i++, "\n";
}

# test delayed_fetch
$p = Bio::Genex::UserCanonicalLink->new(id=>$TEST_USERCANONICALLINK);
if (not defined $p->get_attribute('usf_fk')){
  print "ok ", $i++, "\n";
} else {
  print "not ok ", $i++, "\n";
}

if ($p->usf_fk() eq $TEST_USERCANONICALLINK_DESCRIPTION){
  print "ok ", $i++, "\n";
} else {
  print "not ok ", $i++, "\n";
}


1;

