public void QueryForListOfT_never_returns_null() { string sql = "SELECT tbl_name FROM sqlite_master WHERE type = 'PSG'"; using var connection = TestUtil.CreateSQLiteWrappedCnx(); Assert.True(WrappedConnectionEx.QueryForList(connection, sql, (r) => new { Item1 = r.GetString(0) }).Count() == 0); }
public void QueryForListOfT_works() { var expected = new[] { new { Item1 = "azerty", Item2 = "qwerty" } }.ToList(); string sql = "SELECT 'azerty','qwerty';"; using var connection = TestUtil.CreateSQLiteWrappedCnx(); Assert.Equal(expected, WrappedConnectionEx.QueryForList(connection, sql, (r) => new { Item1 = r.GetString(0), Item2 = r.GetString(1) })); }