impr: correct offset usage and add setters, add tests

This commit is contained in:
Mike Berezin
2021-01-29 13:21:39 +03:00
committed by mehanizm
parent e2b494035f
commit 420d81196b
5 changed files with 52 additions and 10 deletions

View File

@@ -27,6 +27,9 @@ func TestGetRecordsConfig_Do(t *testing.T) {
WithSort(sortQuery1, sortQuery2).
ReturnFields("Field1", "Field2").
InStringFormat("Europe/Moscow", "ru").
MaxRecords(100).
PageSize(10).
WithOffset("hhh").
Do()
if err != nil {
t.Errorf("there should not be an err, but was: %v", err)
@@ -34,4 +37,10 @@ func TestGetRecordsConfig_Do(t *testing.T) {
if len(records.Records) != 3 {
t.Errorf("there should be 3 records, but was %v", len(records.Records))
}
table.client.baseURL = mockErrorResponse(400).URL
records, err = table.GetRecords().Do()
if err == nil {
t.Errorf("there should be an err, but was nil")
}
}