热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

Howto:SpecifyaTestRunConfiguration

You can control the way test runs proceed by specifying settings that are stored in

You can control the way test runs proceed by specifying settings that are stored in

test


run configurations

. Test run configuration settings are saved to disk in files that have the .testrunconfig extension. You can create and save multiple run configurations, and then make a specific run configuration

active

, which is the test run configuration that is used when tests are run. For information about how to make a run configuration active, see

How to: Apply a Test Run Configuration

.

The procedures in this topic describe various aspects of working with run configurations. The first group of procedures describes how to create and delete run configurations.

The second group of procedures describes how to set the values within run configurations. To set these values, you use the test run configuration editor, a dialog box that has the following pages:




  • General

    . On this page, specify a name for the test run configuration and an optional textual description. You can also specify a scheme for creating the names of test runs, which are used to identify test runs in the Test Results window.




  • Controller and Agent

    . Select whether to run tests on the local computer, or remotely, by using a test controller. Running tests locally lets you debug your tests and your production code. You cannot use integrated debugging when you run tests remotely.

    If you choose to run tests remotely, you identify the controller to use by specifying its network name or its IP address. For more information, see


    Working with Controllers, Agents, and Rigs


    .












    Note

    When the test controller is the local computer, identify the computer by specifying

    localhost

    .



    You can also specify names and values for properties of an agent. If an agent being used has those properties, the test or tests you are running will use that agent. If no agent has the properties that were requested, the test run will fail.




  • Code Coverage

    . On the code coverage page, you specify what to instrument: which DLLs or .exe files, and, for ASP.NET projects, which directories. You can also specify whether to instrument in place and how to re-sign the files. This process starts by making a copy of the DLL. Then, the DLL is changed, that is,

    instrumented,

    so that code coverage statistics can be gathered from it during test runs. For more information, see


    How to: Obtain Code Coverage Data


    and


    Instrumenting and Re-Signing Assemblies


    .




  • Deployment

    . Before tests are run, they are always copied to a

    deployment

    directory to ensure isolation and produce more reliable test results. Use the Deployment page to specify any additional files or directories you want copied to the deployment directory. For more information, see


    Test Deployment Overview


    and


    How to: Configure Test Deployment


    .




  • Hosts

    . Select

    ASP.NET

    if you want unit tests to run in the same process as an ASP.NET site. For other test types, including Web tests, choose

    Default

    . If you select ASP.NET, you can make additional choices to configure the way ASP.NET tests are run. For more information, see


    Overview of ASP.NET Unit Tests


    .




  • Setup and Cleanup Scripts

    . On this page, you can select scripts to be run before tests are run, and after tests are run, respectively. To identify a script, type its path in the box under

    Setup Script

    or

    Cleanup Script

    . Alternatively, click the ellipsis (…). This opens the

    Open

    dialog box, which you can use to select a script file.

    Setup scripts and cleanup scripts run before and after test runs, regardless of the types of tests that are contained in those test runs. For more information about scripts that are run together with test runs, see


    Test Deployment Overview


    .




  • Test Timeouts

    . You can use this page to can specify time-out values for test run and for individual tests. For more information, see


    How to: Set Time Limits for Running Tests


    .




  • Web Test

    . Set values to be used when a Web test is run. Note that the

    Simulate Think Times

    setting is ignored when the Web test is aggregated into a load test. For more information, see


    How to: Set Think Times in a Web Test


    .












    Note

    You cannot configure all aspects of test runs by using the test run configuration editor. For some aspects, you need to directly edit the XML file that contains test run configuration settings. For more information, see

    How to: Edit a Test Run Configuration File

    .














    Note

    The

    Controller and Agent

    page and the

    Web Test

    page are available only if you have Team Edition for Testers installed.






Creating and Removing Test Run Configurations



To add an initial test run configuration to your solution





  • Add a test project to your solution.

    A test run configuration is added automatically to the solution under the

    Solution Items

    folder.












    Note

    Each run configuration you create is listed as a choice for the

    Select Active Test Run Configuration

    and

    Edit Test Run Configurations

    options on the

    Test

    menu.







To add a subsequent test run configuration to your solution





  1. In Solution Explorer, right-click

    Solution Items

    and then point to

    Add

    , and then click

    New Item

    .

    The

    Add New Item

    dialog box appears.



  2. In the

    Categories

    pane, click

    Test Run Configuration

    .



  3. (Optional) In the

    Name

    box, change the name of the test run configuration file.



  4. Click

    Add

    .

    The new run configuration file appears in Solution Explorer, under the

    Solution Items

    folder.












    Note

    The list of test run configurations that Visual Studio displays — for example through the

    Select Active Test Run Configuration

    option on the Test menu — is derived from the list of test run configuration files in the

    Solution Items

    folder. This means that if you move a run configuration file to another location in your solution hierarchy, it can no longer be used as a test run configuration from within the Visual Studio IDE.





  5. The

    .testrunconfig

    dialog box appears.

    You can now set and save run configuration values. For more information, see the procedures in


    Setting Test Run Configuration Values


    .












    Note

    Each run configuration you create is listed as a choice for the

    Select Active Test Run Configuration

    and

    Edit Test Run Configurations

    options on the

    Test

    menu.







To remove a test run configuration from your solution





  • Under the Solution Items folder in Solution Explorer, right-click the test run configuration you want to remove, and then click

    Remove

    .

    The run configuration file is removed from your solution. This change is reflected in the list of choices for the

    Select Active Test Run Configuration

    and

    Edit Test Run Configurations

    options on the

    Test

    menu.





Setting Test Run Configuration Values



