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

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

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

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

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

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

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