Added pre and postconditions to tests