[project @ 6363]
[audio-mpd.git] / t / 10-status.t
blob2a1a9e2a1740668c11cc60e3f835b9e7c4396f98
1 #!perl
3 # This file is part of Audio::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 same terms as Perl itself.
11 use strict;
12 use warnings;
14 use Audio::MPD::Status;
15 use Test::More tests => 14;
18 my %kv = (
19     volume         => 66,
20     repeat         => 1,
21     random         => 0,
22     playlist       => 24,
23     playlistlength => 21,
24     xfade          => 14,
25     state          => 'play',
26     song           => 10,
27     songid         => 11,
28     time           => '45:214',
29     bitrate        => 127,
30     audio          => '44100:16:2',
31     error          => 'problems opening audio device',
34 my $s = Audio::MPD::Status->new( %kv );
35 isa_ok( $s, 'Audio::MPD::Status', 'object creation' );
36 is( $s->volume,         66,                              'accessor: volume' );
37 is( $s->repeat,         1,                               'accessor: repeat' );
38 is( $s->random,         0,                               'accessor: random' );
39 is( $s->playlist,       24,                              'accessor: playlist' );
40 is( $s->playlistlength, 21,                              'accessor: playlistlength' );
41 is( $s->xfade,          14,                              'accessor: xfade' );
42 is( $s->state,          'play',                          'accessor: state' );
43 is( $s->song,           10,                              'accessor: song' );
44 is( $s->songid,         11,                              'accessor: songid' );
45 isa_ok( $s->time,       'Audio::MPD::Time',              'accessor: time' );
46 is( $s->bitrate,        127,                             'accessor: bitrate' );
47 is( $s->audio,          '44100:16:2',                    'accessor: audio' );
48 is( $s->error,          'problems opening audio device', 'accessor: error' );