Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you create a custom attribute for MS Test?

If you want to create a custom attribute for MS test (say [Repeat(3)] how would you do that?

like image 530
RoyOsherove Avatar asked Sep 22 '08 12:09

RoyOsherove


People also ask

What are custom attributes?

Custom attributes. A custom attribute is a property that you can define to describe assets. Custom attributes extend the meaning of an asset beyond what you can define with the standard attributes. You can create a custom attribute and assign to it a value that is an integer, a range of integers, or a string.

What is the attribute used for test method?

FindParamAttribute: You use this attribute to describe how an element can be found on the page. You set this attribute on test methods or share it across all test methods of a particular test class by setting it on the test class that contains the test methods that will use the FindParam definitions.


1 Answers

I don't think you will like the answer: there is no supported way. However, there is a codeplex project MSTestExtensions implementing a work around and a blog post about how MSTestExtensions works. (Using ContextBoundObject)

like image 117
Ryan Rinaldi Avatar answered Oct 24 '22 22:10

Ryan Rinaldi