public void TestSqLiteConnectionAverageAsyncWithHints() { using (var connection = new SQLiteConnection(Database.ConnectionStringSDS)) { // Setup var tables = Database.CreateSdsCompleteTables(10, connection); // Act connection.AverageAsync <SdsCompleteTable>(e => e.ColumnInt, (object)null, hints: "WhatEver").Wait(); } }
public void TestSqLiteConnectionAverageAsyncViaTableNameWithHints() { using (var connection = new SQLiteConnection(Database.ConnectionStringSDS)) { // Setup var tables = Database.CreateSdsCompleteTables(10, connection); // Act connection.AverageAsync(ClassMappedNameCache.Get <SdsCompleteTable>(), Field.Parse <SdsCompleteTable>(e => e.ColumnInt).First(), (object)null, hints: "WhatEver").Wait(); } }
public void TestSqLiteConnectionAverageAsyncWithoutExpression() { using (var connection = new SQLiteConnection(Database.ConnectionStringSDS)) { // Setup var tables = Database.CreateSdsCompleteTables(10, connection); // Act var result = connection.AverageAsync <SdsCompleteTable>(e => e.ColumnInt, (object)null).Result; // Assert Assert.AreEqual(tables.Average(e => e.ColumnInt), result); } }
public void TestSqLiteConnectionAverageAsyncViaTableNameWithoutExpression() { using (var connection = new SQLiteConnection(Database.ConnectionStringSDS)) { // Setup var tables = Database.CreateSdsCompleteTables(10, connection); // Act var result = connection.AverageAsync(ClassMappedNameCache.Get <SdsCompleteTable>(), Field.Parse <SdsCompleteTable>(e => e.ColumnInt).First(), (object)null).Result; // Assert Assert.AreEqual(tables.Average(e => e.ColumnInt), result); } }
public void TestSqLiteConnectionAverageAsyncWithExpression() { 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.AverageAsync <SdsCompleteTable>(e => e.ColumnInt, e => ids.Contains(e.Id)).Result; // Assert Assert.AreEqual(tables.Where(e => ids.Contains(e.Id)).Average(e => e.ColumnInt), result); } }
public void TestSqLiteConnectionAverageAsyncViaTableNameWithExpression() { 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.AverageAsync(ClassMappedNameCache.Get <SdsCompleteTable>(), Field.Parse <SdsCompleteTable>(e => e.ColumnInt).First(), new QueryField("Id", Operation.In, ids)).Result; // Assert Assert.AreEqual(tables.Where(e => ids.Contains(e.Id)).Average(e => e.ColumnInt), result); } }