Пример #1
0
        public void ThrowExceptionOnPostgreSqlConnectionCountAllAsyncWithHints()
        {
            // Setup
            var tables = Database.CreateCompleteTables(10);

            using (var connection = new NpgsqlConnection(Database.ConnectionString))
            {
                // Act
                connection.CountAllAsync <CompleteTable>(hints: "WhatEver").Wait();
            }
        }
Пример #2
0
 public void TestSqlTransactionForCountAllAsync()
 {
     using (var connection = new NpgsqlConnection(Database.ConnectionString))
     {
         // Prepare
         using (var transaction = connection.EnsureOpen().BeginTransaction())
         {
             // Act
             connection.CountAllAsync <CompleteTable>(transaction: transaction).Wait();
         }
     }
 }
Пример #3
0
        public void ThrowExceptionOnPostgreSqlConnectionCountAllAsyncViaTableNameWithHints()
        {
            // Setup
            var tables = Database.CreateCompleteTables(10);

            using (var connection = new NpgsqlConnection(Database.ConnectionString))
            {
                // Act
                connection.CountAllAsync(ClassMappedNameCache.Get <CompleteTable>(),
                                         hints: "WhatEver").Wait();
            }
        }
Пример #4
0
        public void TestPostgreSqlConnectionCountAllAsync()
        {
            // Setup
            var tables = Database.CreateCompleteTables(10);

            using (var connection = new NpgsqlConnection(Database.ConnectionString))
            {
                // Act
                var result = connection.CountAllAsync <CompleteTable>().Result;

                // Assert
                Assert.AreEqual(tables.Count(), result);
            }
        }