I've done it a few times. It takes a lot of self-discipline but it is very rewarding. Besides having the tests going forward to maintain code health, the mere act of writing tests tends to expose use cases, UI, and design issues you weren't considering or were coming from bad assumptions. It appears to take more time up front but the time it saves in focusing you on "fixing" the tests with new code and not refactoring things you finished as a half-baked prototype can be immense.
<code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>