File: trustnet.t

package info (click to toggle)
libfinance-quote-perl 1.08-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 360 kB
  • ctags: 120
  • sloc: perl: 2,120; makefile: 47
file content (31 lines) | stat: -rwxr-xr-x 604 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/perl -w
use strict;
use Test;

BEGIN {plan tests => 8 };

use Finance::Quote;

# Test trustnet functions.

my $q = Finance::Quote->new();

my @stocks = ("ABBEY AMERICAN GROWTH","MARLBOROUGH INTL EQUITY");

my %quotes = $q->fetch("trustnet",@stocks);

ok(%quotes);

# For each of our stocks, check to make sure we got back some
# useful information.

foreach my $stock (@stocks) {
	ok($quotes{$stock,"success"});
	ok($quotes{$stock,"price"});
	ok($quotes{$stock,"date"});
}

# Test that a bogus stock gets no success.

%quotes = $q->fetch("trustnet","BOGUS");
ok(! $quotes{"BOGUS","success"});