#!/usr/bin/perl
use strict;
use warnings;
use Test::More tests => 1;
use MathModule;

sub testFaculty{

  my %testhash = (
    # Teste ungueltigen negativen Wert
   -2 => -1,
   -1 => -1, 
    # Teste Grenzfall 0
    0 => 1,
    # Teste Grenzfall 1
    1 => 1,
    2 => 2, 
    3 => 6, 
    # Teste Grenzfall 16
    16 => 20922789888000,
    # Teste ungueltigen zu grossen Wert
    17 => -1
  );
  
  my $ok = 1;
  foreach(sort keys %testhash){
    $ok = 0 if(MathModule::faculty($_) != $testhash{$_});
  }
  
  return $ok;
}

is(testFaculty(),1,"faculty");
