You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// Fixture for sharing a container instance across multiple tests in a single class.
5
+
/// See <a href="https://xunit.net/docs/shared-context">Shared Context between Tests</a> from xUnit.net documentation for more information about fixtures.
6
+
/// A logger is automatically configured to write diagnostic messages to xUnit's <see cref="IMessageSink"/>.
7
+
/// </summary>
8
+
/// <param name="messageSink">The message sink used for reporting diagnostic messages.</param>
/// Fixture for sharing a database container instance across multiple tests in a single class.
5
+
/// See <a href="https://xunit.net/docs/shared-context">Shared Context between Tests</a> from xUnit.net documentation for more information about fixtures.
6
+
/// A logger is automatically configured to write diagnostic messages to xUnit's <see cref="IMessageSink"/>.
varconnection=_dbProviderFactory.CreateConnection()??thrownewInvalidOperationException($"DbProviderFactory.CreateConnection() returned null for {_dbProviderFactory}");
/// Method to ease working with DbConnection, DbCommand and DbBatch provided by both
5
+
/// <see cref="DbContainerFixture{TBuilderEntity,TContainerEntity}"/> and <see cref="DbContainerTest{TBuilderEntity,TContainerEntity}"/>.
6
+
/// </summary>
7
+
internalinterfaceIDbContainerTestMethods
8
+
{
9
+
/// <summary>
10
+
/// Returns a new, closed connection to the database.
11
+
/// </summary>
12
+
/// <remarks>
13
+
/// The connection must be opened before it can be used.
14
+
/// <para />
15
+
/// It is the responsibility of the caller to properly dispose the connection returned by this method. Failure to do so may result in a connection leak.
16
+
/// </remarks>
17
+
/// <returns>A new, closed connection to the database.</returns>
18
+
DbConnectionCreateConnection();
19
+
20
+
#if NET8_0_OR_GREATER
21
+
/// <summary>
22
+
/// Returns a new, open connection to the database.
23
+
/// </summary>
24
+
/// <remarks>
25
+
/// The returned connection is already open, and is ready for immediate use.
26
+
/// <para />
27
+
/// It is the responsibility of the caller to properly dispose the connection returned by this method. Failure to do so may result in a connection leak.
28
+
/// </remarks>
29
+
/// <returns>A new, open connection to the database represented.</returns>
30
+
DbConnectionOpenConnection();
31
+
32
+
/// <summary>
33
+
/// Asynchronously returns a new, open connection to the database.
34
+
/// </summary>
35
+
/// <remarks>
36
+
/// The returned connection is already open, and is ready for immediate use.
37
+
/// <para />
38
+
/// It is the responsibility of the caller to properly dispose the connection returned by this method. Failure to do so may result in a connection leak.
39
+
/// </remarks>
40
+
/// <param name="cancellationToken">A token to cancel the asynchronous operation.</param>
41
+
/// <returns>A new, open connection to the database.</returns>
/// Returns a <see cref="DbCommand" /> that's ready for execution against the database.
46
+
/// </summary>
47
+
/// <remarks>
48
+
/// Commands returned from this method are already configured to execute against the database; their <see cref="DbCommand.Connection"/> does not need to be set, and doing so will throw an exception.
49
+
/// </remarks>
50
+
/// <param name="commandText">The text command with which to initialize the <see cref="DbCommand" /> that this method returns.</param>
51
+
/// <returns>A <see cref="DbCommand" /> that's ready for execution against the database.</returns>
/// Returns a <see cref="DbBatch" /> that's ready for execution against the database.
56
+
/// </summary>
57
+
/// <remarks>
58
+
/// Batches returned from this method are already configured to execute against the database; their <see cref="DbCommand.Connection"/> does not need to be set, and doing so will throw an exception.
59
+
/// </remarks>
60
+
/// <returns>A <see cref="DbBatch" /> that's ready for execution against the database.</returns>
0 commit comments