Add tests for calculatebase