added testing on main and begin methods in client and portfolio