write tests for factorial and write factorial