Esempio n. 1
0
 public void VerifyAnsiNullAndQuotedIdentifierSettingsReplayed()
 {
     using (ReliableSqlConnection conn = (ReliableSqlConnection)ReliableConnectionHelper.OpenConnection(CreateTestConnectionStringBuilder(), useRetry: true, azureAccountToken: null))
     {
         VerifySessionSettings(conn, true);
         VerifySessionSettings(conn, false);
     }
 }
Esempio n. 2
0
 public void VerifyAnsiNullAndQuotedIdentifierSettingsReplayed()
 {
     TestUtils.RunIfWindows(() =>
     {
         using (ReliableSqlConnection conn = (ReliableSqlConnection)ReliableConnectionHelper.OpenConnection(CreateTestConnectionStringBuilder(), useRetry: true))
         {
             VerifySessionSettings(conn, true);
             VerifySessionSettings(conn, false);
         }
     });
 }
Esempio n. 3
0
        public void TestOpenConnectionOpensConnection()
        {
            using (var connection = CreateTestConnection())
            {
                Assert.NotNull(connection);

                Assert.True(connection.State == ConnectionState.Closed);
                ReliableConnectionHelper.OpenConnection(connection);
                Assert.True(connection.State == ConnectionState.Open);
            }
        }
Esempio n. 4
0
        public void TestGetDefaultDatabaseFilePath()
        {
            var connectionBuilder = CreateTestConnectionStringBuilder();

            Assert.NotNull(connectionBuilder);

            string filePath = string.Empty;
            string logPath  = string.Empty;

            ReliableConnectionHelper.OpenConnection(
                connectionBuilder,
                usingConnection: (conn) =>
            {
                filePath = ReliableConnectionHelper.GetDefaultDatabaseFilePath(conn);
                logPath  = ReliableConnectionHelper.GetDefaultDatabaseLogPath(conn);
            },
                catchException: null,
                useRetry: false);

            Assert.False(string.IsNullOrWhiteSpace(filePath));
            Assert.False(string.IsNullOrWhiteSpace(logPath));
        }