Freigeben über


New Unit Testing Features in Orcas (Part 2)

This is a part of a series of postings on the details of some of the new features appearing in Orcas. All these features will be available in Orcas beta 2.

Gaining Access to Private Code under test:

In Whidbey, we introduced the concept of private accessors to provide users with an easy way to access private members of code under test. Private Accossors served as a wrapper for reflection, consisting of shadow implementations of the methods of a class which provided access to a private field or method through a reflection call - hiding all the nitty gritties of reflection from the user. Although, it seems that users love the concept, we decided to rewrite the feature to make it more robust in Orcas.

In Orcas, we decided to change private accessors from being code based to assembly based. The assembly based assessors are more robust and are picked up by intelliscene and auto-regeneration when the code under test has changed. As in Whidbey, Orcas private accessors are automatically generated whenever generating unit tests for private methods, they can be manually generated by right clicking inside the code editor and selecting Create Private Accessor. Generating private accessors can also be achieved via the command line via running publicize.exe (new in Orcas). I have the impression that the majority of users are still unaware of this cool feature, so I hope more will play with it in Orcas Beta 2 and RTM.

Generating Unit Tests:

For those new to unit testing, VSTS contains a nice feature to generate an outline of a unit test for a given method of code under test. In Orcas, we have re-written the generation engine to be more robust, to work more intelligently with the code under test and to functional with the new assembly based private accessors. We have also beefed it up to better support .Net languages, specifically .Net reflection.

Support for Device Projects:

In Orcas, we introduce support for unit testing on embedded devices. All the functionality described, in these posts, and that which was present in Whidbey will be accessible to device programmers.

Automatic Cleanup of Test Results and Their Associated Deployments

One of the pain points we often hear from customers concerns deployments inadvertently filling their hard drive as they execute more and more tests. To assist these users, we have designed Visual Studio Orcas to automatically remove old deployments when more than 25 test results have filled the Test Project’s Test Results directory. One can change the number of old deployments maintained on disk in Tools->Options->Test Tools->Test Execution.

Comments

  • Anonymous
    May 14, 2007
    Paul Hacker on Source Only Process Template. Grant Holliday on TFS Installation Error 28805. The SRL...

  • Anonymous
    June 24, 2007
    Preliminary thoughts on TDD with MSTest in Orcas

  • Anonymous
    June 24, 2007
    Naysawn , the PM for MSTest, asked that I take a look at the new unit testing features of Orcas, after

  • Anonymous
    August 01, 2007
    Lot's of new stuff for web, load, and unit tests in Orcas. Follow the links for more info. Web test ·

  • Anonymous
    August 08, 2007
    Looking at the white paper titled "An Overview of Microsoft Visual Studio 2008" there is a comment there about unit testing that I'm hoping to find some confirmation for. Under the section "Improve Application Life-Cycle Management (ALM)" it reads: "unit tests are now available to all Visual Studio Professional Edition users . . ."  What exactly is meant by available?  It would be great to learn that the Pro version now includes ALL of the unit testing functionality that the Dev version now has. Thanks, David

  • Anonymous
    August 30, 2007
    Time for another weekly roundup of news that focuses on .NET and general development related content

  • Anonymous
    September 18, 2007
    The comment has been removed

  • Anonymous
    September 18, 2007
    The comment has been removed

  • Anonymous
    October 05, 2007
    Does anyone actually use the Right-click, generate tests feature?  I can't imagine that anybody who values unit testing would ever do that. You say that it's improved... how so?  Does it not give you a test wrapper for every public member?

  • Anonymous
    December 22, 2007
    What else can I say? The big day has arrived (read the official word here on Soma's blog ) and we're