InputGetter.t 913 B

12345678910111213141516171819202122232425262728293031323334
  1. #!/usr/bin/perl
  2. use strict;
  3. use warnings;
  4. use Test::More qw{no_plan};
  5. main();
  6. sub main {
  7. my $class = 'Fcm::Interactive::InputGetter';
  8. use_ok($class);
  9. test_constructor($class);
  10. }
  11. ################################################################################
  12. # Tests usage of constructor
  13. sub test_constructor {
  14. my ($class) = @_;
  15. my $prefix = 'constructor';
  16. my $input_getter = $class->new({
  17. title => 'title-value',
  18. message => 'message-value',
  19. type => 'type-value',
  20. default => 'default-value',
  21. });
  22. isa_ok($input_getter, $class);
  23. is($input_getter->get_title(), 'title-value', "$prefix: get title");
  24. is($input_getter->get_message(), 'message-value', "$prefix: get message");
  25. is($input_getter->get_type(), 'type-value', "$prefix: get type");
  26. is($input_getter->get_default(), 'default-value', "$prefix: get default");
  27. }
  28. __END__