Tuesday, December 9, 2014

UTA004: The TestMethodAttribute can be defined only inside a class marked with the TestClass attribute.

If you got this error message even when you've defined both 'TestMethod' and 'TestClass' attributes properly then
Message: UTA004: Illegal use of attribute on <test method>. The TestMethodAttribute can be defined only inside a class marked with the TestClass attribute.

then make sure that your test class is defined public.

[TestClass]
public class ControllerTest
{
        [TestMethod]
        public void ValidTest()
        {
         }
}

1 comment: