热门标签 | 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




推荐阅读
  • 在Linux系统中,网络配置是至关重要的任务之一。本文详细解析了Firewalld和Netfilter机制,并探讨了iptables的应用。通过使用`ip addr show`命令来查看网卡IP地址(需要安装`iproute`包),当网卡未分配IP地址或处于关闭状态时,可以通过`ip link set`命令进行配置和激活。此外,文章还介绍了如何利用Firewalld和iptables实现网络流量控制和安全策略管理,为系统管理员提供了实用的操作指南。 ... [详细]
  • 本文介绍了如何在 Spring Boot 项目中使用 spring-boot-starter-quartz 组件实现定时任务,并将 cron 表达式存储在数据库中,以便动态调整任务执行频率。 ... [详细]
  • Leetcode学习成长记:天池leetcode基础训练营Task01数组
    前言这是本人第一次参加由Datawhale举办的组队学习活动,这个活动每月一次,之前也一直关注,但未亲身参与过,这次看到活动 ... [详细]
  • 本文将介绍如何在混合开发(Hybrid)应用中实现Native与HTML5的交互,包括基本概念、学习目标以及具体的实现步骤。 ... [详细]
  • 2020年9月15日,Oracle正式发布了最新的JDK 15版本。本次更新带来了许多新特性,包括隐藏类、EdDSA签名算法、模式匹配、记录类、封闭类和文本块等。 ... [详细]
  • 三角测量计算三维坐标的代码_双目三维重建——层次化重建思考
    双目三维重建——层次化重建思考FesianXu2020.7.22atANTFINANCIALintern前言本文是笔者阅读[1]第10章内容的笔记,本文从宏观的角度阐 ... [详细]
  • 如果应用程序经常播放密集、急促而又短暂的音效(如游戏音效)那么使用MediaPlayer显得有些不太适合了。因为MediaPlayer存在如下缺点:1)延时时间较长,且资源占用率高 ... [详细]
  • [转]doc,ppt,xls文件格式转PDF格式http:blog.csdn.netlee353086articledetails7920355确实好用。需要注意的是#import ... [详细]
  • php更新数据库字段的函数是,php更新数据库字段的函数是 ... [详细]
  • 在使用 Cacti 进行监控时,发现已运行的转码机未产生流量,导致 Cacti 监控界面显示该转码机处于宕机状态。进一步检查 Cacti 日志,发现数据库中存在 SQL 查询失败的问题,错误代码为 145。此问题可能是由于数据库表损坏或索引失效所致,建议对相关表进行修复操作以恢复监控功能。 ... [详细]
  • 基于Net Core 3.0与Web API的前后端分离开发:Vue.js在前端的应用
    本文介绍了如何使用Net Core 3.0和Web API进行前后端分离开发,并重点探讨了Vue.js在前端的应用。后端采用MySQL数据库和EF Core框架进行数据操作,开发环境为Windows 10和Visual Studio 2019,MySQL服务器版本为8.0.16。文章详细描述了API项目的创建过程、启动步骤以及必要的插件安装,为开发者提供了一套完整的开发指南。 ... [详细]
  • 在C#编程中,数值结果的格式化展示是提高代码可读性和用户体验的重要手段。本文探讨了多种格式化方法和技巧,如使用格式说明符、自定义格式字符串等,以实现对数值结果的精确控制。通过实例演示,展示了如何灵活运用这些技术来满足不同的展示需求。 ... [详细]
  • 为了确保iOS应用能够安全地访问网站数据,本文介绍了如何在Nginx服务器上轻松配置CertBot以实现SSL证书的自动化管理。通过这一过程,可以确保应用始终使用HTTPS协议,从而提升数据传输的安全性和可靠性。文章详细阐述了配置步骤和常见问题的解决方法,帮助读者快速上手并成功部署SSL证书。 ... [详细]
  • 本文详细解析了使用C++实现的键盘输入记录程序的源代码,该程序在Windows应用程序开发中具有很高的实用价值。键盘记录功能不仅在远程控制软件中广泛应用,还为开发者提供了强大的调试和监控工具。通过具体实例,本文深入探讨了C++键盘记录程序的设计与实现,适合需要相关技术的开发者参考。 ... [详细]
  • 本文介绍了如何利用 Delphi 中的 IdTCPServer 和 IdTCPClient 控件实现高效的文件传输。这些控件在默认情况下采用阻塞模式,并且服务器端已经集成了多线程处理,能够支持任意大小的文件传输,无需担心数据包大小的限制。与传统的 ClientSocket 相比,Indy 控件提供了更为简洁和可靠的解决方案,特别适用于开发高性能的网络文件传输应用程序。 ... [详细]
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社区 版权所有