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

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

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

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

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

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

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