add tests for calculation of time and upgrade dao test