Logic to pay rent and test case