[project @ 6098]
[poe-component-client-mpd.git] / t / 12-status.t
blob15b093f443f1895b4f2d36387cd184343d3b5f13
1 #!perl
3 # This file is part of POE::Component::Client::MPD.
4 # Copyright (c) 2007 Jerome Quelin, all rights reserved.
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2 of the License, or (at
9 # your option) any later version.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 use strict;
23 use warnings;
25 use POE::Component::Client::MPD::Status;
26 use Test::More tests => 14;
29 my %kv = (
30     volume         => 66,
31     repeat         => 1,
32     random         => 0,
33     playlist       => 24,
34     playlistlength => 21,
35     xfade          => 14,
36     state          => 'play',
37     song           => 10,
38     songid         => 11,
39     time           => '45:214',
40     bitrate        => 127,
41     audio          => '44100:16:2',
42     error          => 'problems opening audio device',
45 my $s = POE::Component::Client::MPD::Status->new( \%kv );
46 isa_ok( $s,       'POE::Component::Client::MPD::Status', 'object creation' );
47 isa_ok( $s->time, 'POE::Component::Client::MPD::Time',   'accessor: time' );
48 is( $s->volume,         66,                              'accessor: volume' );
49 is( $s->repeat,         1,                               'accessor: repeat' );
50 is( $s->random,         0,                               'accessor: random' );
51 is( $s->playlist,       24,                              'accessor: playlist' );
52 is( $s->playlistlength, 21,                              'accessor: playlistlength' );
53 is( $s->xfade,          14,                              'accessor: xfade' );
54 is( $s->state,          'play',                          'accessor: state' );
55 is( $s->song,           10,                              'accessor: song' );
56 is( $s->songid,         11,                              'accessor: songid' );
57 is( $s->bitrate,        127,                             'accessor: bitrate' );
58 is( $s->audio,          '44100:16:2',                    'accessor: audio' );
59 is( $s->error,          'problems opening audio device', 'accessor: error' );