Removed ? from assertions
Added optional parameter to allow check the number of times functions are called