#!/usr/bin/perl

use strict;
use warnings;
use open ':std', ':encoding(UTF-8)';

use constant PRICE_LEVEL_COUNT_TOTAL => 6;
use constant CLIENT_ID => 202;

use Test::More;

BEGIN {
    use lib '/app/tools/rps/lib';
    use_ok 'RPS::DB::Item::PriceLevel';
}

my $singleton = Common::RSApp->new( 'clientID' => 202 );
my $collection = RPS::DB::Item::PriceLevel->GetAll;

is( ref $singleton,  'Common::RSApp::AutoDeleter', 'Common::RSApp singleton created' );
is( ref $collection, 'Common::DB::ItemCollection', 'ItemCollection object created' );

ok( $collection->totalSize == PRICE_LEVEL_COUNT_TOTAL, PRICE_LEVEL_COUNT_TOTAL. " price levels returned" );
is( ref $collection->next, 'RPS::DB::Item::PriceLevel', 'Valid PriceLevel object created' );

done_testing;
