Test a few more corner cases for effective 100% coverage

This commit is contained in:
Colin Kuskie 2008-09-10 23:27:34 +00:00
parent e7ea7b3e1f
commit 27769a9b68

View file

@ -16,7 +16,7 @@ use WebGUI::Session;
use WebGUI::Workflow;
use WebGUI::Workflow::Cron;
use WebGUI::Utility qw/isIn/;
use Test::More tests => 61; # increment this value for each test you create
use Test::More tests => 64; # increment this value for each test you create
use Test::Deep;
my $session = WebGUI::Test->session;
@ -73,6 +73,10 @@ $wf->set({'mode', 'serial'});
is(join('', $wf->isSingleton, $wf->isSerial, $wf->isParallel), '010', 'Is checks after setting mode to serial');
$wf->set({'mode', 'singleton'});
is(join('', $wf->isSingleton, $wf->isSerial, $wf->isParallel), '100', 'Is checks after setting mode to singleton');
$wf->set({'isSerial' => 1});
is(join('', $wf->isSingleton, $wf->isSerial, $wf->isParallel), '010', 'Is checks after setting mode to singleton');
$wf->set({'isSingleton' => 1});
is(join('', $wf->isSingleton, $wf->isSerial, $wf->isParallel), '100', 'Is checks after setting mode to singleton');
$wf->delete;
ok(!defined WebGUI::Workflow->new($session, $wfId), 'deleted workflow cannot be retrieved');
@ -194,6 +198,14 @@ cmp_deeply(
'delete activity works'
);
$wf3->deleteActivity('neverAWebGUIId');
cmp_deeply(
[ map { $_->getId } @{ $wf3->getActivities } ],
[ map { $_->getId } $oldTrash, $decayKarma, $trashClipboard],
'delete activity requires a valid activityId to delete'
);
cmp_deeply(
[ map { $_->get('sequenceNumber') } @{ $wf3->getActivities } ],
[ 1,2,3 ],