开启资料库单元测试。
执行资料库单元测试。
在新的测试类别内建立新的资料库单元测试。
在现有的测试类别内建立新的资料库单元测试。
Create a new database unit test inside an existing test class.
资料库单元测试。
若要执行资料库单元测试,其他执行阶段组件是必要的。
To run database unit tests, additional runtime assemblies are required.
下表将提供与任何资料库单元测试有关的完整指令码清单。
The following table provides a complete list of scripts that are associated with any database unit test.
下列程序将说明如何为任何资料库物件建立资料库单元测试。
The following procedures explain how to create database unit tests for any database object.
资料库单元测试由多个项目组成,而这些项目又包含在数个档案中。
A database unit test consists of multiple items that are contained in several files.
建立一个或多个测试专案:您必须在测试专案中建立资料库单元测试。
Create one or more test projects: You must create database unit tests in a test project.
借由设定测试专案,您可以指定多项设定,控制如何执行资料库单元测试。
By configuring your test project, you can specify several Settings that control aspects of how your database unit tests are run.
如果您在建立测试专案前就建立一个资料库单元测试,测试专案就已建立。
If you create a database unit test before you create a test project, a test project is created for you.
例如,您必须先建置资料库专案,才可以建置内含该资料库单元测试的任何专案。
For example, you must build a database project before you build any projects that contain unit tests for that database.
您的资料库单元测试未使用完整的名称,及其他结构描述或资料库中的测试参考物件。
You have database unit tests that do not use fully qualified names and those tests reference objects in other schemas or databases.
您也可以建立一个空的资料库单元测试,稍后再新增程序码以测试其他类型的资料库专案。
You can also create an empty database unit test and add code later to test other types of database objects.
因此,方案可以包含几组不同的资料库单元测试(每个测试专案都有一组),设定以不同的方式执行。
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.
当您使用第一个程序建立资料库单元测试时,如果没有测试专案存在,则会自动为您建立一个测试专案。
When you create a database unit test using the first procedure, a test project is automatically created for you if no test project exists.
除了这三个动作以外,也有两个测试指令码(称为通用指令码)会在执行资料库单元测试的前后来执行。
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.
避免破坏现有的资料库程式码:在将变更与小组共用前或将变更部署至实际执行环境前,如果能先执行现有的资料库单元测试,可以降低中断应用程式行为的风险。
Performing iterative database development: If you are a developer or a tester, you check out parts of the project and then update them in an isolated development environment.
测试变更:您可以对已修改的资料库或伺服器执行现有的单元测试,以确认变更不会中断应用程序的任何行为。
Test your changes: you can run existing unit tests against the modified database or server to verify that your changes do not break any behavior of your application.
您可以定义单元测试,以验证资料库物件的行为。
You can define unit tests to verify the behavior of your database objects.
您可以定义单元测试来验证资料库物件的行为,以及将每一个测试专案与不同的资料产生计划、部署组态和连接字串产生关联。
You can define unit tests to verify the behavior of your database objects and associate each test project with a different data generation plan, deployment configuration, and connection string.
将单元测试包含在资料库专案中来验证您对资料库物件所做的变更时,并不会中断现有的功能。
Include unit tests in your database project to verify changes you make to database objects do not break existing functionality.
设定单元测试如何执行:您可以将连接字串指定给执行测试、资料产生方案和部署设定的资料库。
Learn more about database unit tests: You can learn more about the files and scripts that compose a database unit test.
设定单元测试如何执行:您可以将连接字串指定给执行测试、资料产生方案和部署设定的资料库。
Learn more about database unit tests: You can learn more about the files and scripts that compose a database unit test.
应用推荐