예제 #1
0
    public void TestGetDataFromReader()
    {
        var columns = new List <Column>
        {
            new Column {
                ColumnName = "AlbumId"
            },
            new Column {
                ColumnName = "Title"
            },
            new Column {
                ColumnName = "ArtistId"
            },
        };

        IDataReader reader = null;

        using (IRepository repo = new SQLiteRepository(chinookConnectionString))
        {
            reader = repo.GetDataFromReader("Album", columns);
            while (reader.Read())
            {
                Assert.IsTrue(reader.GetValue(0).GetType() == typeof(long));
                Assert.IsTrue(reader.GetValue(2).GetType() == typeof(long));
            }
        }
    }
예제 #2
0
    public void TestGetDataFromReader()
    {
        var columns = new List<Column> 
        {   new Column { ColumnName = "AlbumId"},
            new Column { ColumnName = "Title"},
            new Column { ColumnName = "ArtistId"},
        };       

        IDataReader reader = null;

        using (IRepository repo = new SQLiteRepository(chinookConnectionString))
        {
            reader = repo.GetDataFromReader("Album", columns);
            while (reader.Read())
            {
                Assert.IsTrue(reader.GetValue(0).GetType() == typeof(long));
                Assert.IsTrue(reader.GetValue(2).GetType() == typeof(long));
            }
        }
    }