locked
Problems with Moles tutorial (Moles or Stubs template missing)

    Question

  • I am following this tutorial (and I've found several other blogs that look similar):

    Once I get to the part of clicking Project -> Add -> New Item, I don't get a Stubs or Moles template, or anything related to Pex.  What is the correct way to generate Stubs or Moles?  I also wasn't sure which DLL to add, since Microsoft.Stubs doesn't seem to exist anymore.

    Note: When I generate unit tests off my project under test, via Pex, it inserts the .moles file and corresponding support files.  These files seem more or less correct.

    Environment/Repro:
    I am using Windows 7 x64 ultimate, VS 2010 RC, with the commercial evaluation version of Pex, v0.24.50215.1.  I can list some things effecting the environment (test signing mode, CD drive emulation software, personal firewall), though I'm not sure what would be relevant.

    I also previously tried to install the same version over VS 2010 Beta 2, with TestDriven.Net 3 installed.  Had the same problem, so I uninstalled VS 2010 Beta 2, reinstalled VS 2010 RC, reinstalled Pex, and uninstalled TestDriven.Net, in that order.
    Saturday, February 27, 2010 10:54 PM

Answers

  • Solved it by running (as admin): "DevEnv.exe /setup"
    Thanks for the help, and for looking into the problem.

    • Marked as answer by Kavika Sunday, March 07, 2010 7:56 PM
    Sunday, March 07, 2010 7:56 PM
  • The 'Stubs And MOles for Testing' item is deprecated. Instead, right-click on the REference node and click on 'Add Moles Assembly'.
    Jonathan "Peli" de Halleux - Try Pex online at www.pexforfun.com!
    Friday, October 01, 2010 8:34 PM

All replies

  • The tutorial is outdated and we are currently doing a big push on documentation. The next release of Pex will have much higher quality tutorials.

    In your case,

    - the item has been renamed to "Moles and Stubs for Testing"
    - Microsoft.Stubs is now named Microsoft.Moles.Framework. Once you add a 'Moles and Stubs for Testing' item, this assembly will be automatically added to the project.

    Sorry for the inconvinience,
    the Pex team.
    Jonathan "Peli" de Halleux - Give us your input about Pex!
    Saturday, February 27, 2010 11:04 PM
  • Thanks for the quick answer.  I saw reference to that elsewhere in the forum, so I figured as much for those.

    Unfortunately, I am still having problems with it.  The "Moles and Stubs for Testing" item isn't showing up (nor is anything else with "Moles" or "Stubs" in the name), whether or not I add Microsoft.Moles.Framework first.

    I have made a class library for the code under test, but I have tried both a test project and a class library project for the second.  Neither fixes the problem for me.
    Sunday, February 28, 2010 11:32 PM
  • Could you upgrade to the latest download (0.24.50222.1)? Otherwise if it till fails run the intaller as follows and send us the log:

        miexec /i pex.devlabs.mi /log c:\pexinstall.txt


    Jonathan "Peli" de Halleux - Give us your input about Pex!
    Monday, March 01, 2010 12:31 AM
  • It is working fine for me on my VM w/ VS2008.  I have the log you requested, but it is too big to post here.  Is there a section you are interested in, or is there some way I can zip it and send it?
    Tuesday, March 02, 2010 3:22 AM
  • Also, the download links are out of sync between the right side of the page, and the center of the download page.  The links on the right are newer, and match the latest version.  Not sure if you knew that already.  It took me a few minutes to figure that out... :)
    Tuesday, March 02, 2010 3:23 AM
  • We are in process of cleaning up the web site. Please send the install log at pexbug ad microsoft dot com.
    Jonathan "Peli" de Halleux - Give us your input about Pex!
    Tuesday, March 02, 2010 4:30 AM
  • Solved it by running (as admin): "DevEnv.exe /setup"
    Thanks for the help, and for looking into the problem.

    • Marked as answer by Kavika Sunday, March 07, 2010 7:56 PM
    Sunday, March 07, 2010 7:56 PM
  • I ran into exactly the same issue using Visual studio 2010. This was a great tip!


    MCT,MCTS - http://www.tomvangaever.be
    Tuesday, March 30, 2010 3:33 PM
  • I ran into exactly the same issue using Visual studio 2010. This was a great tip!


    MCT,MCTS - http://www.tomvangaever.be
    Tuesday, March 30, 2010 3:33 PM
  • I tried this, but no joy...

    I installed Pex v0.94 (which should include Moles, right?), and I see the Pex template, but no template for Moles and Stubs.

    I did a complete install on VS2008 Team System on Win 7 (x64). I also checked my VS 2010 install, but still no template.

    The install finished as expected and no errors.

    What do I do now to get the Moles template?

    Thanks!

    Chris

    Friday, October 01, 2010 4:04 PM
  • Never mind. I have found that the template has been deprecated.

     

    Chris

    Friday, October 01, 2010 5:55 PM
  • The 'Stubs And MOles for Testing' item is deprecated. Instead, right-click on the REference node and click on 'Add Moles Assembly'.
    Jonathan "Peli" de Halleux - Try Pex online at www.pexforfun.com!
    Friday, October 01, 2010 8:34 PM