Visual studio generate test

is there any vs additions that can take the class and set up all the wiring to generate the test class and methods, and mock dependencies, etc., this looks like something that could be automated.

+2


source to share


3 answers


Microsoft tried something like this a while ago, I suppose, and received widespread criticism for not understanding what Test-Driven Development / Design was about.

Pex may be part of what you are looking for. This helps to test the device, not replace it.

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



As Vadim pointed out, templates and snippets can take care of a large template of code.

I didn't use Pex or auto mocking; I just do what Vadim does.

+1


source


You can create multiple VS templates.



I create some Resharper templates for mysel, but they are as complex as you want them to be.

+2


source


I suspect not; even if sigs can be automated, you will need to provide all cases; it cannot infer what should match what matters, what are the edge cases, etc.

0


source







All Articles