Getting tweets by the maximum number, not by pages as before

BREAKING CHANGE!
This commit is contained in:
Alexander Sheiko 2020-06-15 16:16:08 +03:00
parent a5117bb5c4
commit 49baceb5b4
3 changed files with 19 additions and 10 deletions

View file

@ -7,7 +7,8 @@ import (
func TestGetTweets(t *testing.T) {
count := 0
for tweet := range GetTweets(context.Background(), "nomadic_ua", 2) {
maxTweetsNbr := 50
for tweet := range GetTweets(context.Background(), "Twitter", maxTweetsNbr) {
if tweet.Error != nil {
t.Error(tweet.Error)
} else {
@ -32,7 +33,7 @@ func TestGetTweets(t *testing.T) {
}
}
}
if count == 0 {
t.Error("Expected tweets count is greater than zero")
if count != maxTweetsNbr {
t.Errorf("Expected tweets count=%v, got: %v", maxTweetsNbr, count)
}
}