Add lock tests.

This completes v1 of the unit tests.