-use Test::More tests => 25;
+use Test::More tests => 32;
+
+use lib 't';
use DateTime;
+use_ok 'Support::TestSetup';
use_ok 'SL::DB::Part';
use_ok 'SL::DB::Order';
-use_ok 'SL::Dispatcher';
+use_ok 'SL::DB::Invoice';
-SL::Dispatcher::pre_startup_setup();
+Support::TestSetup::login();
-$::form = Form->new;
+{
$::myconfig{numberformat} = '1.000,00';
$::myconfig{dateformat} = 'dd.mm.yyyy';
-$::locale = Locale->new('de');
+}
my $p = new_ok 'SL::DB::Part';
is($p->sellprice_as_number('2,30'), '2,30');
is($o->marge_percent_as_percent, '22,40');
is($o->marge_percent(0.231), 0.231);
is($o->marge_percent_as_percent, '23,10');
+
+# overloaded attr: invoice taxamount
+my $i = new_ok 'SL::DB::Invoice';
+
+is($i->taxamount_as_number, '0,00');
+$i->amount(12);
+$i->netamount(10.34);
+is($i->taxamount_as_number, '1,66');
+
+$o->closed(1);
+is $o->closed_as_bool_yn, 'Ja', 'bool 1';
+$o->closed(0);
+is $o->closed_as_bool_yn, 'Nein', 'bool 2';
+
+# undef test: this only works for columns without default, rose will set
+# defaults according to the database
+$i->taxincluded(undef);
+is $i->taxincluded_as_bool_yn, '', 'bool 3';
+