自定义Web测试验证规则中的枚举 [英] Enum in custom web test validation rule

查看:214
本文介绍了自定义Web测试验证规则中的枚举的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Microsoft VS2010构建Web测试.
我在MSDN上使用了以下解释:如何:为Web性能创建自定义验证规则测试.
在示例中,当我将此验证规则添加到测试中时,使用stringint作为私有成员,并带有公共"get"和"set"这些参数,这些参数对于用户界面中的编辑有效.

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.

我希望有一个Enum with 3选项,当我将验证规则添加到UI时,我可以选择.

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

是否可以添加在用户界面中也有效的Enum变量?
还有其他可以使用的类型在UI中有效吗?

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 ?

推荐答案

不幸的是,UI仅在用户创建的规则/插件中显示 String primitive 类型的属性.但是某些内置规则/插件使用枚举 ...怎么可能?多亏了分解的魔力和一些侦探性的工作,我们发现它仅接受其程序集名称包含字符串"Microsoft.VisualStudio.QualityTools.WebTestFramework"的枚举.

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".

因此,如果您麻烦将枚举(或实际上是整个项目)编译为一个名为"MyEnums.Microsoft.VisualStudio.QualityTools.WebTestFramework"的程序集,则将枚举类型的属性设置为BOOM出现在编辑器用户界面中.

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.

这篇关于自定义Web测试验证规则中的枚举的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