views:

42

answers:

3

is there any vs addins that can take a class and set up all the wiring to generate the test class and methods as well as mocking the dependencies, etc. this seems like something that can be automated.

A: 

I suspect not; even if the sigs can be automated, You'll need to provide all the cases; it can't infer what is supposed to equal what, what properties matter, what are the edge cases, etc.

Noon Silk
+2  A: 

You can try to create some VS templates.

I've create some Resharper templates for mysel but they are as sophisticated as what you want.

Vadim
+1  A: 

Microsoft tried something like that awhile back, I believe, and was widely criticized for not understanding what Test-Driven Development/Design was all about.

Pex might be part of what you're looking for. It's an aid to unit testing, not a replacement for it.

There are also IoC Container frameworks (and I think mock/isolation frameworks as well) that support auto mocking, which might also help.

As Vadim mentioned, templates and snippets can take care of a lot of the boilerplate code.

I haven't used Pex or auto mocking; I just do what Vadim does.

TrueWill