SqlDatabaseTestService Class

 

Provides common functionality that is used by the SqlDatabaseTestClass and methods during test execution.

Namespace:   Microsoft.Data.Tools.Schema.Sql.UnitTesting
Assembly:  Microsoft.Data.Tools.Schema.Sql.UnitTesting (in Microsoft.Data.Tools.Schema.Sql.UnitTesting.dll)

System.Object
  Microsoft.Data.Tools.Schema.Sql.UnitTesting.SqlDatabaseTestService

public class SqlDatabaseTestService

NameDescription
System_CAPS_pubmethodSqlDatabaseTestService()

Initializes a new instance of the SqlDatabaseTestService class.

NameDescription
System_CAPS_pubmethodDeployDatabaseProject()

Deploys the database project by using the settings of the user in the app.config file.

System_CAPS_protmethodSystem_CAPS_staticDeployDatabaseProject(String, String, String, String)

Deploys a database project to the database that is specified in the referenced configuration.

System_CAPS_pubmethodEquals(Object)

(Inherited from Object.)

System_CAPS_pubmethodExecute(ConnectionContext, ConnectionContext, SqlDatabaseTestAction, DbParameter[])

Executes the supplied SqlDatabaseTestAction and evaluates the results of the execution by using each TestCondition that is contained in the Conditions collection.

System_CAPS_protmethodFinalize()

(Inherited from Object.)

System_CAPS_pubmethodGenerateData()

When overridden in a derived class, generates data by using the settings of the user in the app.config file.

System_CAPS_pubmethodGetHashCode()

(Inherited from Object.)

System_CAPS_pubmethodGetType()

(Inherited from Object.)

System_CAPS_protmethodMemberwiseClone()

(Inherited from Object.)

System_CAPS_pubmethodOpenExecutionContext()

Opens the ConnectionContext that will be used for a test execution.

System_CAPS_pubmethodOpenPrivilegedContext()

Opens the context that is used when the results of SQL execution are verified and when the database is set up.

System_CAPS_pubmethodToString()

(Inherited from Object.)

The services provided by this class include the following:

  • Reading the application configuration to open and supply database connections.

  • Executing the Transact-SQL script.

  • Evaluating test conditions.

  • Deploying database projects that are based on application configuration.

  • Generating data by using a data generator configuration.

To provide your own custom SqlDatabaseTestService implementation, override methods in this class. This is the primary mechanism for modifying how tests are executed, how test conditions are evaluated, and how connections are created while still working in the context of the Database Unit Test Designer.

When you create your implementation, it must be registered by using the TestService. If you want to open an execution context and you do not want to use impersonation, also implement your own ConnectionContext.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show: