1 # -*-Perl-*- Test Harness script for Bioperl
9 test_begin(-tests => 12,
10 -requires_module => 'Graph::Directed');
12 use_ok('Bio::Ontology::Relationship');
13 use_ok('Bio::Ontology::GOterm');
14 use_ok('Bio::Ontology::RelationshipType');
17 my $IS_A = Bio::Ontology::RelationshipType->get_instance( "IS_A" );
18 isa_ok($IS_A, "Bio::Ontology::RelationshipType");
20 my $parent = Bio::Ontology::GOterm->new();
21 isa_ok($parent, "Bio::Ontology::GOterm" );
23 my $child = Bio::Ontology::GOterm->new();
24 isa_ok($child, "Bio::Ontology::GOterm");
26 $parent->name( "parent" );
28 $child->name( "child" );
30 my $rel = Bio::Ontology::Relationship->new( -identifier => "16847",
31 -parent_term => $parent,
32 -child_term => $child,
33 -relationship_type => $IS_A );
35 isa_ok($rel, "Bio::Ontology::Relationship");
37 is( $rel->identifier(), "16847" );
39 is( $rel->parent_term()->name(), "parent" );
41 is( $rel->child_term()->name(), "child" );
43 is( $rel->relationship_type()->name(), "IS_A" );
45 ok( $rel->to_string() );