public void TestSqLiteConnectionAverageWithHints() { using (var connection = new SQLiteConnection(Database.ConnectionStringSDS)) { // Setup var tables = Database.CreateSdsCompleteTables(10, connection); // Act connection.Average <SdsCompleteTable>(e => e.ColumnInt, (object)null, hints: "WhatEver"); } }
public void TestSqLiteConnectionAverageViaTableNameWithHints() { using (var connection = new SQLiteConnection(Database.ConnectionStringSDS)) { // Setup var tables = Database.CreateSdsCompleteTables(10, connection); // Act connection.Average(ClassMappedNameCache.Get <SdsCompleteTable>(), Field.Parse <SdsCompleteTable>(e => e.ColumnInt).First(), (object)null, hints: "WhatEver"); } }
public void TestSqLiteConnectionAverageWithoutExpression() { using (var connection = new SQLiteConnection(Database.ConnectionStringSDS)) { // Setup var tables = Database.CreateSdsCompleteTables(10, connection); // Act var result = connection.Average <SdsCompleteTable>(e => e.ColumnInt, (object)null); // Assert Assert.AreEqual(tables.Average(e => e.ColumnInt), result); } }
public void TestSqLiteConnectionAverageWithExpression() { using (var connection = new SQLiteConnection(Database.ConnectionStringSDS)) { // Setup var tables = Database.CreateSdsCompleteTables(10, connection); // Act var ids = new[] { tables.First().Id, tables.Last().Id }; var result = connection.Average <SdsCompleteTable>(e => e.ColumnInt, e => ids.Contains(e.Id)); // Assert Assert.AreEqual(tables.Where(e => ids.Contains(e.Id)).Average(e => e.ColumnInt), result); } }
public void TestSqLiteConnectionAverageViaTableNameWithoutExpression() { using (var connection = new SQLiteConnection(Database.ConnectionStringSDS)) { // Setup var tables = Database.CreateSdsCompleteTables(10, connection); // Act var result = connection.Average(ClassMappedNameCache.Get <SdsCompleteTable>(), Field.Parse <SdsCompleteTable>(e => e.ColumnInt).First(), (object)null); // Assert Assert.AreEqual(tables.Average(e => e.ColumnInt), result); } }
public void TestSqLiteConnectionAverageViaTableNameWithExpression() { using (var connection = new SQLiteConnection(Database.ConnectionStringSDS)) { // Setup var tables = Database.CreateSdsCompleteTables(10, connection); // Act var ids = new[] { tables.First().Id, tables.Last().Id }; var result = connection.Average(ClassMappedNameCache.Get <SdsCompleteTable>(), Field.Parse <SdsCompleteTable>(e => e.ColumnInt).First(), new QueryField("Id", Operation.In, ids)); // Assert Assert.AreEqual(tables.Where(e => ids.Contains(e.Id)).Average(e => e.ColumnInt), result); } }