arg_types.t 5.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. use strict;
  2. use warnings;
  3. use TestRail::API;
  4. use Test::More 'tests' => 48;
  5. use Test::Fatal;
  6. use Class::Inspector;
  7. use Test::LWP::UserAgent;
  8. use HTTP::Response;
  9. my $tr = TestRail::API->new('http://hokum.bogus','bogus','bogus',1);
  10. $tr->{'browser'} = Test::LWP::UserAgent->new();
  11. $tr->{'browser'}->map_response(qr/.*/, HTTP::Response->new('500', 'ERROR', ['Content-Type' => 'text/plain'], ''));
  12. is( exception {$tr->getCaseTypes() },undef,'getCaseTypes returns no error when no arguments are passed');
  13. is( exception {$tr->getPossibleTestStatuses() },undef,'getPossibleTestStatuses returns no error when no arguments are passed');
  14. is( exception {$tr->getProjects() },undef,'getProjects returns no error when no arguments are passed');
  15. is( exception {$tr->getTestResultFields() },undef,'getTestResultFields returns no error when no arguments are passed');
  16. is( exception {$tr->getUsers() },undef,'getUsers returns no error when no arguments are passed');
  17. isnt( exception {$tr->createCase() },undef,'createCase returns error when no arguments are passed');
  18. isnt( exception {$tr->createMilestone() },undef,'createMilestone returns error when no arguments are passed');
  19. isnt( exception {$tr->createPlan() },undef,'createPlan returns error when no arguments are passed');
  20. isnt( exception {$tr->createProject() },undef,'createProject returns error when no arguments are passed');
  21. isnt( exception {$tr->createRun() },undef,'createRun returns error when no arguments are passed');
  22. isnt( exception {$tr->createSection() },undef,'createSection returns error when no arguments are passed');
  23. isnt( exception {$tr->createTestResults() },undef,'createTestResults returns error when no arguments are passed');
  24. isnt( exception {$tr->createTestSuite() },undef,'createTestSuite returns error when no arguments are passed');
  25. isnt( exception {$tr->deleteCase() },undef,'deleteCase returns error when no arguments are passed');
  26. isnt( exception {$tr->deleteMilestone() },undef,'deleteMilestone returns error when no arguments are passed');
  27. isnt( exception {$tr->deletePlan() },undef,'deletePlan returns error when no arguments are passed');
  28. isnt( exception {$tr->deleteProject() },undef,'deleteProject returns error when no arguments are passed');
  29. isnt( exception {$tr->deleteRun() },undef,'deleteRun returns error when no arguments are passed');
  30. isnt( exception {$tr->deleteSection() },undef,'deleteSection returns error when no arguments are passed');
  31. isnt( exception {$tr->deleteTestSuite() },undef,'deleteTestSuite returns error when no arguments are passed');
  32. isnt( exception {$tr->getCaseByID() },undef,'getCaseByID returns error when no arguments are passed');
  33. isnt( exception {$tr->getCaseByName() },undef,'getCaseByName returns error when no arguments are passed');
  34. isnt( exception {$tr->getCaseTypeByName() },undef,'getCaseTypeByName returns error when no arguments are passed');
  35. isnt( exception {$tr->getCases() },undef,'getCases returns error when no arguments are passed');
  36. isnt( exception {$tr->getMilestoneByID() },undef,'getMilestoneByID returns error when no arguments are passed');
  37. isnt( exception {$tr->getMilestoneByName() },undef,'getMilestoneByName returns error when no arguments are passed');
  38. isnt( exception {$tr->getPlanByID() },undef,'getPlanByID returns error when no arguments are passed');
  39. isnt( exception {$tr->getPlanByName() },undef,'getPlanByName returns error when no arguments are passed');
  40. isnt( exception {$tr->getProjectByID() },undef,'getProjectByID returns error when no arguments are passed');
  41. isnt( exception {$tr->getProjectByName() },undef,'getProjectByName returns error when no arguments are passed');
  42. isnt( exception {$tr->getRunByID() },undef,'getRunByID returns error when no arguments are passed');
  43. isnt( exception {$tr->getRunByName() },undef,'getRunByName returns error when no arguments are passed');
  44. isnt( exception {$tr->getSectionByID() },undef,'getSectionByID returns error when no arguments are passed');
  45. isnt( exception {$tr->getSectionByName() },undef,'getSectionByName returns error when no arguments are passed');
  46. isnt( exception {$tr->getTestByID() },undef,'getTestByID returns error when no arguments are passed');
  47. isnt( exception {$tr->getTestByName() },undef,'getTestByName returns error when no arguments are passed');
  48. isnt( exception {$tr->getTestResults() },undef,'getTestResults returns error when no arguments are passed');
  49. isnt( exception {$tr->getTestSuiteByID() },undef,'getTestSuiteByID returns error when no arguments are passed');
  50. isnt( exception {$tr->getTestSuiteByName() },undef,'getTestSuiteByName returns error when no arguments are passed');
  51. isnt( exception {$tr->getUserByEmail() },0,'getUserByEmail returns error when no arguments are passed');
  52. isnt( exception {$tr->getUserByID() },0,'getUserByID returns error when no arguments are passed');
  53. isnt( exception {$tr->getUserByName() },0,'getUserByName returns error when no arguments are passed');
  54. isnt( exception {$tr->getTests() },undef,'getTests returns error when no arguments are passed');
  55. isnt( exception {$tr->getTestSuites() },undef,'getTestSuites returns error when no arguments are passed');
  56. isnt( exception {$tr->getSections() },undef,'getSections returns error when no arguments are passed');
  57. isnt( exception {$tr->getRuns() },undef,'getRuns returns error when no arguments are passed');
  58. isnt( exception {$tr->getPlans() },undef,'getPlans returns error when no arguments are passed');
  59. isnt( exception {$tr->getMilestones() },undef,'getMilestones returns error when no arguments are passed');