More unit tests for storage drivers and a bug fix for memory storage

This PR contains several unit tests. It also contains a bug fix for memory storage. The bug could be reproduced with the newly added unit tests in this PR.
Because of the unit test. In the unit test, we will check the order.

To be honest, I'm not sure if we should enforce this requirement to all drivers. I think I could change the unit test and remove this restriction.