Interpreting Database Unit Test Results.
解释数据库单元测试结果。
How to: Configure Database Unit Test Execution.
如何:配置数据库单元测试执行。
Walkthrough: Creating and Running a Database Unit Test.
演练:创建和运行数据库单元测试。
The following table describes the files that interact to form a database unit test.
下表描述了相互作用以形成数据库单元测试的各种文件。
You can run your database unit tests in a particular order by using an ordered test.
可以使用顺序测试按特定的顺序运行数据库单元测试。
A database unit test consists of multiple items that are contained in several files.
资料库单元测试由多个项目组成,而这些项目又包含在数个档案中。
If you want to add more functionality to this database unit test, you can edit its code.
如果想向此数据库单元测试添加更多功能,则可以编辑其代码。
Create one or more test projects: You must create database unit tests in a test project.
建立一个或多个测试专案:您必须在测试专案中建立资料库单元测试。
You can use the following keyboard shortcuts to navigate within the Database Unit Test Designer.
可以使用以下键盘快捷键在“数据库单元测试设计器”中导航。
If you create a database unit test before you create a test project, a test project is created for you.
如果您在建立测试专案前就建立一个资料库单元测试,测试专案就已建立。
The following table provides a complete list of scripts that are associated with any database unit test.
下表将提供与任何资料库单元测试有关的完整指令码清单。
You can also create an empty database unit test and add code later to test other types of database objects.
您也可以建立一个空的资料库单元测试,稍后再新增程序码以测试其他类型的资料库专案。
This connection is used to test interactions with the database outside the test script in your database unit test.
此连接用于在数据库单元测试中的测试脚本之外测试与数据库间的交互。
Do different database unit tests need to access different database connections for test execution or test validation?
不同的数据库单元测试是否需要访问不同的数据库连接来执行或验证测试?
Learn more about database unit tests: You can learn more about the files and scripts that compose a database unit test.
设定单元测试如何执行:您可以将连接字串指定给执行测试、资料产生方案和部署设定的资料库。
Although you can configure aspects of test deployment, you typically do not need to configure them for database unit tests.
虽然可以配置测试部署的各个方面,但通常不需要配置它们即可运行数据库单元测试。
If you already have code that performs validation, you can use it in a database unit test instead of using test conditions.
如果已有执行验证的代码,则可以将其用于数据库单元测试,而不使用测试条件。
If you run database unit tests now, the data generation plan populates the database one time, at the start of your test run.
如果现在运行数据库单元测试,则数据生成计划将在测试运行开始时一次性填充数据库。
If you write unit tests only using the Database unit test Designer, you might not be familiar with the concept of a test class.
如果您只使用数据库单元测试设计器来编写单元测试,则您可能不熟悉测试类的概念。
By configuring your test project, you can specify several Settings that control aspects of how your database unit tests are run.
借由设定测试专案,您可以指定多项设定,控制如何执行资料库单元测试。
When you create a database unit test using the first procedure, a test project is automatically created for you if no test project exists.
当您使用第一个程序建立资料库单元测试时,如果没有测试专案存在,则会自动为您建立一个测试专案。
As a result, your solution can contain different sets of database unit tests (one set for each test project) that are configured to run differently.
因此,方案可以包含几组不同的资料库单元测试(每个测试专案都有一组),设定以不同的方式执行。
Before you run database unit tests, you should use a data generator to create realistic test data without exposing production data to your developers.
运行数据库单元测试之前,应使用数据生成器创建切实可行的测试数据,而不必向开发人员公开生产数据。
In addition to these three actions, there are also two test scripts (referred to as common scripts), which run before and after a database unit test runs.
除了这三个动作以外,也有两个测试指令码(称为通用指令码)会在执行资料库单元测试的前后来执行。
Before you can use a custom condition in the Database Unit Test Designer, you must install the assembly that contains the condition into the global assembly cache.
必须先将包含自定义条件的程序集安装到全局程序集缓存中,然后才能在数据库单元测试设计器中使用该条件。
This file stores the database connection strings for the test project, in addition to other database unit test configuration Settings such as command time-out, data generation file, and so on.
此文件存储测试项目的数据库连接字符串,以及其他数据库单元测试配置设置,如命令超时、数据生成文件等。
If we had to reset a database to a known state before each unit test, the tests would be quite complex and certainly would run slower than we desire.
如果我们需要在每次单元测试前将数据库重新设置到一个已知状态,那么测试会相当复杂并且运行速度自然会比我们期望得要慢。
For example, a database connection for a particular unit test might record the query while always returning the same hardwired result.
例如,虽然某一特定单元测试的数据库连接始终返回相同的硬连接结果,但可能会记录查询。
You estimate a day to write each database access class and unit test it, so 150 tables at one table per day is 150 days.
估计您每天能编写一个数据库访问类并完成其单元测试,因此,150 个表要用 150天的时间。
For example, to unit test an object that USES a database, it may be burdensome to install, configure, and seed a local copy of the database, run your tests, then tear the local database down again.
例如,要单元测试一个使用数据库的对象,安装、配置和发送本地数据库副本、运行测试然后再卸装本地数据库可能很麻烦。
应用推荐