locked
Error running unit tests from wizard RRS feed

  • Question

  • Hi,

    I'm running Visual Studio 2005, and I'm having trouble with the unit tests generated by the Unit Test Wizard.  Here's what I'm doing:

    1) create a new project (I've tried Windows Application and Class Library)

    2) add a single method that returns the number 3

    3) Add a unit test using the Unit Test Wizard; modify the resulting test to check that my method returns 3.

    4) Compile everything and run the test

    I get an error saying:  "UTA052: DummyTest.Class1Test is not a test class".

    Any suggestions as to what's going on?

    --Matt

    Thursday, September 7, 2006 1:25 AM

Answers

  • Hi Matt,

    I'm really sorry to hear that you're going through this problem. Unfortunately it is really difficult to know what's happening if we don't have a repro. I've tried installing Visual Studio and Team Explorer on top of it, and I'm not seeing the issue. I recommend trying the scenario in a clean machine and see if you can get it to repro again. If you do, I would appreciate any information so that we can take a look into the problem.

    For now, reinstalling Visual Studio again should fix the problem. Please let me know if I can answer any other question.

    Thanks,
    David Gorena Elizondo
    [MSFT] VSTS

    Friday, September 8, 2006 12:28 AM

All replies

  • Hello,

    Got several questions for you,

    1. Is this RTM version of Visual Studio 2005 installed on a clean machine?
    2. What language are you using?
    3. Can you see the [TestClass()] attribute in your generated  Class1Test.cs?
    4. Are you running the test using the UI or commandline?

    Thanks,
    David Gorena Elizondo
    [MSFT] VSTS

    Thursday, September 7, 2006 3:38 AM
  • 1. No.  It's been installed on the computer I've been using for about two months now.  (Incidentally, about a month ago, I was using VS 2005 and I was not seeing this problem.  The only major difference to my machine?  I installed Team Explorer.  I've tried uninstalling it, but it doesn't seem to make a difference.)

    2. C#

    3. Yes.  I can also see the [TestMethod()] attribute on the test method.

    4. UI

     

    Thursday, September 7, 2006 1:07 PM
  • Hi Matt,

    I'm really sorry to hear that you're going through this problem. Unfortunately it is really difficult to know what's happening if we don't have a repro. I've tried installing Visual Studio and Team Explorer on top of it, and I'm not seeing the issue. I recommend trying the scenario in a clean machine and see if you can get it to repro again. If you do, I would appreciate any information so that we can take a look into the problem.

    For now, reinstalling Visual Studio again should fix the problem. Please let me know if I can answer any other question.

    Thanks,
    David Gorena Elizondo
    [MSFT] VSTS

    Friday, September 8, 2006 12:28 AM
  • Reinstalling VS 2005 (for SW developers) seemed to do the trick.  Thanks!
    Friday, September 8, 2006 1:56 PM
  • It is quite more simplier to rename your test class.

    It works too.
    Friday, March 21, 2008 11:12 AM
  • By renaming, are you referring to the the whole class project or the individual class files?

     

    I am working with Visual Studio 2005 Team Edition, with all the code on my C: drive. My unit tests are getting the message:

    UTA052: ****.Utilities.Test.NumericalTest is not a test class

     

    This occurs within the test manager which has identified the public functions as tests.

    Monday, July 28, 2008 9:46 AM
  • My occurance of the problem turned out to be due to the following line (put in at the request of FXCOP)

    [assembly: PermissionSet(SecurityAction.RequestOptional, Name = "Nothing")]

     

    Commenting out this line fixed the problem.

    Monday, July 28, 2008 11:12 AM