VS 2008 Automates Unit Test Creation

by Doug Finke on September 3, 2007

in Unit Testing, VS 2008 Beta 2

Don’t have the source for a .Net assembly. No problem. VS 2008 does the job of setting up unit test stubs for you.

Here’s how

  • Create a new Test Project
  • Right mouse click the project
  • Click Add
  • Click Unit Test
  • Click Add Assembly
  • Navigate to an already compiled assembly

VS 2008 reflects over the assembly and creates tests including

  • Naming the test
  • Reflecting over the parameters of the method calls and setting up default values
  • Instantiating the class
  • Calling the method and saves the actual result
  • Defaulting the expected result
  • Asserting the expected to the actual
  • Asserting an Inconclusive test

Huge keystroke and time saver.

{ 0 comments… add one now }

Leave a Comment

You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>