test case isBefore method.