2020-02-12 10:45:19 +02:00
|
|
|
package twitterscraper
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"testing"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
func TestGetTrends(t *testing.T) {
|
|
|
|
|
trends, err := GetTrends()
|
|
|
|
|
if err != nil {
|
|
|
|
|
t.Error(err)
|
|
|
|
|
}
|
|
|
|
|
|
2020-12-11 20:58:49 +02:00
|
|
|
if len(trends) != 20 {
|
|
|
|
|
t.Errorf("Expected 20 trends, got %d: %#v", len(trends), trends)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for _, trend := range trends {
|
|
|
|
|
if trend == "" {
|
2021-04-22 20:35:33 +03:00
|
|
|
t.Error("Expected trend is empty")
|
2020-12-11 20:58:49 +02:00
|
|
|
}
|
2020-02-12 10:45:19 +02:00
|
|
|
}
|
|
|
|
|
}
|