Refactor test for HandleSendingOut; remove duplicated codes