A question that arises in almost every single employment lawsuit is whether a plaintiff/employee can or should bring suit while the plaintiff/employee is still employed with the employer/defendant. The answer is almost always yes you can and yes you should.
First, there is no restriction whatsoever about being employed when you file suit. In fact, many hiring decisions (a failure to get a promotion, a reassignment, a transfer) are "actionable" employment actions that are still subject to state and federal anti-discrimination and anti-retaliation laws. The law protects against more than just termination - much more.
Second, if you've hired the right attorney, there are several strategic reasons why you will want to start the lawsuit while you are still employed. To begin with, if the company fires or in any way retaliates against you for filing the lawsuit (or for even speaking to an attorney), then the company is engaged in what we employment lawyers call "an independant act of retaliation" that gives rise to yet another lawsuit.
Some employer's seem willing to rid themselves of current employees who sue even if it risks another lawyer. That seems to be the case for Walmart, which recently fired a female employee who was the plaintiff in a sexual harassment lawsuit against the retail giant. The National Law Journal article is here. Nothing is more challenging to an employer's employment attorney than a lawsuit or charge of discrimination brought by a current employee!
Moreover, since the employer is very likely to terminate and is very eager to get rid of the employee who files suit, the plaintiff has an additional bargaining chip that can be used to negotiate a fair settlement. As a practical matter, any settlement of an employment lawsuit for an employee still employed is going to involve the plaintiff/employee resigning from the company.
If you wait until after you are terminated or after you resign to speak with an employment attorney, then you are doing yourself a disfavor that could result in a much weaker lawsuit. Once you believe something is wrong at work, you should immediately contact an employment attorney to learn your rights and to discuss an effective strategy.