Enum in custom web test validation rule

∥☆過路亽.° 提交于 2019-12-08 10:02:44

问题


I'm building a Web Test using Microsoft VS2010.
I used the explanation on MSDN: How to: Create a Custom Validation Rule for a Web Performance Test.
In the example there using string and int as private members with public "get" and "set" those parameters valid for edit in the UI when I add this validation rule to my test.

I want to have an Enum with 3 option that when I add the validation rule to the UI I can choose from.

Is there a way to add an Enum variable which will also be valid in the UI ?
Are there any other types which can be used which will be valid in the UI ?


回答1:


Unfortunately the UI only shows String and primitive-type properties in user-created rules/plugins. Yet some built-in rules/plugins use enums... how can this be? Thanks to the magic of the disassember and some detective work, we discover that it only accepts enums whose assembly name contains the string "Microsoft.VisualStudio.QualityTools.WebTestFramework".

So if you go to the trouble of compiling your enums (or indeed, your entire project) into an assembly called, for example, "MyEnums.Microsoft.VisualStudio.QualityTools.WebTestFramework", BOOM your enum-typed properties will happily appear in the editor UI.



来源:https://stackoverflow.com/questions/13220677/enum-in-custom-web-test-validation-rule

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!