Nothing stops you from doing this. But one must remember that benefits from the Maternity Benefit Act are for the good of the community, and sudden resignations after taking all benefits would make employers wary of employing women. Ponder over the impact of your action before resigning. There is no point in saying it is only a single case; there may be others doing it, and in aggregate, the employers would have spent a lot for a social cause.