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

            using (var connection = new NpgsqlConnection(Database.ConnectionString))
            {
                // Act
                connection.AverageAllAsync <CompleteTable>(e => e.ColumnInteger,
                                                           hints: "WhatEver").Wait();
            }
        }
Пример #2
0
        public void ThrowExceptionOnPostgreSqlConnectionAverageAllAsyncViaTableNameWithHints()
        {
            // Setup
            var tables = Database.CreateCompleteTables(10);

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

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

                // Assert
                Assert.AreEqual(tables.Average(e => e.ColumnInteger), Convert.ToDouble(result));
            }
        }
Пример #4
0
        public void TestPostgreSqlConnectionAverageAllAsyncViaTableName()
        {
            // Setup
            var tables = Database.CreateCompleteTables(10);

            using (var connection = new NpgsqlConnection(Database.ConnectionString))
            {
                // Act
                var result = connection.AverageAllAsync(ClassMappedNameCache.Get <CompleteTable>(),
                                                        Field.Parse <CompleteTable>(e => e.ColumnInteger)).Result;

                // Assert
                Assert.AreEqual(tables.Average(e => e.ColumnInteger), Convert.ToDouble(result));
            }
        }