view _test/Test/DOM/Node.pm @ 17:7f88e01b58f8

dom
author Sergey
date Wed, 09 Sep 2009 17:43:31 +0400
parents 65a7bb156fb7
children 818c74b038ae
line wrap: on
line source

package Test::DOM::Node;
use strict;
use warnings;

use base qw(IMPL::Test::Unit);
use IMPL::Test qw(test shared failed);
use IMPL::Class::Property;

require IMPL::DOM::Node;

__PACKAGE__->PassThroughArgs;

BEGIN {
    shared public property Root => prop_all;
}

test Create => sub {
    my ($this) = @_;
    
    $this->Root(new IMPL::DOM::Node(nodeName => 'Root')) or failed "Failed to create a node";
};

test AppendNode => sub {
    my ($this) = @_;
    
    my $child = $this->Root->appendNode(new IMPL::DOM::Node(nodeName => 'Child')) or failed "Failed to append a child node";
    
    my $firstChild = $this->Root->firstChild;
    
    failed "firstChild returned incorrect results" unless $firstChild == $child;
};

1;