13 |
13 |
|
14 |
14 |
package main;
|
15 |
15 |
|
16 |
|
use Test::More tests => 83;
|
|
16 |
use Test::More tests => 91;
|
17 |
17 |
use Test::Exception;
|
18 |
18 |
|
19 |
19 |
use strict;
|
... | ... | |
147 |
147 |
is(new_item->assign_attributes('dummy_as_man_days', 3, 'dummy_as_man_days_unit', 'man_day')->dummy, 24, 'assign_attributes array 3man_day');
|
148 |
148 |
is(new_item->assign_attributes('dummy_as_man_days_unit', 'man_day', 'dummy_as_man_days', 3 )->dummy, 24, 'assign_attributes array man_day3');
|
149 |
149 |
|
|
150 |
is(new_item->assign_attributes(dummy_as_man_days_string => '5,25', dummy_as_man_days_unit => 'h' )->dummy, 5.25, 'assign_attributes hash string 5,25h');
|
|
151 |
is(new_item->assign_attributes(dummy_as_man_days_unit => 'h', dummy_as_man_days_string => '5,25')->dummy, 5.25, 'assign_attributes hash string h5,25');
|
|
152 |
|
|
153 |
is(new_item->assign_attributes(dummy_as_man_days_string => '5,25', dummy_as_man_days_unit => 'man_day')->dummy, 42, 'assign_attributes hash string 5,25man_day');
|
|
154 |
is(new_item->assign_attributes(dummy_as_man_days_unit => 'man_day', dummy_as_man_days_string => '5,25' )->dummy, 42, 'assign_attributes hash string man_day5,25');
|
|
155 |
|
|
156 |
is(new_item->assign_attributes('dummy_as_man_days_string', '5,25', 'dummy_as_man_days_unit', 'h' )->dummy, 5.25, 'assign_attributes array 5,25h');
|
|
157 |
is(new_item->assign_attributes('dummy_as_man_days_unit', 'h', 'dummy_as_man_days_string', '5,25')->dummy, 5.25, 'assign_attributes array h5,25');
|
|
158 |
|
|
159 |
is(new_item->assign_attributes('dummy_as_man_days_string', '5,25', 'dummy_as_man_days_unit', 'man_day')->dummy, 42, 'assign_attributes array 5,25man_day');
|
|
160 |
is(new_item->assign_attributes('dummy_as_man_days_unit', 'man_day', 'dummy_as_man_days_string', '5,25' )->dummy, 42, 'assign_attributes array man_day5,25');
|
|
161 |
|
150 |
162 |
# Parametervalidierung
|
151 |
163 |
throws_ok { new_item()->dummy_as_man_days_unit('invalid') } qr/unknown.*unit/i, 'unknown unit';
|
152 |
164 |
lives_ok { new_item()->dummy_as_man_days_unit('h') } 'known unit h';
|
AttrDuration: in SL::DB::Object->assign_attributes() auch attr_man_days_string() vor _unit() auswerten