mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-22 06:53:52 +00:00
trade: test gid parameter
This commit is contained in:
parent
9fb273e6a1
commit
2c2e5afa45
|
@ -110,6 +110,10 @@ func TestTradeService_Query(t *testing.T) {
|
||||||
assert.Error(t, err)
|
assert.Error(t, err)
|
||||||
assert.Equal(t, "invalid order by column: invalid_column", err.Error())
|
assert.Equal(t, "invalid order by column: invalid_column", err.Error())
|
||||||
|
|
||||||
|
mock.ExpectQuery("SELECT \\* FROM trades WHERE gid > \\? ORDER BY gid ASC").WithArgs(1234).WillReturnError(sql.ErrNoRows)
|
||||||
|
_, err = s.Query(QueryTradesOptions{LastGID: 1234, Ordering: "ASC", OrderByColumn: "gid"})
|
||||||
|
assert.Equal(t, sql.ErrNoRows, err)
|
||||||
|
|
||||||
mock.ExpectQuery("SELECT \\* FROM trades ORDER BY gid DESC").WillReturnError(sql.ErrNoRows)
|
mock.ExpectQuery("SELECT \\* FROM trades ORDER BY gid DESC").WillReturnError(sql.ErrNoRows)
|
||||||
_, err = s.Query(QueryTradesOptions{Ordering: "DESC", OrderByColumn: "gid"})
|
_, err = s.Query(QueryTradesOptions{Ordering: "DESC", OrderByColumn: "gid"})
|
||||||
assert.Equal(t, sql.ErrNoRows, err)
|
assert.Equal(t, sql.ErrNoRows, err)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user