Add missing mock() test, and add pre-condition test.