-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreview_list_test.go
More file actions
31 lines (25 loc) · 905 Bytes
/
review_list_test.go
File metadata and controls
31 lines (25 loc) · 905 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package goodreads
import (
"fmt"
"testing"
)
func TestGetShelf(t *testing.T) {
config := readConfig()
c := NewClientWithToken(config.GoodReadsKey, config.GoodReadsSecret, config.UserToken, config.UserSecret)
if response, err := c.GetShelf("22966785", ReviewListParameters{Shelf: "read-next"}); err != nil && response.Reviews_review[0].Reviews_book.Reviews_title.Text == "The Collapsing Empire (The Interdependency #1)" {
fmt.Println("Get Shelf: " + err.Error())
t.Fail()
} else {
fmt.Println(response)
}
}
func TestGetShelfWithPages(t *testing.T) {
config := readConfig()
c := NewClientWithToken(config.GoodReadsKey, config.GoodReadsSecret, config.UserToken, config.UserSecret)
if _, err := c.GetShelf("22966785", ReviewListParameters{Shelf: "read", Page: 2, PerPage: 50}); err != nil {
fmt.Println("Get Shelf: " + err.Error())
t.Fail()
} else {
fmt.Println("Get Shelf")
}
}