Class SqlOptions
Configures how ProtoTest owns and isolates a database connection during a test.
public sealed class SqlOptions : IProtoConfigurableOptions
- Inheritance
-
SqlOptions
- Implements
- Inherited Members
- Extension Methods
Fields
ConfigurationSectionName
public const string ConfigurationSectionName = "ProtoTest:Sql"
Field Value
Properties
Isolation
Gets or sets the isolation applied to each test. Defaults to Transaction.
public SqlIsolation Isolation { get; set; }
Property Value
SharedWith
Gets the applications declared as using the test's connection.
public IReadOnlyCollection<string> SharedWith { get; }
Property Value
SharedWithApplications
Gets or sets the applications declared as sharing the test's connection, for configuration
binding (ProtoTest:Sql:SharedWithApplications). Prefer ShareConnectionWith(params string[]).
public List<string> SharedWithApplications { get; set; }
Property Value
Methods
ShareConnectionWith(params string[])
Declares that an application uses the connection ProtoTest owns, so Transaction rolls back the application's writes too. When the host registers applications, every one of them must be declared for the transaction strategy to run.
public SqlOptions ShareConnectionWith(params string[] applicationNames)
Parameters
applicationNamesstring[]
Returns
SharesConnectionWith(string)
Returns whether an application was declared as sharing the test's connection.
public bool SharesConnectionWith(string applicationName)
Parameters
applicationNamestring