There is an interesting product http://www.agitar.com that generates unit tests for Java programs; they did announce that they were going to do something for .net but I haven't heard anything recently.
I think one of the interesting things about code generation is that it should not only be able to define a set of metadata from which you can create the business classes, but it should be able to use that metadata to create a reasonable skeleton of unit tests too.