handle the testNLPWConstraint if snopt is not installed

Add `solveWDefaultSolver` function in the test, so the solver chooses fmincon if snopt is not installed