write tests for the ending time