1 # -*-Perl-*- Test Harness script for Bioperl
2 # $Id: egquery.t 15112 2008-12-08 18:12:38Z sendu $
12 test_begin(-tests => 19);
14 use_ok('Bio::Tools::EUtilities');
18 my $eutil = Bio::Tools::EUtilities->new(
20 -file => test_input_file('eutils','egquery.xml'));
22 is($eutil->get_db, 'pubmed', 'get_db');
23 is($eutil->get_database, 'pubmed', 'get_database');
24 is(scalar($eutil->get_databases), 35, 'get_databases');
25 is($eutil->get_term, 'Notch AND Mus musculus','get_term');
27 ## eveything else undef or 0
28 is ($eutil->get_count('pubmed'), 1803, 'get_count');
29 is ($eutil->get_count('protein'), 534, 'get_count');
30 is ($eutil->get_count('cdd'), 0, 'get_count');
32 my @qs = $eutil->get_GlobalQueries;
33 is(scalar(@qs), 35, 'get_GlobalQueries');
34 is($qs[2]->get_term, 'Notch AND Mus musculus', 'get_term');
35 is($qs[2]->get_database, 'journals', 'get_term');
36 is($qs[2]->get_count, 0, 'get_term');
37 is($qs[2]->get_status, 'Term or Database is not found', 'get_term');
38 is($qs[2]->get_menu_name, 'Journals', 'get_term');
40 is($qs[20]->get_term, 'Notch AND Mus musculus', 'get_term');
41 is($qs[20]->get_database, 'unists', 'get_term');
42 is($qs[20]->get_count, 61, 'get_term');
43 is($qs[20]->get_status, 'Ok', 'get_term');
44 is($qs[20]->get_menu_name, 'UniSTS', 'get_term');