Unanswered Cannot Associate TestCase

  • Wednesday, July 25, 2012 7:48 PM
     
     

    Hello

    i have created a TestClassExtention, and everywhere i use it i cannot associate/create the test methods with a testcase.

    i get "Object reference not set to an instance of an object."

    when i try to associate a test method to a test case in the test view window.

    if i return the class to "TestClass" attribute all is working fine.

    this behavior also happens with the examples about TestClassExtension that can be found in MSDN.

    going to the test class and associating from there works as well as using the "Pronto Extension".

All Replies

  • Thursday, July 26, 2012 8:58 AM
    Moderator
     
     

    Hi Liran,

    Thank you for your post.

    Do you mean you experience "Object reference not set to an instance of an object." error when use TestClassExtention to associate test case with test case?

    How do you difine your TestClassExtention?

    Regards,


    Lily Wu [MSFT]
    MSDN Community Support | Feedback to us

  • Thursday, July 26, 2012 10:20 AM
     
      Has Code

    the class is defined like this:

        [Serializable]
        public class RetryTestClassAttribute : TestClassExtensionAttribute
        {
            private static readonly Uri m_uri =
                       new Uri("urn:Microsoft.RetryTestClassAttribute");
     
            public RetryTestClassAttribute()
            {
            }
            
            public override Uri ExtensionId
            {
                get { return m_uri; }
            }
     
            public override TestExtensionExecution GetExecution()
            {
                return new RetryTestExtensionExecution();
            }
     
            public override object GetClientSide()
            {
                return base.GetClientSide();
            }
        }

    i think the problem is with the "GetClientSide()" but i havent seen any other examples that show different

  • Friday, July 27, 2012 6:39 AM
    Moderator
     
     

    Hi Liran,

    To accosicate test menthod with a test case is in VS, not in MTM.

    Regards,


    Lily Wu [MSFT]
    MSDN Community Support | Feedback to us

  • Monday, July 30, 2012 6:21 AM
     
     

    sorry for the late reply

    but i am trying to associate the test method through the test view window in the VS and getting "Object reference not set to an instance of an object"

    this also happens if i try to to create a test case from the test method.

    the VS2010 contains all the latest updates (SP1, TFS CU2, FC 2012).