summaryrefslogtreecommitdiff
path: root/t/03-node.t
blob: 448f666966ea8d695bf7ffe3319061f75a1f15bc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
use strict;
use warnings;

use Test::More;
use Test::Exception;

use Graph::GEXF::Node;

ok my $node = Graph::GEXF::Node->new(id => 0), 'node created';

dies_ok { $node->attribute('url', 'http://linkfluence.net') }
'can\'t add attribute, no attributes defined';

ok $node = Graph::GEXF::Node->new(id => 0,), 'node created';
ok $node->set_node_attribute(
    url => {id => 0, name => 'url', type => 'anyURL'}), 'attribute added';

ok $node->attribute('url', 'http://linkfluence.net'),
  'add attribute url to node';

done_testing;