Fixed all unit test.
+ new database tests
+ database mock test