To edit a run configuration if you have a solution open





  1. Under the Solution Items folder in Solution Explorer, double-click the test run configuration file that you want to open.

    - or -



  2. Point to

    Edit Test Run Configurations

    on the

    Test

    menu and then click a run configuration on the submenu.

    The run configuration opens for editing.



  3. Make changes on the individual pages for each aspect of the run configuration. For more information, see the descriptions of each page earlier in this topic.



  4. Click

    Apply

    , and then click

    Close

    .





How to: Specify a Test Run Configuration




推荐阅读
  • 本文讨论了在openwrt-17.01版本中,mt7628设备上初始化启动时eth0的mac地址总是随机生成的问题。每次随机生成的eth0的mac地址都会写到/sys/class/net/eth0/address目录下,而openwrt-17.01原版的SDK会根据随机生成的eth0的mac地址再生成eth0.1、eth0.2等,生成后的mac地址会保存在/etc/config/network下。 ... [详细]
  • VScode格式化文档换行或不换行的设置方法
    本文介绍了在VScode中设置格式化文档换行或不换行的方法,包括使用插件和修改settings.json文件的内容。详细步骤为:找到settings.json文件,将其中的代码替换为指定的代码。 ... [详细]
  • 本文详细介绍了在Linux虚拟化部署中进行VLAN配置的方法。首先要确认Linux系统内核是否已经支持VLAN功能,然后配置物理网卡、子网卡和虚拟VLAN网卡的关系。接着介绍了在Linux配置VLAN Trunk的步骤,包括将物理网卡添加到VLAN、检查添加的VLAN虚拟网卡信息以及重启网络服务等。最后,通过验证连通性来确认配置是否成功。 ... [详细]
  • mysqldinitializeconsole失败_mysql03误删除了所有用户解决办法
    误删除了所有用户解决办法第一种方法(企业常用)1.将数据库down掉[rootdb03mysql]#etcinit.dmysqldstopShuttingdownMySQL..SU ... [详细]
  • IhaveconfiguredanactionforaremotenotificationwhenitarrivestomyiOsapp.Iwanttwodiff ... [详细]
  • CSS3选择器的使用方法详解,提高Web开发效率和精准度
    本文详细介绍了CSS3新增的选择器方法,包括属性选择器的使用。通过CSS3选择器,可以提高Web开发的效率和精准度,使得查找元素更加方便和快捷。同时,本文还对属性选择器的各种用法进行了详细解释,并给出了相应的代码示例。通过学习本文,读者可以更好地掌握CSS3选择器的使用方法,提升自己的Web开发能力。 ... [详细]
  • Android Studio Bumblebee | 2021.1.1(大黄蜂版本使用介绍)
    本文介绍了Android Studio Bumblebee | 2021.1.1(大黄蜂版本)的使用方法和相关知识,包括Gradle的介绍、设备管理器的配置、无线调试、新版本问题等内容。同时还提供了更新版本的下载地址和启动页面截图。 ... [详细]
  • 本文介绍了Oracle数据库中tnsnames.ora文件的作用和配置方法。tnsnames.ora文件在数据库启动过程中会被读取,用于解析LOCAL_LISTENER,并且与侦听无关。文章还提供了配置LOCAL_LISTENER和1522端口的示例,并展示了listener.ora文件的内容。 ... [详细]
  • 本文介绍了一个在线急等问题解决方法,即如何统计数据库中某个字段下的所有数据,并将结果显示在文本框里。作者提到了自己是一个菜鸟,希望能够得到帮助。作者使用的是ACCESS数据库,并且给出了一个例子,希望得到的结果是560。作者还提到自己已经尝试了使用"select sum(字段2) from 表名"的语句,得到的结果是650,但不知道如何得到560。希望能够得到解决方案。 ... [详细]
  • 如何在php中将mysql查询结果赋值给变量
    本文介绍了在php中将mysql查询结果赋值给变量的方法,包括从mysql表中查询count(学号)并赋值给一个变量,以及如何将sql中查询单条结果赋值给php页面的一个变量。同时还讨论了php调用mysql查询结果到变量的方法,并提供了示例代码。 ... [详细]
  • 本文介绍了在Linux下安装和配置Kafka的方法,包括安装JDK、下载和解压Kafka、配置Kafka的参数,以及配置Kafka的日志目录、服务器IP和日志存放路径等。同时还提供了单机配置部署的方法和zookeeper地址和端口的配置。通过实操成功的案例,帮助读者快速完成Kafka的安装和配置。 ... [详细]
  • MySQL语句大全:创建、授权、查询、修改等【MySQL】的使用方法详解
    本文详细介绍了MySQL语句的使用方法,包括创建用户、授权、查询、修改等操作。通过连接MySQL数据库,可以使用命令创建用户,并指定该用户在哪个主机上可以登录。同时,还可以设置用户的登录密码。通过本文,您可以全面了解MySQL语句的使用方法。 ... [详细]
  • 使用eclipse创建一个Java项目的步骤
    本文介绍了使用eclipse创建一个Java项目的步骤,包括启动eclipse、选择New Project命令、在对话框中输入项目名称等。同时还介绍了Java Settings对话框中的一些选项,以及如何修改Java程序的输出目录。 ... [详细]
  • ps:写的第一个,不足之处,欢迎拍砖---只是想用自己的方法一步步去实现一些框架看似高大上的小功能(比如说模型中的toArraytoJsonsetAtt ... [详细]
  • Summarize function is doing alignment without timezone ?
    Hi.Imtryingtogetsummarizefrom00:00otfirstdayofthismonthametric, ... [详细]
author-avatar
mikewuhan_689
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有